Chrome.tabs.executescript cannot call non-native code?

I have a nwjs project in which I put a webview to visit third-party websites.

the following figure shows a custom method in a third-party website:

clipboard.png

chrome.tabs.executescript:

clipboard.png

js:location.href="abc.com"

clipboard.png

what is the problem with this? Is it true that chrome does not allow non-local methods on the site to be called? Please let the gods know

Mar.03,2021

permission problem? Add
"permissions" to
manifest.json: ["activeTab", "declarativeContent", "storage"]

Menu