Open steinybot opened 2 years ago
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
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.
A content script containing:
Should be able to be executed by:
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