Skip to content

Commit f19a69a

Browse files
committedDec 3, 2023
Update index.js
1 parent b43b263 commit f19a69a

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed
 

‎targets/action/assets/index.js

+16-13
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ class Action {
33
* `extensionName: "com.bacon.2095.axun"`
44
* @param {*} arguments: {completionFunction: () => unknown; extensionName: string; }
55
*/
6-
run({ extensionName, completionFunction }) {
7-
// Here, you can run code that modifies the document and/or prepares
8-
// things to pass to your action's native code.
6+
// run({ extensionName, completionFunction }) {
7+
// // Here, you can run code that modifies the document and/or prepares
8+
// // things to pass to your action's native code.
99

10-
// We will not modify anything, but will pass the body's background
11-
// style to the native code.
12-
completionFunction({
13-
/* */
14-
});
15-
}
10+
// // We will not modify anything, but will pass the body's background
11+
// // style to the native code.
12+
// completionFunction({
13+
// /* */
14+
// });
15+
// }
1616

1717
finalize() {
1818
try {
@@ -23,15 +23,18 @@ class Action {
2323
// Once the first script is loaded, initialize eruda
2424
script1.onload = function () {
2525
var script2 = document.createElement("script");
26-
script2.textContent =
27-
"eruda.init({ theme: 'dracula' });eruda.show('elements');";
26+
script2.textContent = "eruda.init({ theme: 'dracula' });eruda.show();";
2827
document.head.appendChild(script2);
2928
};
3029

3130
// Handle any potential errors while loading the script
3231
script1.onerror = function (ev) {
33-
console.error("Error loading the eruda script.");
34-
alert(ev);
32+
const message = "message" in ev ? ev.message : ev.error;
33+
console.error("Error loading the eruda script:", ev);
34+
alert(
35+
"Error loading the Eruda script, this website may block scripting: " +
36+
message
37+
);
3538
};
3639
} catch (error) {
3740
console.error(error);

0 commit comments

Comments
 (0)
Please sign in to comment.