Admin panel not working after including buggy js in head/

So in an attempt to work well with iframes I tried including an iframe resizer lib using the below:

<script type="application/javascript" src="https://raw.githubusercontent.com/davidjbradshaw/iframe-resizer/master/js/iframeResizer.contentWindow.min.js"></script>
<script type="application/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>

JQuery was not meant to be there but due to copy paste I included that too.

The above was added in the head/ section and not only it didnt work but now I cannot edit the head/ again or rather save it or complete any actions in the backend admin panel. For example changing the SSO url or even enabling it wont work after that.

In any case the error that I am getting now is the below:

Refused to execute script from 'https://raw.githubusercontent.com/davidjbradshaw/iframe-resizer/master/js/iframeResizer.contentWindow.min.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.
Uncaught TypeError: t.DivResizer is not a function
Uncaught TypeError: $(...).modal is not a function
DEBUG: For more advanced debugging, install the Ember Inspector from https://chrome.google.com/webstore/detail/ember-inspector/bmdblncegkenkacieihfhpjfppoconhi
Failed to load resource: the server responded with a status of 403 (Forbidden)
Error: Forbidden
    at a (vendor-d726f166eae32585d948cc4b83590d33.js:18)
    at Object.e.default.trigger (vendor-d726f166eae32585d948cc4b83590d33.js:23)
    at h._onerror (vendor-d726f166eae32585d948cc4b83590d33.js:24)
    at p (vendor-d726f166eae32585d948cc4b83590d33.js:23)
    at vendor-d726f166eae32585d948cc4b83590d33.js:18
    at r.invoke (vendor-d726f166eae32585d948cc4b83590d33.js:11)
    at Object.r.flush (vendor-d726f166eae32585d948cc4b83590d33.js:11)
    at Object.n.flush (vendor-d726f166eae32585d948cc4b83590d33.js:11)
    at Object.s.end (vendor-d726f166eae32585d948cc4b83590d33.js:11)
    at Object.s.run (vendor-d726f166eae32585d948cc4b83590d33.js:11)
Failed to load resource: the server responded with a status of 403 (Forbidden)
Error: Forbidden
    at a (vendor-d726f166eae32585d948cc4b83590d33.js:18)
    at Object.e.default.trigger (vendor-d726f166eae32585d948cc4b83590d33.js:23)
    at h._onerror (vendor-d726f166eae32585d948cc4b83590d33.js:24)
    at p (vendor-d726f166eae32585d948cc4b83590d33.js:23)
    at vendor-d726f166eae32585d948cc4b83590d33.js:18
    at r.invoke (vendor-d726f166eae32585d948cc4b83590d33.js:11)
    at Object.r.flush (vendor-d726f166eae32585d948cc4b83590d33.js:11)
    at Object.n.flush (vendor-d726f166eae32585d948cc4b83590d33.js:11)
    at Object.s.end (vendor-d726f166eae32585d948cc4b83590d33.js:11)
    at Object.s.run (vendor-d726f166eae32585d948cc4b83590d33.js:11)
Failed to load resource: net::ERR_CONNECTION_REFUSED

Can anyone tell me a different way of removing those lines? (NOTE: I do have SSH but not sure where these are being saved)

Here’s what I would do

# ssh into your server
cd /var/discourse
./launcher enter app
rails c
SiteCustomization.update_all(enabled: false)
1 Like

Which will do what exactly?

Enter the running container. Launch the rails console. Disable all customizations so that you can access your site again and fix it :wink:

Sounds good let me give it a try! thanks

You might have to rebuild the container (./launcher rebuild app) in order to make sure the customizations aren’t cached.

Rebuilding now but out of curiosity where are those saved?

That did it! Thanks a bunch!

1 Like

They’re stored in Redis I believe.