Closed Bug 1280222 Opened 8 years ago Closed 7 years ago

Add ability to store metadata (annotations) for each tab /window

Categories

(WebExtensions :: Untriaged, defect)

defect
Not set
normal

Tracking

(firefox50 affected)

RESOLVED DUPLICATE of bug 1322060
Tracking Status
firefox50 --- affected

People

(Reporter: yuki, Unassigned)

References

Details

(Whiteboard: [design-decision-needed] triaged)

Alternatives for the nsISessionStore features are required for tab-related addons, after XUL is ended. Existing "chrome.storage" can do similar thing, but it is hard to synchronize stored data with actual changes around tabs and windows, and it can produce garbages in the storage when the addon failed to synchronize the data with closed tabs. Moreover, it is very annoying to keep stored data for closed tabs and windows, because they can be reopened by the user.
I think that the API should be similar to the one for bookmarks' annotations (I proposed at the bug 1271567.) Like:

~~~
// get metadata
chrome.tabs.get(id, function(result) {
  var annotations = result.annotations || {};
  ...
});

// store metadata
var annotations = bookmark.annotations || {};
annotations.myPrivateData = 'foo';
chrome.tabs.update(
  id,
  { annotations: annotations },
  function(result) {
  }
);
~~~

Something design decision is needed about isolation for each addon. The namespace should be separated for addons implicitly (safe, but hard to collaborate addons), or unified (easy to collaborate, but unsafe.)
Whiteboard: [design-decision-needed]
Whiteboard: [design-decision-needed] → [design-decision-needed] triaged
I wonder, can this be considered to be a duplicate of bug 1322060? Might it make sense to discuss that bug as well as part of the triage on the 24th as they seem pretty closely related to me.
Flags: needinfo?(amckay)
(In reply to Bob Silverberg [:bsilverberg] from comment #3)
> I wonder, can this be considered to be a duplicate of bug 1322060? Might it
> make sense to discuss that bug as well as part of the triage on the 24th as
> they seem pretty closely related to me.

I agree that this is a dup of the bug 1322060.
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(amckay)
Resolution: --- → DUPLICATE
Product: Toolkit → WebExtensions
You need to log in before you can comment on or make changes to this bug.