Closed DouweM closed 4 years ago
@chronakis Thanks for creating this extension! I enjoy it every day, but unfortunately keep running into a bug. Can you please check out this PR to (hopefully) fix it? Thanks!
Hi @DouweM , thank you very much for your patch!
Please give me a couple of days to get back into the context and try to accept the PR and get a new release out.
Hi @DouweM ,
Your fix works great, thanks!
For reasons unclear to me, opening a new tab does not consistently trigger SWC--the Browser Console doesn't always show an onBeforeNavigate log message-- but when it does, this behavior shows consistently.
I have been very puzzled myself about the newtab page and why some people had the problem and I could not reproduce it. I finally discovered that this settings makes the difference.
When "New tabs" is set to "Firefox home (default)", opening a new tab does not generate the OnBeforeNavigate event. Page Info shows that the page URL is clearly "about:newtab" but it is unclear how it got there.
On the other hand, when it is set to "Blank page", it generated the OnBeforeNavigate event with the known consequences that your patch fixes.
In any case, I am merging your pull request and making a release tonight.
Many thanks!
Yiannis
In any case, I am merging your pull request and making a release tonight.
@chronakis Awesome, thank you!
When "New tabs" is set to "Firefox home (default)", opening a new tab does not generate the OnBeforeNavigate event. Page Info shows that the page URL is clearly "about:newtab" but it is unclear how it got there.
On the other hand, when it is set to "Blank page", it generated the OnBeforeNavigate event with the known consequences that your patch fixes.
I'm not sure it's that simple. I actually have the setting set to "Firefox Home (Default)", but keep running into this bug. As I wrote, the OnBeforeNavigate event seems to be triggered only some of the times I create a new tab (usually using the Cmd+T shortcut). When it does, the bug triggers and the tab auto-closes. When it doesn't, it opens and I can use it without issue.
I haven't been able to figure out what determined whether or not the event would trigger; usually when opening a new tab using Cmd+Tab fails, I just hit the shortcut a couple more times until finally a new tab "sticks" because it didn't trigger the OnBeforeNavigate event. One or two more tries usually do the trick.
I haven't yet gone so far as look at the Firefox source code to figure this one out, but I'm tempted 😃
In any case, this fix should stop the auto-closing so I'm happy!
Thanks for the merge and all the best in these crazy times.
When a new tab is opened with URL
about:newtab
(aka "Firefox Home (Default)") and SWC is triggered, bothtab.url
anddetails.url
are set toabout:newtab
, which leads toopenInDifferentContainer
being called withurlOverride
about:newtab
, andbrowser.tabs.create
withurl: 'about:newtab'
(despite theblankPages.has(url)
check), leading to anIllegal URL: about:newtab
error, and the originally opened tab closing, without a new tab opening to replace it.For reasons unclear to me, opening a new tab does not consistently trigger SWC--the Browser Console doesn't always show an
onBeforeNavigate
log message-- but when it does, this behavior shows consistently.