-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not a Bug, Not a Request: Workaround Idea #18
Comments
Thanks! I've wrote new mode based on webRequest. I didn't mention that documentUrl and originUrl are available to detect loading from the location bar. You can try the new development version at http://piro.sakura.ne.jp/xul/xpi/nightly/newtabfromlocationbar-we.xpi On https://bugzilla.mozilla.org/show_bug.cgi?id=1394304 you wrote:
Currently both those cases seem to work well for me with the default configuration. However I think still there are some hidden problems. For example I don't test well on the private browsing mode. To activate this on a new release version, I need more doogfooding. |
Here is failure cases I've found:
|
I just installed your nightly build and have been playing around. I ran into a weird case where a new tab wasn't opened after I typed a new URL, then when I hit the back button, that opened a new tab with the previous page instead. I think there will be many such edge cases until Mozilla approves official API. :( But something is better than nothing! |
I can't reproduce the problems I was having with 30X redirects or external links with your version either. You must have fixed them by some other part of your code. |
After 24 hours of disabling legacy Tab Mix Plus and using this, it's actually quite good. But not perfect. Things are inconsistent. It's strange. Yesterday night I was not getting the extra tabs for external links (clicking a link in another program on PC) but today I've seen it a couple times. I've also seen the "new tab not created, hit back, new tab is created" issue a second time. Do you think it'd be worth adding a very verbose logging to file feature? (Actually, is that even possible with webextensions?) Then over time these edge case issues would form patterns that could be addressed. |
If you activate "Debug mode" at this addon's configurations, you'll see detailed information when the loading request is redirected to a new tab. |
A new failure case I've found:
Log:
Details of onBeforeRequest:
|
Different failure case:
Log and details:
This is due to limitations of WebExtensions APIs. If you have a preference value |
I think I tracked down the failure case I've been seeing intermittently:
Expected result: Tab goes back to the initial results page. Looking at the debug objects, I can't see any way to tell these webRequests from actual location bar entries. I think Firefox is "re-playing" their creation webRequest somehow, so they look like location bar entries to the addon. Workaround possible? Monitor for back button use and prevent the addon from creating the new tab? Keep a history of new tabs created and filter out duplicates (could have side effects)? |
Another pair of failure cases (don't know how important these are, but they deserve mentioning):
Expected: New tab is created.
Expected: New tab is created, old tab is preserved. |
Cases I've researched about your "Back" case #18 (comment) and I've realized that |
Failure case:
Expected: A single new tab is created with the final desination URL loaded. I clicked multiple times and got 2 different debug results. I think it has to do with caching? Here's the non-cached debug output:
And here's the cached debug output:
|
Hi Piro, it looks like we've both been working on this issue. You are smarter than I am, so maybe you can put what I've found to good use. I have been working with browser.webRequest.onBeforeRequest and have had some pretty good luck. However, I've hit a wall in terms of what can be done. Maybe by mixing your browser.webNavigate.onCommitted method with mine would get closer to perfect?
Here's the method I've come up with that seems to work 100% of the time, but also opens new tabs for some URLs it shouldn't. Here's why (I think) it works: When entering a new URL from the address bar, documentUrl and originUrl are always blank, the type is always 'main_frame' and the tabId is never "-1" (I don't know what -1 represents, but it seemed to be navigation requests generated in the background by Firefox itself).
If there's anything you can accomplish with this, please do. I'm not likely to be able to do it myself, I'm too new to webextensions and javascript. Thanks again for all you do.
background.js:
manifest.json:
The text was updated successfully, but these errors were encountered: