Closed Bug 1333943 Opened 7 years ago Closed 7 years ago

Allow WebExtensions to directly update the tab title.

Categories

(WebExtensions :: Untriaged, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: alexanderomara, Unassigned)

References

Details

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

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]
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]
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.
If you wanted to store extra data on the tab, something like bug 1322060 seems like a better way to go.
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.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
Whiteboard: [design-decision-denied][tabs] → [design-decision-denied][tabs]triaged
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.