MV3 says that Remotely hosted code is no longer allowed. The point seems that prevents executing arbitrary strings.
// no longer allowed in MV3
chrome.tabs.executeScript({
code: 'alert("test!")'
});
Then, I'm wondering if adding a script is also blocked as follows.
// background.js
chrome.scripting.executeScript({
file: 'content-script.js'
});
// content-script.js
const s = document.createElement(‘script’);
s.src = ‘https://example.com/remote_code.js';
document.body.append(s);
chrome.tabs.executeScript({
code: 'alert("test!")'
});
chrome.scripting.executeScript({
file: 'content-script.js'
});
But loading the script from an external URL is forbidden.
const s = document.createElement(‘script’);
s.src = ‘https://example.com/remote_code.js';
document.body.append(s);
The Extensions team has mentioned several times that MV3 will allow arbitrary code evaluation via some mechanism that they still keep under wraps. - hgr
--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/c8fcea8a-5f9b-4ffc-bd7b-74c6ba2137ban%40chromium.org.