2
votes

I have download the js for DataTables and I'm trying to load it on my Firefox extension but, its been blocked by Content Security Policy:

Content Security Policy: The page’s settings blocked the loading of a resource at self (“default-src moz-extension://27d54fdf-40f3-4919-9314-f0f8b4715ef6”). Source: onfocusin attribute on DIV element. options.html

Content Security Policy: The page’s settings blocked the loading of a resource at self (“default-src moz-extension://27d54fdf-40f3-4919-9314-f0f8b4715ef6”). Source: $( document ).ready(functi....

I've set the Content Security Policy on my manifest.json file:

"content_security_policy": "default-src 'self'"

Here is my inclusions on head:

<script src="jquery-1.12.4.js"></script>
<script src="jquery.dataTables.min.js"></script>
<link rel="stylesheet" type="text/css" href="jquery.dataTables.min.css">

And my script on the options page:

<script type="text/javascript">
    $( document ).ready(function() {
        console.log( "ready!" );
        $('#example').DataTable();
    });
</script>

Can anyone help me with this?

1
the first comes from old jqueryAntti Haapala

1 Answers

0
votes

I had similar issue but can't be replicated using a new app. It only happens on Firefox, not Chrome. After switching to JQuery 2 or 3 this error is gone.