nsIDOMWindowUtils provides some pretty interesting helpers. Here are some example chrome-privileged scripts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<style> | |
.shape { | |
position: absolute; | |
top: 3em; | |
left: 3em; | |
width: 200px; | |
height: 200px; | |
background: yellow; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
div { | |
color: #f06; | |
} | |
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiIiwic291cmNlcyI6WyJzYXNzL2NvbnRhaW5lZC5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBO0VBQ0UsT0FISyIsInNvdXJjZXNDb250ZW50IjpbIiRwaW5rOiAjZjA2O1xuXG4jaGVhZGVyIHtcbiAgY29sb3I6ICRwaW5rO1xufSJdfQ==*/ |
A proposal for updating our style inspector and style editor.
For now it is a rough draft put together quickly. It will need to be refined a lot and will require discussions and, later, should be turned into a plan with bugs being filed.
Many of the things described below already work this way today, I just haven't had the chance yet to describe them as such. A list highlighting what exists today, what doesn't and what should be changed has yet to be created.
To achieve 2 main goals:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>event</title> | |
</head> | |
<body> | |
<div id="live"></div> | |
<script type="text/javascript"> | |
window.onload = function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
devtools inspector screencast script | |
1 - Load www.mozilla.com | |
2 - Accessing the inspector | |
- from the firefox menu bar: tools / web developer / inspector | |
-> switches the mouse selection mode ON | |
-> or alt+cmd+c | |
- from the keyboard with alt+cmd+i | |
-> can be used to toggle on/off the inspector |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Data model utility functions | |
*/ | |
Aria.classDefinition({ | |
$classpath : 'utils.Model', | |
$singleton : true, | |
$prototype : { | |
/** | |
* Safely try to get the value of a nested property of an object. If it is not found, return the default value | |
* instead. This could be useful in some cases when looking up values in a big data model, however if it doesn't |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
2d pixel-perfect collision detection | |
Requires that each object has a rectangular bounding box (simple x/y/w/h, no rotation) | |
and a bit mask (i.e. an array of lines and columns containing 0s for empty pixels and 1s for solid pixels). | |
On each frame of the animation, take all pairs of objects and | |
1. compare the bounding boxes | |
2. for those that collide, check for overlayed bits by creating a new mask that is the AND of the 2 sub-masks and check for 1s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pynarcissus import jsparser | |
from collections import defaultdict | |
class Visitor(object): | |
CHILD_ATTRS = ['thenPart', 'elsePart', 'expression', 'body', 'initializer'] | |
def __init__(self, filepath): | |
self.filepath = filepath | |
#List of functions by line # and set of names |