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
I checked git blame to see if this has been modified recently but it was actually added in 2012 and basically the same since 09717d7 with one change in 565b4a0 by @Feder1co5oave
I believe this is caused by either one of the following:
this does not resolve to the global object in the context used by FuweiChin
window does not resolve to the global object in that context
It seems that it is safer to use self instead of window (I'm wondering about backward compatibility though), because it works in WebWorkers too.
I'm not sure why this is used to export marked, I guess it should resolve to the global object in some environments but I'm not sure which ones.
(Mozilla content scripts should be allowed to access window, so maybe this does not resolve to it.
Also there's this bug.
Describe the bug
Marked doesn't work with Firefox extension when loaded as content script, but other UMD-compliant lib like highlight.js does.
To Reproduce
I have a Firefox extension, in manifest.json,
and in content_script.js,
Load the extension with Firefox DevTools, the console shows
window.marked
asundefined
, while showswindow.hljs
as an object .This happens in Firefox extension but not in Chrome extension.
Expected behavior
It works if I modify slightly on marked's UMD code, from original
to
which is borrowed from UMD template
The text was updated successfully, but these errors were encountered: