Add-to-Semantic-Scuttle-WebExt/content-script.js

8 lines
218 B
JavaScript

browser.runtime.onMessage.addListener(request => {
if (request.method == "getSelection") {
return Promise.resolve({response: window.getSelection().toString()});
} else {
return Promise.resolve({});
}
});