#Help integrating AlertifyJS into remote url based electron app

16 messages · Page 1 of 1 (latest)

fringe terrace
#

I just wanted to know if it is possible
https://alertifyjs.com
I've tried injecting the
<script src="//cdn.jsdelivr.net/npm/[email protected]/build/alertify.min.js"></script>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/[email protected]/build/css/alertify.min.css"/>
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/[email protected]/build/css/themes/default.min.css"/>
But when i try to alertify.alert('test') it tells me that alertify is undefined

#

I've also double checked if the <script></script> and <link> and it is actually in the code

#

The injection code :

const js = `
let ntf = document.createElement("script");
ntf.src = "//cdn.jsdelivr.net/npm/[email protected]/build/alertify.min.js";
let ntcss = document.createElement("link");
ntcss.rel = "stylesheet";
ntcss.href = "//cdn.jsdelivr.net/npm/[email protected]/build/css/alertify.min.css";
let ntth = document.createElement("link");
ntth.rel = "stylesheet";
ntth.href = "//cdn.jsdelivr.net/npm/[email protected]/build/css/themes/default.min.css";

document.head.appendChild(ntf);
document.head.appendChild(ntcss);
document.head.appendChild(ntth);
`
win.webContents.once('dom-ready', () => {
      win.webContents.executeJavaScript(js);
    })
fossil rose
#

You can check in devtools

fringe terrace
fossil rose
#

Code yes

#

But requests?

fringe terrace
#

is there a way to use the code anyway ?

fossil rose
#

Fix errors

fringe terrace
#

how ? how can i bypass content policy violation

fossil rose
#

Fix csp

fringe terrace
#

what is csp ? i'm a newbie and i'm not english

#

Ohhh

#

im stupid

#

yea i'll take a look thanks