question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

webview.addContentScripts cause TypeError: Illegal invocation

See original GitHub issue

NWJS Version :v0.38.3 Operating System :window

Expected behavior

no TypeError

Actual behavior

an error “unCaught TypeError:Illegal invocation” displayed in the console panel Uncaught TypeError: Illegal invocation at Object.define (extensions::safeMethods:20:22) at extensions::guestViewContainerElement:68:28 at registerInternalElement (extensions::guestViewContainerElement:37:28) at listener (extensions::guestViewContainerElement:27:5)

How to reproduce

the content in the index.html is, <script> window.onload = function(){ var _webview = document.createElement("webview"); _webview.setAttribute("partition", "trusted"); var e = document.getElementById("foo"); e.appendChild(_webview); _webview.addContentScripts([{ name: "contentscript", matches: ["https://www.baidu.com/*"], js: {files: ["build/contentScript2.js"]}, run_at: "document_start" }]); _webview.src = "https://www.baidu.com/"; } </script>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rogerwangcommented, Aug 29, 2020

This is fixed in git and will be available in the next nightly build.

0reactions
panther7commented, Aug 29, 2020

Finally, only one year, but thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

webview.addContentScripts cause TypeError: Illegal invocation
NWJS Version :v0.38.3 Operating System :window. Expected behavior. no TypeError. Actual behavior. an error "unCaught TypeError:Illegal invocation" displayed ...
Read more >
NW.js v0.48.1 Released with Node.js v14.9.0 - Google Groups
Update Node.js to v14.9.0; Fix: webview.addContentScripts cause TypeError: Illegal invocation (#7087).
Read more >
Raw log | Switch to full mode | Login
KnownSize 2017-03-31 02:25:50.552 browser_tests[90742:1c07] Invalid color System, ... "Uncaught Error: Invocation of form tabs.get(string, function) doesn't ...
Read more >
CHANGELOG.md · nw52 · mirrors / rogerwang / node-webkit
Update Chromium to 87.0.4280.88; Fix: Sometimes webview. ... Fix: webview.addContentScripts cause TypeError: Illegal invocation (#7087) ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found