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

WIP: Add support for named targets (like the sidebar) #43

Closed
wants to merge 31 commits into from

Conversation

fregante
Copy link
Collaborator

@fregante fregante commented Oct 19, 2021

This enables:

// action.ts
registerTarget("sidebar")
// contentScript.ts
doSomething({name: "sidebar"}, "foo"); // Automatically uses the current tabId

// Anywhere
doSomething({name: "sidebar", tabId: 123}, "foo"); // Can be used from anywhere

With a simple change this will also allow name-less/tab-less calls to target the content script from the sidebar or other frames:

// action.ts
doSomething({}, "foo"); // Automatically uses the current tabId

tabId-less messages will always go through the background page, unfortunately, where the target is figured out either via "named targets" map or by using TOP_FRAME_ID on the sender’s tabId.

To do

@fregante
Copy link
Collaborator Author

fregante commented Oct 26, 2021

Same as pixiebrix/pixiebrix-extension#1695 (comment)

90% of these changes are now in #49

The remaining 10% were undone in this commit: 9c71b72 (#49)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant