12 lines
603 B
JavaScript
12 lines
603 B
JavaScript
"use strict";
|
|
|
|
browser.runtime.onMessage.addListener(request => {
|
|
if (request.command == "bookmark") {
|
|
//const url = 'org-protocol://msg/?URL='+ encodeURIComponent(location.href)+'&TITLE='+ encodeURIComponent(document.title)+'&SELECTED='+ encodeURIComponent(window.getSelection());
|
|
const url = `org-protocol://capture/?template=l&url=${encodeURIComponent(location.href)}&title=${encodeURIComponent(document.title)}&body=${encodeURIComponent(window.getSelection())}`;
|
|
console.log("Sending to FG42. URL:", url);
|
|
location.href = url;
|
|
}
|
|
return Promise.resolve({response: "done"});
|
|
});
|