Closed Bug 1411647 Opened 7 years ago Closed 7 years ago

New Tab Override "about:newtab" option opens "about:blank"

Categories

(WebExtensions :: General, defect)

defect
Not set
normal

Tracking

(firefox57 affected, firefox58 affected)

RESOLVED INVALID
Tracking Status
firefox57 --- affected
firefox58 --- affected

People

(Reporter: marius.santa, Unassigned)

Details

[Affected versions]:
Firefox 57.0b11 (20171023180840)
Firefox 58.0a1 (20171024100135)

[Affected platforms]:
Windows 10 64-bit
MacOS Sierra 10.13

[Steps to reproduce]:
1.Launch Firefox with a clean profile.
2.Install the following https://addons.mozilla.org/en-US/firefox/addon/new-tab-override/?src=search
3.Click on the webextension's action icon.
4.From "Options" select: "default new tab page of Firefox (about:newtab)"
5.Open a new tab.


[Expected Results]:
An "about:newtab" page is opened.

[Actual Results]:
A blank page is displayed.

[Additional notes]:
Gif presenting the issue is attached.
Hi,

that's no bug. If you select "default new tab page of Firefox (about:newtab)" in New Tab Override there appears a text:

"To use Firefox's default page, please open about:addons and disable the New Tab Override extension (no uninstall required)."

The reason is simple (and sad): it's not possible for WebExtensions to use about:newtab in browser.tabs.update/create. But something has to be openend on new tabs, so I decided to open an empty page if the user does not disable New Tab Override. I can't do more than explaining what the user has to do.

bug 1371793 could implement the possibilty to open about:newtab as new tab page, I proposed this in bug 1371793 comment 8 but there is no progress or decision.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
I think we could address this by altering the browserSettings.newTabPageOverride browserSetting to allow extensions to call reset() to remove their setting. Both browserSettings.newTabPageOverride and browserSettings.homepageOverride are both "read-only" browserSettings in that they do not allow an extension to dynamically set values for those settings, but I see no danger in allowing an extension to remove its own setting.

I believe that would resolve the issue. Do you agree Sören? Andrew, do you see any issues with altering the read-only settings to allow for reset() to be called?
Flags: needinfo?(cadeyrn)
Flags: needinfo?(aswan)
How does this reset() method works exactly? Do I have to call this instead of the browser.tabs.update() method? Or to put it another way: after selecting the "default new tab option" in New Tab Override which calls the reset() method, will it afterwards be still possible for the user to select the "custom url" option in the New Tab Override's options to change the new tab page to a custom url?

If this method can be used to temporarily disable the override I will be very happy with this solution.
Flags: needinfo?(cadeyrn)
(In reply to Sören Hentzschel from comment #3)
> How does this reset() method works exactly? Do I have to call this instead
> of the browser.tabs.update() method? Or to put it another way: after
> selecting the "default new tab option" in New Tab Override which calls the
> reset() method, will it afterwards be still possible for the user to select
> the "custom url" option in the New Tab Override's options to change the new
> tab page to a custom url?
> 
> If this method can be used to temporarily disable the override I will be
> very happy with this solution.

This is something we're currently discussing and it sounds like with our current implementation regaining control wouldn't be as simple as you'd like. I think you could make it work, but it would only take effect after a browser restart, which doesn't seem acceptable.

So we'd need to make more significant changes to the APIs in question and we're not sure if that's something we want to do. There is also discussion of trying to move forward with bug 1371793, so hopefully we'll come up with something that will help, but it doesn't look like there are any simple solutions.
(In reply to Bob Silverberg [:bsilverberg] from comment #2)
> Andrew, do you
> see any issues with altering the read-only settings to allow for reset() to
> be called?

Yes, I don't think that reset() alone would be useful without a reasonable way to regain control.  And now we're on the road to just turning this into a dynamic setting which we previously decided not to do.
Flags: needinfo?(aswan)
I agree. If you move forward with bug 1371793 and allow the creation of about:newtab via browser.tabs.update() and browser.tabs.create() this will work for New Tab Override.
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.