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

8 lines
218 B
JavaScript
Raw Permalink Normal View History

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