universalxpconnect

The only option is to include that block of code into each of my functions?

爷,独闯天下 提交于 2019-12-10 16:17:45
问题 Several of my functions require the UniversalXPConnect privilege to be enabled. netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); So, my functions look like this: function oneOfMyFunctions() { netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); // ... } Actually, I also try to catch the exception when the privilege is denied. Looks as follows: try { netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); // ... } catch (e) { // .

UniversalXPConnect permission error in firefox 17

◇◆丶佛笑我妖孽 提交于 2019-12-10 10:07:32
问题 I have a small web JS, that copy and inserts some form data to and from the iframe. But it doesn't work in Firefox 17. I'm using this code: "netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");" What could be wrong? Is there any workaround? 回答1: It was removed from running on the web with Firefox 17 https://developer.mozilla.org/en-US/docs/Bypassing_Security_Restrictions_and_Signing_Code Early versions of Firefox allowed web sites to segregate principals using signed

UniversalXPConnect permission error in firefox 17

依然范特西╮ 提交于 2019-12-06 01:49:04
I have a small web JS, that copy and inserts some form data to and from the iframe. But it doesn't work in Firefox 17. I'm using this code: "netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");" What could be wrong? Is there any workaround? It was removed from running on the web with Firefox 17 https://developer.mozilla.org/en-US/docs/Bypassing_Security_Restrictions_and_Signing_Code Early versions of Firefox allowed web sites to segregate principals using signed scripts, and request extra permissions for scopes within signed scripts using a function called enablePrivelege.

How to read a local file by chunks in JavaScript?

倾然丶 夕夏残阳落幕 提交于 2019-12-01 14:20:24
Say, I have a file that is 500 bytes in size on my local hard drive and I want to read first 100 bytes from it without loading the whole file into memory. How to accomplish that in JavaScript with the help of UniversalXPConnect ? In Firefox only, of course. Assuming that you want to read ASCII text data (no character set conversion): var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); file.initWithPath("/foo/bar"); var fstream = Components.classes["@mozilla.org/network/file-input-stream;1"] .createInstance(Components.interfaces

How to read a local file by chunks in JavaScript?

最后都变了- 提交于 2019-12-01 12:32:54
问题 Say, I have a file that is 500 bytes in size on my local hard drive and I want to read first 100 bytes from it without loading the whole file into memory. How to accomplish that in JavaScript with the help of UniversalXPConnect ? In Firefox only, of course. 回答1: Assuming that you want to read ASCII text data (no character set conversion): var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); file.initWithPath("/foo/bar"); var fstream =