Thanks for the fix.
I am getting one of two errors now:
In FF 56:
Error: Timeout after 1000ms dom.js:209:10
In FF 63 Beta:
NoModificationAllowedError: Modifications are not allowed for this document dom.js:198
The context menu is firing off:
case "test_clipboard":
browser.tabs.sendMessage(tab.id,{runwhat: "zzBBCode", ParseArg: "[b]{{selection}}[/b]"});
break;
And the variable is passing to the content script: (much simplified to test just access to the clipboard)
(function(global) {
const { readFromClipboard, } = global.es6lib_dom
var clickedElement = null;
document.addEventListener("mousedown", function(event){
//right click
if(event.button == 2) {
clickedElement = event.target;
}
}, true);
browser.runtime.onMessage.addListener(function(RunParse, CommandString, sendResponse) {
var CallFunction = RunParse.runwhat;
var ArgString = RunParse.ParseArg;
CommandParse (ArgString);
sendResponse({value: clickedElement.value});
});
async function CommandParse(ArgString) {
console.log("Confirm passing Argstring: ",ArgString);
// ...
const moop = (await readFromClipboard('text/plain'));
console.log('`moop` is:', moop);
// ...
console.log("After Read from Clipboard:");
}
})(this);
On the web console, I get:
Confirm passing Argstring: [b]{{selection}}[/b]
And in the browser console, I error messages.