Javascript and CSS need to be in a separate files, and your html
shouldn't have javascript functions embeded in it.
If you show me some code I could probably help better with debugging,
but chances are it is something like needing to setup onclicks in a
onload function rather than adding it right into the html.
If you want to disable CSP while developing you can add something like
this to your manifest.
https://github.com/cockpit-project/cockpit/blob/master/examples/pinger/manifest.json#L11
Generally for anything you ship, you'll want to keep to the default CSP
rules.
On 11/10/2017 11:51 AM, Mark Reynolds wrote:
Hello,
I'm evaluating cockpit to be a potential UI replacement for our database
server (389 directory server). I am also not an experienced web
developer, but regardless I'm going to be writing our new UI.
I've created a sample package(manifest.json file, html files, etc) and I
put it all under ~/.local/share/cockpit/test/
I see my new menu item, and it loads my html page. But I can not get my
custom javascript working on my project page:
Content Security Policy: The page’s settings blocked the loading of a
resource at self (“default-src http://localhost:9090
http://localhost:9090”). Source: onclick attribute on BUTTON element.
I tried putting my javascript in a separate file, and embedding it in
the html page, etc. None it works and it's the CSP that "appears" to be
blocking me every time.
What is the correct way to get my javascript functions working in my
package?
Thanks,
Mark
_______________________________________________
cockpit-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
_______________________________________________
cockpit-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]