scratchpad

Inspecting Firefox Components.interfaces.nsIDOMWindowUtils.screenPixelsPerCSSPixel value in Javascript Scratchpad

半城伤御伤魂 提交于 2019-12-11 15:55:42
问题 I am using Firefox Scratchpad to understand the scaling behavior that results when the user types the CTRL-PLUS and CTRL-MINUS keys. In Javascript Scratchpad, I'm evaluating a snippet of Javascript code that accesses the Components.interfaces.nsIDOMWindowUtils.screenPixelsPerCSSPixel property like this: var util = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindowUtils); util.screenPixelsPerCSSPixel In Scratchpad typing CTRL-L

Firefox addon error in scratchpad

ε祈祈猫儿з 提交于 2019-12-11 03:09:09
问题 I am trying to test this code here. This code "blocks" some URL if I try to join them. //const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; Cu.import('resource://gre/modules/Services.jsm'); var urls_block = [ //If URLs contain any of these elements they will be blocked or redirected, // your choice based on code in observer line 17 'www.facebook.com' ]; var redir_obj = { 'www.facebook.com': 'data:text,'+ escape('url_blocked would have went to facebook') } var observers

How to watch variables in the Firefox Scratchpad?

左心房为你撑大大i 提交于 2019-12-07 07:56:51
问题 I use Scratchpad in Firefox to run scripts against web pages and it works fine. Is there any way to debug and watch variables during execution? 回答1: Right now it's not possible to view code entered into the Scratchpad using the Debugger pane of the Firefox Developer Tools. It just shows up in the sources like Scratchpad/ 1 with content: Error loading source: loadSourceError This will be fixed in bugs 816988 and 813087 so go and vote for those. What you can do is: Add a debugger; statement to

How to watch variables in the Firefox Scratchpad?

那年仲夏 提交于 2019-12-05 17:55:56
I use Scratchpad in Firefox to run scripts against web pages and it works fine. Is there any way to debug and watch variables during execution? Right now it's not possible to view code entered into the Scratchpad using the Debugger pane of the Firefox Developer Tools. It just shows up in the sources like Scratchpad/ 1 with content: Error loading source: loadSourceError This will be fixed in bugs 816988 and 813087 so go and vote for those. What you can do is: Add a debugger; statement to the line in your Scratchpad code where you want to break. It will still be possible to view variable values,