Firefox Web Extension “selectionchange”

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 05:18:38

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!