How to return a value from script when using chrome.tabs.executeScript

82 views
Skip to first unread message

Ben Bracha

unread,
Aug 21, 2023, 10:07:18 AM8/21/23
to chrome-debugging-protocol
Hi,

I have a simple script file - myScript.js:

(function main() { return 1; })();

I would expect that when running it with chrome.tabs.executeScript (giving it the "file" parameter) that I will receive a result of "1". But I get empty results.

When I run this command on console I get back "1".

Any idea how to return a value from script run by chrome.tabs.exectueScript ?

Thanks
Reply all
Reply to author
Forward
0 new messages