how to call a function in Firefox extension from a html button

后端 未结 3 676
心在旅途
心在旅途 2021-01-04 22:52

How to call a Javascript function declared in my extension, using a html button from my web page?

I have a html page, with a button inside. When the user click the

3条回答
  •  情话喂你
    2021-01-04 23:08

    Try to put this at the beginning of your javascript function that tries to access a local file:

    netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
    

    This will give the user the choice as to whether they want to allow your code to access the local filesystem.

提交回复
热议问题