Skip to content

Commit b0e3a9c

Browse files
committed
Make sure use strict exsists
1 parent ebd566c commit b0e3a9c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/GM/gm_core.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,8 @@
648648
try {
649649
await loader.loadScripts(requireUrls);
650650

651-
const blob = new Blob([userCode], { type: "text/javascript" });
651+
const wrappedCode = `(function() {\n'use strict';\n${userCode}\n})();`;
652+
const blob = new Blob([wrappedCode], { type: "text/javascript" });
652653
const blobUrl = URL.createObjectURL(blob);
653654

654655
await new Promise((resolve, reject) => {

0 commit comments

Comments
 (0)