google chrome extension- popup page not showing correctly

前端 未结 1 932
一向
一向 2020-12-12 03:47

I am working to create a Google Chrome Extension- in this extension, there is a popup page that uses Accordion- via Jquery UI.

Now, I have correctly defined the popu

相关标签:
1条回答
  • 2020-12-12 04:11

    When "manifest_version": 2 is specified, the default Content security policy restrictions are set. One of the consequences is that inline JavaScript is not evaluated.

    There's no way to enable inline Javascript. To get your code to work, move it to an external script file, and embed it, as follows:

    <script src="popup.js"></script>
    

    popup.js:

    $(function() {
        $("#accordion").accordion({
            collapsible: true
        });
    });
    
    0 讨论(0)
提交回复
热议问题