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

Uncaught TypeError: Cannot read property 'preventDefault' of undefined #7

Open
rafifos opened this issue Oct 29, 2016 · 2 comments
Open

Comments

@rafifos
Copy link

rafifos commented Oct 29, 2016

Error is in if statement in lines 18 -21

"event.preventDefault()"

maybe event must be defined there too?

<script src="../node_modules/electron-open-link-in-browser/build/electron-open-link-in-browser.js></script>
[...]
<button class="mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--primary" type="button" onclick="electronOpenLinkInBrowser('http://fsf.org');"></button>

@MutableLoss
Copy link

Getting this as well when using the function the module provides.

Electron: 1.6.2

When removing the preventdefault, and debugging the process, it seems that it is having a hard time trying to gather an event of any kind, or window, and isElectronRenderer is constantly false. Is it possible this has lost support as time went by?

Anyways, I just found out in an obscure part of the docs that this is supported natively now:

{ 
  label: 'External Link', click: function () { 
    require('electron').shell.openExternal('http://electron.atom.io'); 
  } 
}

Could you possibly mention that in the README for others?

@sanemat
Copy link
Member

sanemat commented Mar 31, 2017

@3desprit Would you make a pull request?

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

3 participants