Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add API for external extensions to call ff2mpv #113

Merged

Conversation

DanSM-5
Copy link
Contributor

@DanSM-5 DanSM-5 commented Jan 22, 2024

Add support for external extensions

To allow ff2mpv extension listening to messages it needs to implement browser.runtime.onMessageExternal.

The shape of the message is an object with two properties:

  • type: The type of message to handle
  • url: The url string to be used by ff2mpv

External extensions need to call ff2mpv using the extension id:

Example of use for external extensions:

// Firefox
browser.runtime.sendMessage('ff2mpv@yossarian.net', { type: 'openVideo', url: 'https://someurl.com' }, callback);

// Chrome
chrome.runtime.sendMessage('ephjcajbkgplkjmelpglennepbpmdpjg', { type: 'openVideo', url: 'https://someurl.com' }, callback);

Solves: #112

Copy link
Owner

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small things, otherwise LGTM! Thanks @DanSM-5!

ff2mpv.js Outdated Show resolved Hide resolved
ff2mpv.js Outdated Show resolved Hide resolved
DanSM-5 and others added 2 commits January 22, 2024 18:11
Co-authored-by: William Woodruff <william@yossarian.net>
Co-authored-by: William Woodruff <william@yossarian.net>
Copy link
Owner

@woodruffw woodruffw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again. I'll do a release tonight, since I finally have some free time.

@woodruffw woodruffw merged commit 4763f1e into woodruffw:master Jan 22, 2024
8 checks passed
@DanSM-5 DanSM-5 deleted the feat/external-application-messaging branch July 28, 2024 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants