You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm trying to inject a content-script from a browser extension.
The script uses ckeditor5 which uses lodash-es.
The whole content-script is bundled using 'rollup' before use.
The content-script works fine in the Chrome browser, but not in Firefox.
The failure seems to be with respect to the use of lodash.
I have detected two issues,
code from _root.js
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
var root = freeGlobal || freeSelf || Function('return this')();
In Chrome, freeSelf is detected - seems to be the value window.
However, in Firefox freeSelf & freeGlobal are false and thus the scrip tries to execute Function('return this')() which is not allowed by CSP in the context of a content-script.
If I replace the Function('return this')() with window
I the get a failure with new DataView(new ArrayBuffer(1)) from _getTag.js Error: Permission denied to access object
any suggestions or help gratefully received.
thanks
The text was updated successfully, but these errors were encountered:
Hi,
I'm trying to inject a content-script from a browser extension.
The script uses ckeditor5 which uses lodash-es.
The whole content-script is bundled using 'rollup' before use.
The content-script works fine in the Chrome browser, but not in Firefox.
The failure seems to be with respect to the use of lodash.
I have detected two issues,
_root.js
In Chrome,
freeSelf
is detected - seems to be the valuewindow
.However, in Firefox
freeSelf
&freeGlobal
are false and thus the scrip tries to executeFunction('return this')()
which is not allowed by CSP in the context of a content-script.Function('return this')()
withwindow
I the get a failure with
new DataView(new ArrayBuffer(1))
from_getTag.js
Error: Permission denied to access object
any suggestions or help gratefully received.
thanks
The text was updated successfully, but these errors were encountered: