[Ext] BackTrack Tab History

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
Kevin Jones
Posts: 625
Joined: August 12th, 2009, 10:22 am

Re: [Ext] BackTrack Tab History

Post by Kevin Jones »

Hello Alex,

It appears that Backtrack's onTabClosing handler accesses browser.messageManager on lazy-browser tabs, which will always force insertion of the browser (make it non-lazy).

I've filed bug 1362092: https://bugzilla.mozilla.org/show_bug.cgi?id=1362092

[bug 1345098] Lazy browser prematurely inserted via 'messageManager' property access:
getter@chrome://browser/content/tabbrowser.xml:2122:45
onTabClosing@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///Users/allasso/Library/Application%20Support/Firefox/Profiles/ALT2/extensions/backtrack@byalexv.co.uk.xpi!/bootstrap.js:1164:9
onSSTabClosing@resource://gre/modules/addons/XPIProvider.jsm -> jar:file:///Users/allasso/Library/Application%20Support/Firefox/Profiles/ALT2/extensions/backtrack@byalexv.co.uk.xpi!/bootstrap.js:1094:5
ssi_onTabClose@resource:///modules/sessionstore/SessionStore.jsm:1930:5
ssi_handleEvent@resource:///modules/sessionstore/SessionStore.jsm:1012:11
_beginRemoveTab@chrome://browser/content/tabbrowser.xml:2772:13
removeTab@chrome://browser/content/tabbrowser.xml:2639:18
removeAllTabsBut@chrome://browser/content/tabbrowser.xml:2587:19
oncommand@chrome://browser/content/browser.xul:1:1
AlexVallat
Posts: 90
Joined: September 30th, 2006, 8:53 am

Re: [Ext] BackTrack Tab History

Post by AlexVallat »

Thank you for reporting this. Please try the dev channel version v0.16 which should resolve the issue.
Kevin Jones
Posts: 625
Joined: August 12th, 2009, 10:22 am

Re: [Ext] BackTrack Tab History

Post by Kevin Jones »

AlexVallat wrote:Thank you for reporting this. Please try the dev channel version v0.16 which should resolve the issue.
Thanks for fixing this so quickly :-)
User avatar
iByzod
Posts: 9
Joined: October 15th, 2011, 9:16 pm

Re: [Ext] BackTrack Tab History

Post by iByzod »

Hi, @AlexVallat, thanks for your great addon, but something is annoying me: it can't copy session history to new tabs that are opened from script/other addon.

For example, tabs opened/created by gesture addons or drag&drop addons have empty session history.
I open new tabs mostly by using gestures or dragging links so most opened tabs have no 'back track' session history for me :(

Can you hack "gBrowser.loadOneTab"? I think that one is called even for tabs created by script/addon.

Thanks!
AlexVallat
Posts: 90
Joined: September 30th, 2006, 8:53 am

Re: [Ext] BackTrack Tab History

Post by AlexVallat »

Hi iByzod, thanks for the links. I'm afraid there's not much I can do to get Easy DragToGo working, just because of the way it works. FireGestures shouldn't be a problem, though. It isn't the intercepting of the new tab that's the issue, it's detecting of the parent tab. I'm currently doing this with the click event, but if a gesture is used, no click occurs.

I've released v0.16b2 into the development channel which uses mouseup instead of click. Should be pretty much the same, except that it will work for gestures too.

Give it a go and let me if it does the job for you.
User avatar
iByzod
Posts: 9
Joined: October 15th, 2011, 9:16 pm

Re: [Ext] BackTrack Tab History

Post by iByzod »

AlexVallat wrote:Hi iByzod, thanks for the links. I'm afraid there's not much I can do to get Easy DragToGo working, just because of the way it works. FireGestures shouldn't be a problem, though. It isn't the intercepting of the new tab that's the issue, it's detecting of the parent tab. I'm currently doing this with the click event, but if a gesture is used, no click occurs.

I've released v0.16b2 into the development channel which uses mouseup instead of click. Should be pretty much the same, except that it will work for gestures too.

Give it a go and let me if it does the job for you.
Wow I didn't expect a beta version comes out after waking up :P
Thanks for your super fast hotfix!
But there're still problems with drag&drop addons, since I didn't found your code repository, I'll post my reproduce steps here:

Test Environment
System Platform : AMD64, Windows-10-10.0.14393
Browser : Firefox Developer Edition (55.0 Beta 1, 64 bit)
User Agent : Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:55.0) Gecko/20100101 Firefox/55.0
Build Config : https://hg.mozilla.org/releases/mozilla ... 1765ac199e
BackTrack Tab History : 0.16b2

Step to Reproduce
1. Create a new profile for Firefox 55beta1 build 5.
2. Install Firegesture (1.11.1)
3. Install Backtrack tab history (0.16b2)
4. Close Firefox, delete \startupCache\ folder in profile directory then open Firefox (this cache folder should be deleted for every restart later by default)
5. Open https://www.reddit.com/r/firefox/ as tab A, click `Next` link at the bottom of the page two times, your session history should be like this:
Image
6. Middle click on `Next` to open a new reddit tab B in the background, switch to tab B, it 'remembers' the original history:
Image
7. Open tab C & tab D with Firegesture (normal gesture & keypress gesture, shown in the gif below), their history is the same as above, it works
ImageImage
8. Install Drag & DropZones (Revived) (0.1.2)
9. Close Firefox, delete \startupCache\ folder in profile directory then open Firefox
10. Config Drag & DropZones to add a `open links` zone:
Image
11. Repeat step 5~7, plus step 12
12. Open tab E with Drag & DropZones, by draging the `Next` link to the `Open Link` zone.

Expected Result
1. Tab A have 3 history entries, tab B~E have 4 history entries
ImageImage
-------tab A------------------tab B~E

Actual Result
1. Tab A have 3 history entries, tab B~E have 1 history entries (itself)
2. Tab B~D still have only 1 history entries even after Drag & DropZones is uninstalled
ImageImage
-------tab A------------------tab B~E

If you need more information please reply to this thread or contact me directly (byzod#live.com, replace # with @), thanks!
AlexVallat
Posts: 90
Joined: September 30th, 2006, 8:53 am

Re: [Ext] BackTrack Tab History

Post by AlexVallat »

The "dragend" event does not fire "mouseup", so drag operations are not triggering the parent setting behaviour. I'm trying to think whether there is any risk of unwanted behaviour by allowing dragend to act the same as mouseup for setting a tab as parent, but I think it's probably OK. I've uploaded v0.16b3 with "dragend" event listening added.
User avatar
iByzod
Posts: 9
Joined: October 15th, 2011, 9:16 pm

Re: [Ext] BackTrack Tab History

Post by iByzod »

AlexVallat wrote:The "dragend" event does not fire "mouseup", so drag operations are not triggering the parent setting behaviour. I'm trying to think whether there is any risk of unwanted behaviour by allowing dragend to act the same as mouseup for setting a tab as parent, but I think it's probably OK. I've uploaded v0.16b3 with "dragend" event listening added.
Thanks for your update! So tabs opened by Firegesture is impossible to inherit the history? :(
Anyway, 0.16b3 works for Drag & DropZones (the test addon), but still not working on my in-use drag&drop addon.
It's a legacy addon, I know it will die soon in fx 57, but I really hope you could spare some time taking a look into it because I'm staying with Fx 56 for a while. Thank you so much!

Step to reproduce
1. Repeat step 1~5 in the former post
2. Install userChromJS v2.0, you may need to disable the signature check to install it (add an entry in about:config, xpinstall.signatures.required = false)
3. Install DragToGo.uc.js by copy it to userChrome folder in your profile directory (typically `{profile folder name}\Chrome\`). Then add one line in userChrome.js (`{profile folder name}\Chrome\userChrome.js`):

Code: Select all

userChrome.import("*", "UChrm");
4. Close Firefox, delete \startupCache\ folder in profile directory then open Firefox
5. In tab A, open tab F by draging the `Next` link to the right (open in background) or left (open in foreground) then release in 300ms (can be changed in the line 24 of DragToGo.uc.js)

Expected Result
1. Tab A have 3 history entries, tab F have 4 history entries
ImageImage
-------tab A------------------tab F

Actual Result
1. Tab A have 3 history entries, tab F have 1 history entry (itself)
ImageImage
-------tab A------------------tab F
AlexVallat
Posts: 90
Joined: September 30th, 2006, 8:53 am

Re: [Ext] BackTrack Tab History

Post by AlexVallat »

Sorry, but that's completely horrible. I tried installing it, and it's borked my profile so badly I can't even open the browser toolbox to try and debug it. My best guess is that its intercepting the drag events in a way the prevents them from being seen or processed by anything else, including BackTrack Tab history. I'm not willing to do any more work to try and support this hack, sorry.
User avatar
iByzod
Posts: 9
Joined: October 15th, 2011, 9:16 pm

Re: [Ext] BackTrack Tab History

Post by iByzod »

AlexVallat wrote:Sorry, but that's completely horrible. I tried installing it, and it's borked my profile so badly I can't even open the browser toolbox to try and debug it. My best guess is that its intercepting the drag events in a way the prevents them from being seen or processed by anything else, including BackTrack Tab history. I'm not willing to do any more work to try and support this hack, sorry.
Ah, the content of userchrome.js in step 3 should be

Code: Select all

if (location == "chrome://browser/content/browser.xul") {
	userChrome.import("*", "UChrm");
}
Maybe you can test it again when have spare time?

Thanks for your advice anyway, I'll check it.
hmijail
Posts: 13
Joined: September 15th, 2013, 11:32 am

Re: [Ext] BackTrack Tab History

Post by hmijail »

Hello,

Regarding the non-transition to WebExtensions: did anyone try asking Mozilla for the necessary API/s so the new implementation would be doable?
I'm asking because FireTitle, another Firefox add-on, managed to get their API needs considered and implemented (I opened the bug report that triggered it!). Took some discussing and it's not finished yet, but at least now there is a partially functional FireTitle working on WebExtensions. So... maybe something similar could be done for BackTrack Tab History?

I'm missing this add-on already!
AlexVallat
Posts: 90
Joined: September 30th, 2006, 8:53 am

Re: [Ext] BackTrack Tab History

Post by AlexVallat »

There are a couple of issues in Bugzilla: 1321365 and 1270782. One of which is explicitly WontFix, and the other appears abandoned. I think the problem is that Mozilla's policy is that they do not want addons which modify the existing browser UI or functionality, so BackTrack Tab History is not going to be welcome.

So I would say there is pretty much zero chance of this ever being a WebExtension.

I will, however, continue to make every effort to ensure it's continued compatibility with unrestricted versions of Firefox, which honour the extensions.legacy.enabled preference. That's the blue versions, Developer, Nightly, or Unbranded. With any of those, use about:config to set extensions.legacy.enabled true and BackTrack Tab History will work.

Alex
Last edited by AlexVallat on November 9th, 2017, 1:43 am, edited 1 time in total.
hmijail
Posts: 13
Joined: September 15th, 2013, 11:32 am

Re: [Ext] BackTrack Tab History

Post by hmijail »

Voted and commented in the bugs. Thank you so much for your work on BatckTrack Tab History! :)
pintassilgo
Posts: 200
Joined: August 30th, 2013, 3:50 pm

Re: [Ext] BackTrack Tab History

Post by pintassilgo »

bootstrap.js, line 484
See https://bugzilla.mozilla.org/show_bug.cgi?id=1362034 (Help button doesn't work on Nightly)
Replace

Code: Select all

addTab
by

Code: Select all

addWebTab
Or better, to backward compatibility:

Code: Select all

addTab(uri, {triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({})});
The same for the two

Code: Select all

openLinkIn
in calibration code.

And SHEntrySerializer.js, line 235:

Code: Select all

shEntry.loadType = 2;
https://bugzilla.mozilla.org/show_bug.cgi?id=1472087
AlexVallat
Posts: 90
Joined: September 30th, 2006, 8:53 am

Re: [Ext] BackTrack Tab History

Post by AlexVallat »

Thanks for that, I've patch it up to work on Nightly. Usually I only release targetting Developer as Nightly is a bit of a moving target, but as you've mentioned it I might as well upload the new version now. I'd already fixed up SHEntrySerializer.js (in fact the whole code in that is replaced by the new SessionHistory.jsm code as .loadType is now replaced by .setAsHistoryLoad), but hadn't noticed the addWebTab thing. Hopefully 0.21 will be approved and appear on AMO soon.
Post Reply