@@ -3,16 +3,16 @@ class Action {
3
3
* `extensionName: "com.bacon.2095.axun"`
4
4
* @param {* } arguments: {completionFunction: () => unknown; extensionName: string; }
5
5
*/
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.
9
9
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
+ // }
16
16
17
17
finalize ( ) {
18
18
try {
@@ -23,15 +23,18 @@ class Action {
23
23
// Once the first script is loaded, initialize eruda
24
24
script1 . onload = function ( ) {
25
25
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();" ;
28
27
document . head . appendChild ( script2 ) ;
29
28
} ;
30
29
31
30
// Handle any potential errors while loading the script
32
31
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
+ ) ;
35
38
} ;
36
39
} catch ( error ) {
37
40
console . error ( error ) ;
0 commit comments