Skip to content

Possible solution for Safari/UserScripts page context isolation #945

Description

@Acobat12

I investigated the Safari/UserScripts issue and found that the root cause appears to be the execution context isolation in UserScripts. The userscript context cannot access page globals (e.g. window.player, NEXT_DATA), so site helpers fail to obtain the required video information.

I implemented a proof-of-concept in my fork by introducing a page-context bridge between the page and the userscript. It restores access to page globals and allows VOT to work correctly in Safari/UserScripts.

If it's useful, feel free to reuse or adapt any part of the implementation:

https://github.com/Acobat12/userscripts/blob/main/src/ext/content-scripts/entry-userscripts.js

If you'd like, I can also prepare a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions