mozilla

Loading external js to “extend” firefox extension

北城余情 提交于 2019-12-10 12:16:36
问题 I am working on a firefox extensions that makes uses a lot of external services, I want to have a .js file foreach of these external services hosted on my server and then load each one into the extension when needed. These external js files are not "normal js" that would execute on a firefox window, they contain code that should be executed on the extension context, for example they need to make use of Components.classes["@mozilla.org/embedcomp/prompt-service;1"] . For example: var

Installing firefox extension for all users [system wide installation]

天大地大妈咪最大 提交于 2019-12-10 11:12:34
问题 I have written a Firefox extension which is packed as an .xpi file. I want to install this extension for all users. Somewhere I found that we can achieve this by putting the file in the Mozilla\Extensions folder, then the extension will be available to all users. But the problem is after installing the extension, on first launch of Firefox for an administrator, a pop-up tab will appear to ask whether to enable or disable the extension, but for the non-admin user, no pop-up will be there and

different value e.target in browers [duplicate]

老子叫甜甜 提交于 2019-12-10 10:46:12
问题 This question already has answers here : Javascript Event Listener on click not working as expected (5 answers) Closed 2 years ago . I want to know why Mozilla and Chrome have other value of e.target. I prepared this example for you. https://jsfiddle.net/qdthnmdx/ In the Mozilla e.target has value: <button type="button"> But in the Chrome this is: <span>Sometext</span> Is it some bug? 回答1: You have to know that every browser have their own implementation of the specificacion from JavaScript,

Content Security Policy on Mozilla extension

穿精又带淫゛_ 提交于 2019-12-10 10:32:15
问题 I have an extension in both Mozilla and Chrome, in my extension I make a call to a remote JS file. To avoid the CSP in Chrome, I add the rule to manifest.json and my file goin over HTTPS so everything is perfect. But in Mozilla, I could not find out how to load the JS. Even over https dont work. The only thing I found on this was another question here on Stackoverflow: How to add Content Security Policy to Firefox extension, but are not sure where to insert that code, my extension its very

saveDocument() function from NSIWebBrowserPersist

非 Y 不嫁゛ 提交于 2019-12-09 23:58:05
问题 As far as I know, 'save as..' feature from Firefox browser also uses this function, so I tried to implement this function in my code. All went well except the saved css and javascript files. They contain weird numbers. 'Save as..' from Firefox does not do this. Did I do something wrong? What I did: webBrowserPersist.saveDocument(content.document, file, dir, null, null, null); Did I miss something? Am I supposed to change MIME or encoding flags? (I don't understand these 4th and 5th parameters

getUserMedia for Firefox OS

半腔热情 提交于 2019-12-09 23:02:44
问题 It was said that getUserMedia would land on Firefox OS 1.2. I have read the documentation and tried to look for it in the Google Groups, but I have not found anything related to it. I have developed a web app that works on Firefox Nightly (so, it works in Gecko): But when I try to use it in Firefox OS 1.4, I get a "Permission denied" error: I have tried to add the following permission to the manifest: "permissions":{ "camera":{} } But didn't solve the problem. Is there any other permission

Unexpected token in CSS when editing it in vnext

送分小仙女□ 提交于 2019-12-09 14:17:32
问题 When I try to write some css through Vnext or Webmatrix v2 beta I got error that unxpected token : sometime I change something and got error that unexpected error ; When I try this body { background-color :Aqua; } I wonder all browser (moz,chrome) give me error that "Uncaught SyntaxError: Unexpected token :" Later I save it from vs2010 but i still have error. Can someone tell me where I am doing wrong. 回答1: The error suggests that you're trying to load your CSS as if it were Javascript. 回答2:

爬虫 cast day04

一世执手 提交于 2019-12-09 12:40:09
xpath <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>xpath的基本语法</title> </head> <body> <script> /* * xpath 基本语法: * 1, 根节点 : / eg: /html/body/note/book * 2, 跨节点 : // eg: //book * 3, 使用下标: [],下标从1开始,而且使用的前提是 元素之间是同级关系。 eg://book[1] 可以! //title[1] 不可以! * 下标如果倒着来的话,要用last() eg: //book[last()] 倒数第一个 book[last()-1] 倒数第二个,以此类推 * 也可以这样: book[position()>1] * 4, 精确查找: 属性选择器 eg: //title[@name="zcb1"] * 上面四个都是获取的是标签。 * * 下面是获取具体的值 * 5, 标签包裹的 内容 :使用text(). --> string eg://book[2]/title/text() 这得到的才是字符串 * 6, 取标签中属性的 value : 使用@属性名 -->string eg : //book[1]/title/@name * */ </script>

addEventListener和onclick的区别

时光总嘲笑我的痴心妄想 提交于 2019-12-09 08:05:29
今天在温习犀牛书的时候,正好看到17章,突然有个疑问,addEventListener和onclick有什么不一样?于是Google查了下,然后用写了个小demo去比较它们, addEventListener is the way to register an event listener as specified in W3C DOM. Its benefits are as follows: It allows adding more than a single handler for an event. This is particularly useful for DHTML libraries or Mozilla extensions that need to work well even if other libraries/extensions are used. It gives you finer-grained control of the phase when the listener gets activated (capturing vs. bubbling) It works on any DOM element, not just HTML elements. 下面是中文版的 参考如下: 这个是英文版本的 https://developer

v8

好久不见. 提交于 2019-12-09 00:28:31
V8 - 开源,由Google开发,用C ++编写 Rhin- 由Mozilla基金会开源,完全用Java开发 SpiderMonkey 第一个JavaScript引擎,Netscape Navigator,Firefox JavaScriptCore 苹果公司为Safari开发 KJS 最初由Harri Porten为KDE项目的Konqueror网络浏览器开发 Chakra** (JScript9) Microsoft Edge Chakra** (JavaScript) Microsoft IE9-IE11 Nashorn 作为OpenJDK的一部分,由Oracle Java语言和工具组编写 JerryScript 一个物联网的轻量级引擎 链接:https://www.jianshu.com/p/81f6ded64ab2 来源: https://www.cnblogs.com/hshy/p/12008753.html