问题
I'm trying to write cross browser Web Extension.
Based on selected value on web page I want to create appropriate entry in context menu. I created a sample code to check if browser is entering to Event Listener. In Chrome it's all working fine, but in firefox following code is not being executed.
console.log("Content script entry");
document.addEventListener('selectionchange', function() {
debugger;
console.log("CS Add Event");
});
Could you please help?
Best regards
Frank
回答1:
I believe selectionchange
is still hidden behind a flag in Firefox... open up about:config
and search for dom.select_events.enabled
... it defaults to false
, change it to true
and restart the browser and give it another whirl.
来源:https://stackoverflow.com/questions/40059087/firefox-web-extension-selectionchange