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

Non-shy bliss fails in electron #219

Open
dzfranklin opened this issue Oct 23, 2018 · 0 comments
Open

Non-shy bliss fails in electron #219

dzfranklin opened this issue Oct 23, 2018 · 0 comments

Comments

@dzfranklin
Copy link

dzfranklin commented Oct 23, 2018

I import Bliss using

import 'blissfuljs/bliss.shy.js';
import 'blissfuljs/bliss._.js';

and get the error

[...]\node_modules\blissfuljs\bliss.shy.js:789 Uncaught TypeError: Illegal invocation
    at Object.$.Element.(anonymous function) ([...]\node_modules\blissfuljs\bliss.shy.js:789:47)
    at $.(anonymous function) ([...]\node_modules\blissfuljs\bliss.shy.js:811:39)
    at EventTarget.removeEventListener ([...]\node_modules\blissfuljs\bliss._.js:75)
    at listener ([...]\node_modules\electron\dist\resources\electron.asar\renderer\web-view\web-view.js:395)

[...]\node_modules\blissfuljs\bliss.shy.js:789 Uncaught TypeError: Illegal invocation
    at Object.$.Element.(anonymous function) ([...]\node_modules\blissfuljs\bliss.shy.js:789:47)
    at $.(anonymous function) ([...]\node_modules\blissfuljs\bliss.shy.js:811:39)
    at EventTarget.removeEventListener ([...]\node_modules\blissfuljs\bliss._.js:75)
    at loadHandler ([...]\node_modules\electron\dist\resources\electron.asar\renderer\init.js:186)

The error doesn't appear when I only

import 'blissfuljs/bliss.shy.js'

The first error references the file web-view.js, the relevant function is

onst listener = function (event) {
  if (document.readyState === 'loading') {
    return
  }
  registerWebViewElement()
  window.removeEventListener(event.type, listener, useCapture) // the line that raises the error
}

The second error references the file init.js, the relevant function is

// Warn about security issues
window.addEventListener('load', function loadHandler () {
  if (shouldLogSecurityWarnings()) {
    if (nodeIntegration === 'true') {
      warnAboutNodeWithRemoteContent()
    }

    warnAboutDisabledWebSecurity()
    warnAboutInsecureResources()
    warnAboutInsecureContentAllowed()
    warnAboutExperimentalFeatures()
    warnAboutEnableBlinkFeatures()
    warnAboutInsecureCSP()
    warnAboutAllowedPopups()
  }

  window.removeEventListener('load', loadHandler) // the line that raises the error
})

Is electron supported?

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

No branches or pull requests

1 participant