diff --git a/src/content/js/content_script.js b/src/content/js/content_script.js index acf0e52..7b13a1d 100644 --- a/src/content/js/content_script.js +++ b/src/content/js/content_script.js @@ -76,6 +76,8 @@ object: { expression: await _.text, objectGroup: "BlueFox-js-lanch", + awaitPromise: true, + returnByValue: true, }, }); }, @@ -95,6 +97,7 @@ expression: object, objectGroup: "BlueFox-js-lanch", awaitPromise: true, + returnByValue: true, }, }); return R; diff --git a/src/tab/js/index.js b/src/tab/js/index.js index c7f005b..c4d92f0 100644 --- a/src/tab/js/index.js +++ b/src/tab/js/index.js @@ -363,6 +363,8 @@ import { BlueFoxJs } from "/modules/BlueFoxJs/bluefox.es.min.js"; object: { expression: ServerScript.value, objectGroup: "BlueFox-js-lanch", + awaitPromise: true, + returnByValue: true, }, }); }); diff --git a/src/tab/js/server.js b/src/tab/js/server.js index b1f356e..892a3ed 100644 --- a/src/tab/js/server.js +++ b/src/tab/js/server.js @@ -115,6 +115,7 @@ window.BlueFoxScript = class extends BlueFoxScript { expression: window.MonacoEditor.getValue(), objectGroup: "BlueFox-js-lanch", awaitPromise: true, + returnByValue: true, }, }); }); @@ -162,7 +163,7 @@ window.BlueFoxScript = class extends BlueFoxScript { ``, ` let search_result = await tab.dispatch.script(`, ` () => {`, - ` return JSON.stringify([...document.querySelectorAll("#search a[data-jsarwt='1']")]`, + ` return [...document.querySelectorAll("#search :is(a[data-jsarwt='1'],a[jsname])")]`, ` .filter((_) => {`, ` return _.querySelector("h3");`, ` })`, @@ -171,10 +172,10 @@ window.BlueFoxScript = class extends BlueFoxScript { ` href: _.href,`, ` title: _.querySelector("h3").textContent,`, ` }`, - ` }))`, + ` });`, ` }`, ` );`, - ` log(JSON.parse(search_result.result.value));`, + ` log(search_result.result.value);`, `})();`, ].join("\n"), language: "javascript", @@ -242,6 +243,7 @@ window.BlueFoxScript = class extends BlueFoxScript { expression: file, objectGroup: "BlueFox-js-lanch", awaitPromise: true, + returnByValue: true, }, }); }, @@ -255,6 +257,7 @@ window.BlueFoxScript = class extends BlueFoxScript { expression: data.content, objectGroup: "BlueFox-js-lanch", awaitPromise: true, + returnByValue: true, }, }); },