Allow WebExtensions to directly update the tab title.



2 years ago
11 months ago


(Reporter: alexanderomara, Unassigned)


Firefox Tracking Flags

(Not tracked)


(Whiteboard: [design-decision-denied][tabs]triaged)



2 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:51.0) Gecko/20100101 Firefox/51.0
Build ID: 20170118123726

Steps to reproduce:

It would be helpful for many different purposes if a WebExtension could change the browser tab title, without needing to modify the DOM to do it.

This is possible and very easy to do in a SDK-based add-on.

    var tabs = require('sdk/tabs');
    tabs.on('ready', function(tab) {
        tab.title = 'testing123';

However, since the move is towards WebExtensions, that's likely not a good option going forward.

It would be helpful if similar WebExtension code like this were possible:

    chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
        chrome.tabs.update(tabId, { title: 'testing123' }, function(tab) { console.log(tab); });

However, there is no support for changing title in this way, so it produces this error:

> Type error for parameter updateProperties (Unexpected property "title") for tabs.update.

The only work-around we have would be to modify the DOM, by setting `document.title` in a content script. This is sub-optimal for several reasons, including changing DOM properties that may need expected values, and the privacy issue of browser fingerprinting.

I propose that it be made possible to modify the title, in much the same way it is already possible with SDK-based add-ons.
Whiteboard: [design-decision-needed][tabs]

Comment 1

2 years ago
Whilst the SDK had an API for this, it doesn't mean we should add this to WebExtensions. You can update the tab title by changing the DOM as you've noted. But we couldn't understand the issue of why changing the tab title rather than through the document would lead to fingerprinting. Could you expand on that?

At this point we can't figure out a need for this API.
Whiteboard: [design-decision-needed][tabs] → [design-decision-denied][tabs]

Comment 2

2 years ago
Suppose you were to create an extension that modified the title on all pages, perhaps to add information to the title to assist password manager software detecting the page you are on.

This little bit of extra data being added to the title would be one more data point that could be used to help uniquely identify a user's browsers. Those that have such an extension installed, and those that don't.

Comment 3

2 years ago
If you wanted to store extra data on the tab, something like bug 1322060 seems like a better way to go.

Comment 4

2 years ago
Can that be used to change the title that the OS sees?

That's basically what is needed to get the auto type to recognize which window is active.


2 years ago
Last Resolved: 2 years ago
Resolution: --- → WONTFIX
Whiteboard: [design-decision-denied][tabs] → [design-decision-denied][tabs]triaged
Duplicate of this bug: 1340633


11 months ago
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.