Develop Chrome extension that connects to redux store in web page

Viewed 202

I am trying to develop a simple chrome extension that connects to an existing redux store running in a page in a tab.

I have a helloworld chrome extension running with a v3 manifest.

My html for my popup looks like :

<html>
  <head>
    <link rel="stylesheet" href="monitor.css">
    <script src="chrome-extension://lmhkpmbekcpmknklioeibfkpmmfibljd/js/redux-devtools-extension.js"></script>
  </head>
  <body>
        <div class='container' >
            <div>
                <label>Redux Dev Tools</label>
                <button id='connect' >Connect</button>
            </div>
            <div>
                <select id='action'>
                    <option id=1>SIGNED_IN</option>
                    <option id=1>SIGNED_OUT</option>
                    <option id=1>FETCH_ALL_BRAND_LINES</option>
                </select>
                <button id='sendAction' >Dispatch</button>
            </div>
        </div>
        <div class='container'>
            <div class='logWindow' id='log'>Log</div>
        </div>
        <script src="monitor.js"></script>
  </body>
</html>

The problem comes from trying to load the js from the redux-devtools plugin.

Refused to load the script 'chrome-extension://lmhkpmbekcpmknklioeibfkpmmfibljd/js/redux-devtools-extension.js' because it violates the following Content Security Policy directive: "script-src 'self'"

My manifest file content-security is configured as follows :

"content_security_policy": {
        "extension_pages": "script-src 'self'; object-src 'self'; script-src-elem 'self' 'unsafe-inline';"
    },

But I am really struggling to understand what I need to do to allow this script to be loaded.

Can anyone suggest what I should try?

0 Answers
Related