Welcome Guest, Not a member yet? Register   Sign In
CSP Error in toolbarloader.js.php (updated)
#1

(This post was last modified: 10-26-2019, 05:16 PM by AcidSlide.)

Hi there,

I'm testing the latest version of CodeIgniter 4 (created new project using composer), and hit a snag immediately after enabling CSP.  And I have been searching for the answer for a couple of hours already.

I had like 60+ CSP errors in the console, but most of them was due to Grammarly plugin (as somebody mention it in stackoverflow) in Chrome so I uninstalled it. And now I'm down to 1 (one) error in CSP.

Here is a screenshot: https://pasteboard.co/IDPAxct.png (i am not sure on how to embedded a picture here..)

and it was pointing to this code (in toolbarloader.js.php)

Code:
            // check for last style block
            {
                let PosBeg = responseText.indexOf( '>', responseText.lastIndexOf( '<style' ) ) + 1;
                let PosEnd = responseText.indexOf( '</style>', PosBeg );
                document.getElementById( 'debugbar_dynamic_style' ).innerHTML += responseText.substr( PosBeg, PosEnd - PosBeg );
                responseText = responseText.substr( 0, PosBeg + 8 );
            }

            toolbar.innerHTML = responseText; <-- points to this, line 50 in the file
            if (typeof ciDebugBar === 'object') {
                ciDebugBar.init();
            }




I am not sure how to proceed to make sure the CSP error won't generate.

Will somebody please point me to the right direction in fixing the CSP error?
Reply


Messages In This Thread
CSP Error in toolbarloader.js.php (updated) - by AcidSlide - 10-26-2019, 01:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB