Skip to content

[browser extensions API] define the scope of onStarted/onStopped events #655

@asurkov

Description

@asurkov

Monetization extension APIs define onStarted and onStopped notifications, which fire when monetization turns on or off. The open question is when exactly these notifications should be emitted. There are three possible models:

  • Tied to a monetization session. Fired once per monetization link. For example, if a single document contains multiple monetization links, multiple onStarted events would fire.
  • Tied to a monetized document. Fired once per monetized document. For example, if a document contains multiple monetization links, onStarted would fire when the first link becomes monetized, and onStopped would fire when the last monetized link stops. However, this could still fire multiple times within a tab if the tab contains multiple iframe documents, since events would be scoped per DOM document.
  • Tied to a tab. Fired once per tab. Regardless of how many iframe documents exist in the tab, onStarted would fire when the first monetization link becomes active anywhere in the tab, and onStopped would fire when the last active monetization in the tab ends.

We should first define the use cases these notifications are meant to support, or consider whether an extension would ever need this information at all:

  • Monetization session: website wallet address + monetized document URL + tab URL
  • Monetized document: monetized URL + tab URL
  • Monetized tab: tab URL

See #653 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    specificationWork required on specification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions