WebExtension popups include the page URL in the window title
Categories
(WebExtensions :: Frontend, defect, P2)
Tracking
(firefox71 fixed)
Tracking | Status | |
---|---|---|
firefox71 | --- | fixed |
People
(Reporter: oleary.gabe, Assigned: nmaier)
References
Details
(Whiteboard: [design-decision-approved]triaged)
Attachments
(6 files, 1 obsolete file)
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36 Steps to reproduce: When I create a window with a local extension page the title of the window shows the url, and then the page title. chrome.windows.create({ url: chrome.extension.getURL('compare.html'), type: "popup", state: 'maximized' }); compare.html include: <html> <head> <title>Compare</title> ... </head> ... </html> Actual results: Visible title of window is : 'moz-extension://extension-id - Compare' Expected results: The expected behavior from chrome is for window only display the page title, and not the url preceding: 'Compare'
Reporter | ||
Updated•8 years ago
|
Updated•8 years ago
|
Updated•8 years ago
|
Updated•8 years ago
|
Comment 2•8 years ago
|
||
To be discussed at Dec. 13, 2016 WE triage meeting. Agenda: https://docs.google.com/document/d/1S1QrBK1hrulE7dlLiQzjMupHUUSwDYRYAOXiqtMHe-k/edit#
Comment 3•8 years ago
|
||
We've been trying to make it clear that when something happens, the reason for it is clear to the end user. The ability to create a popup with no URL bar means that there could be absolutely no info to the user. In bug 1266012 we show the add-on in the URL bar and in bug 1318144 we show the add-on in the ID. I think we should continue the trend and the page title should contain Extension: [Extension name] - Page title. Much nicer than showing moz-extension and more informative to the end user. Just pinging dveditz to check that sounds right.
Comment 4•8 years ago
|
||
The main thing we're trying to accomplish with the URL bar for web page popups is to prevent spoofing/phishing by showing exactly where the content originated from. The URL for a web extension doesn't convey much to a user except "this is an extension" so we don't need to show that as long as the popup can't be confused with one from a web page. Your proposal sounds like it does that. If it's not explicitly window.open() it doesn't even really need a URL bar; a panel with some title text would do (plus the "Extension:" prefix), which seems to be what this bug is asking for. bug 1318144 is not right; bug 1318114 is maybe what you meant?
Comment 5•8 years ago
|
||
> bug 1318144 is not right; bug 1318114 is maybe what you meant?
Thanks for the correction and clarity. Sounds like we are good to go with this.
Updated•8 years ago
|
Worse than the aboce, I am using browser.windows.create( {titlePreface: "New bookmark", type: "popup", url: url, height: 150, width: 375, left: 300, top: 300, allowScriptsToClose: true } ) in my extension to create a "popup", and the title piece is totally ignored, I get a resulting window with: "moz-extension://.... - Mozilla Firefox" as title, which is not only unreadable and unfriendly for common human beings, but non meaningful :-( I am assuming this can be corrected / improved as part of this bug, so adding it here rather than opening a new bug. Let me know if you prefer I open a new one. Thank you.
Comment 7•7 years ago
|
||
The usability of popups and windows from extensions is still marginal. Comment 3 will certainly improve the situation, but I'm wondering if there is more we can do. Asking for some UX input on this one. Is there a way to display the title in a user-friendly way, but still inform the user that the window comes from an extension?
Comment 8•7 years ago
|
||
Simple extension that adds a toolbar button that, when clicked, will create a small and maximized popup window with the title "Page Title". Works on Firefox and Chrome.
Comment 9•7 years ago
|
||
Example of an extension popup created in Chrome. Note that it only displays the window title (no indication of the source of the popup).
Comment 10•7 years ago
|
||
Example of an extension popup in Firefox. Note the title bar shows it is from an extension, but it isn't very meaningful. This bug would clean it up a bit, adding the "Extension" prefix followed by the name of the extension, followed by the actualy HTML title. But is that going to be too long to fit onto smaller popups?
Updated•7 years ago
|
My new employer, Privowny, hits this bug and the title of our WebExtension popups becomes so ugly our users and testers complain. I would like to propose a change here, for which I have a fix in hands: display the name of the extension instead of its moz-extension URL. It's a compromise between the current situation (strong) and no prefix at all for the title (weak). I am attaching this patch now.
Sorry, attached the wrong version. This one, with non-emptyness test on extension.name is better.
hi dveditz, any opinion about the compromise (and corresponding fix) I proposed above?
Comment 15•7 years ago
|
||
IMO when its in a tab, I see no reason to have the extension name included in the title. The security dropdown should say what it is. We should also somehow cover the window titles, attachment 8970941 [details] [diff] [review] doesn't handle that (see xpi that mconca attached).
Comment 16•6 years ago
|
||
Shane: as far as I can tell that's how tabs behave currently: the site into box says "Extension (<name>)" next to the ugly moz-extension URL in the address field but the Title is entirely specified by the extension and contains no ugly bits. Daniel's patch is only in the case when the location bar is hidden. Although it's in a file called tabbrowser.js we wouldn't really call them "tabs". Daniel: My preference would be for Andy's comment 3 ("Extension: [<name>]" as a prefix, though probably better to match the site identity box for consistency and l10n reuse: "Extension (<name>)"). Since Web Extensions are not necessarily reviewed this is a slight bit of protection against a rogue extension trying to spoof browser UI. Then again a name that was spoofy in some panel context would probably look pretty odd on the installation prompt to start with. If we can get buy-in from other security folks I could live with your patch as-is.
> If we can get buy-in from other security folks I could live
> with your patch as-is.
You logic sounds fine to me - Extension <name> seems like a decent compromise.
(In reply to Daniel Veditz [:dveditz] from comment #16) > Daniel: My preference would be for Andy's comment 3 ("Extension: [<name>]" > as a prefix, though probably better to match the site identity box for > consistency and l10n reuse: "Extension (<name>)"). Since Web Extensions are > not necessarily reviewed this is a slight bit of protection against a rogue > extension trying to spoof browser UI. Then again a name that was spoofy in > some panel context would probably look pretty odd on the installation prompt > to start with. If we can get buy-in from other security folks I could live > with your patch as-is. Thanks! I can of course rather tweak the patch to add that localized "Extension (*)" string. Let me know if I should spend two cycles on that?
Comment 19•6 years ago
|
||
Comment on attachment 8970941 [details] [diff] [review] v2 of my patch >diff --git a/browser/base/content/tabbrowser.js b/browser/base/content/tabbrowser.js >index 784986177f05..e100880907cb 100644 >--- a/browser/base/content/tabbrowser.js >+++ b/browser/base/content/tabbrowser.js >@@ -887,6 +887,18 @@ window._gBrowser = { > aBrowser.currentURI); > if (uri.scheme == "about") > newTitle = uri.spec + sep + newTitle; >+ else if (uri.scheme == "moz-extension") { >+ // in the case of a WebExtension, we display its official name instead >+ // the URL >+ let mozExtensionHostname = uri.host; >+ for (let extension of WebExtensionPolicy.getActiveExtensions()) { >+ if (extension.mozExtensionHostname == mozExtensionHostname && >+ extension.name) >+ return extension.name + sep + newTitle; >+ } Shouldn't need to loop... let extension = WebExtensionPolicy.getByHostname(uri.host); return `Extension (${extension.name})${sep}${newTitle}`; Assuming some l10n will happen, so will wait for that.
Updated•6 years ago
|
Updated•6 years ago
|
Comment hidden (advocacy) |
Comment 21•5 years ago
|
||
Can we expect any progress on this issue in the near future?
I'm very keen on this 😉
Assignee | ||
Comment 22•5 years ago
|
||
Would it be OK to fix this by just using the same text the page indicator has in regular tabs, i.e. the Extension (<name>)
bit, and reuse that?
I'd be interested in bringing this bug over the finish line.
Comment 23•5 years ago
|
||
From my point of view, that'd be fine, Nils!
Although I'd prefer Extension: <name>
as Andy suggested. But that's just details. Anything that makes the ugly moz-extension
-prefix vanish would be a great improvement! 😊
Assignee | ||
Comment 24•5 years ago
|
||
With the current l18n string, which just is "Extension:" both alternatives are possible.
I guess it's up to mixedpuppy to weight in here which one to use.
Anything that makes the ugly moz-extension-prefix vanish would be a great improvement! 😊
ikr
Comment 25•5 years ago
|
||
(In reply to Nils Maier [:nmaier] from comment #22)
Would it be OK to fix this by just using the same text the page indicator has in regular tabs, i.e. the
Extension (<name>)
bit, and reuse that?
I'd be interested in bringing this bug over the finish line.
I think that's fine.
Assignee | ||
Comment 26•5 years ago
|
||
Assignee | ||
Updated•5 years ago
|
Comment 27•5 years ago
|
||
Pushed by ncsoregi@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9b3b556ca3d5
Show extension name instead of URI in popup windows r=mixedpuppy
Comment 28•5 years ago
|
||
Backed out for failures on browser_ext_windows_popup_title.js
backout: https://hg.mozilla.org/integration/mozilla-inbound/rev/d743f185d4d85634f85538abb4e85b467d1b4ec9
failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=265819206&repo=mozilla-inbound&lineNumber=10060
[task 2019-09-09T23:37:26.640Z] 23:37:26 INFO - TEST-INFO | started process screentopng
[task 2019-09-09T23:37:27.574Z] 23:37:27 INFO - TEST-INFO | screentopng: exit 0
[task 2019-09-09T23:37:27.575Z] 23:37:27 INFO - Buffered messages logged at 23:37:25
[task 2019-09-09T23:37:27.575Z] 23:37:27 INFO - Entering test bound test_popup_title
[task 2019-09-09T23:37:27.577Z] 23:37:27 INFO - Extension loaded
[task 2019-09-09T23:37:27.577Z] 23:37:27 INFO - Console message: Warning: attempting to write 7256 bytes to preference extensions.webextensions.uuids. This is bad for general performance and memory usage. Such an amount of data should rather be written to an external file. This preference will not be sent to any content processes.
[task 2019-09-09T23:37:27.577Z] 23:37:27 INFO - Buffered messages logged at 23:37:26
[task 2019-09-09T23:37:27.578Z] 23:37:27 INFO - TEST-PASS | toolkit/components/extensions/test/browser/browser_ext_windows_popup_title.js | poup title must include extension name -
[task 2019-09-09T23:37:27.578Z] 23:37:27 INFO - Buffered messages finished
[task 2019-09-09T23:37:27.584Z] 23:37:27 INFO - TEST-UNEXPECTED-FAIL | toolkit/components/extensions/test/browser/browser_ext_windows_popup_title.js | popup title must include extension document title -
[task 2019-09-09T23:37:27.584Z] 23:37:27 INFO - Stack trace:
[task 2019-09-09T23:37:27.584Z] 23:37:27 INFO - chrome://mochikit/content/browser-test.js:test_ok:1580
[task 2019-09-09T23:37:27.584Z] 23:37:27 INFO - chrome://mochitests/content/browser/toolkit/components/extensions/test/browser/browser_ext_windows_popup_title.js:test_popup_title/<:40
[task 2019-09-09T23:37:27.584Z] 23:37:27 INFO - chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js:testMessage:79
[task 2019-09-09T23:37:27.584Z] 23:37:27 INFO - resource://specialpowers/SpecialPowersChild.jsm:listener:2030
[task 2019-09-09T23:37:27.584Z] 23:37:27 INFO - resource://specialpowers/SpecialPowersChild.jsm:loadExtension/<:1972
[task 2019-09-09T23:37:27.584Z] 23:37:27 INFO - resource://specialpowers/SpecialPowersChild.jsm:receiveMessage:238
[task 2019-09-09T23:37:27.584Z] 23:37:27 INFO - TEST-PASS | toolkit/components/extensions/test/browser/browser_ext_windows_popup_title.js | popup title must not include extension URL -
[task 2019-09-09T23:37:27.584Z] 23:37:27 INFO - Console message: [JavaScript Error: "The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol." {file: "moz-extension://8118729b-e1ea-4923-bfc7-6d91ce4f9a37/index.html" line: 0}]
[task 2019-09-09T23:37:27.584Z] 23:37:27 INFO - GECKO(4556) | JavaScript error: resource:///modules/UrlbarInput.jsm, line 231: TypeError: this._inputFieldEvents is undefined
[task 2019-09-09T23:37:27.584Z] 23:37:27 INFO - Console message: [JavaScript Error: "TypeError: this._inputFieldEvents is undefined" {file: "resource:///modules/UrlbarInput.jsm" line: 231}]
[task 2019-09-09T23:37:27.584Z] 23:37:27 INFO - TEST-PASS | toolkit/components/extensions/test/browser/browser_ext_windows_popup_title.js | popup-window-title -
Assignee | ||
Comment 29•5 years ago
|
||
This is why I hate writing browser tests :p
Assignee | ||
Comment 30•5 years ago
|
||
mixedpuppy, can you have another looksy please?
Assignee | ||
Updated•5 years ago
|
Comment 32•5 years ago
|
||
Pushed by dluca@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6d401ddd9ce0
Show extension name instead of URI in popup windows r=mixedpuppy
Comment 33•5 years ago
|
||
bugherder |
Description
•