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

Content Scripts should not be IIFE #17

Open
steinybot opened this issue Oct 8, 2021 · 1 comment
Open

Content Scripts should not be IIFE #17

steinybot opened this issue Oct 8, 2021 · 1 comment

Comments

@steinybot
Copy link

A content script containing:

function setSelectedElement(el) {
    // do something with the selected element
}

Should be able to be executed by:

chrome.devtools.inspectedWindow.eval("setSelectedElement($0)",
    { useContentScriptContext: true });

But it can't because that function is being removed and converted to a IIFE.

See https://developer.chrome.com/docs/extensions/mv3/devtools/#selected-element

@steinybot steinybot mentioned this issue Oct 10, 2021
3 tasks
@thopiddock
Copy link

This also would address the issue that MV3 service workers need to register event handlers on the first pass of a file so that the chrome API can spawn the service worker when a registered event is triggered.

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 a pull request may close this issue.

2 participants