Search completed in 0.93 seconds.
1542 results for "Click":
Your results are loading. Please wait...
Element: click event - Web APIs
an element receives a click event when a pointing device button (such as a mouse's primary mouse button) is both pressed and released while the pointer is located inside the element.
... an element receives a click event when a pointing device button (such as a mouse's primary mouse button) is both pressed and released while the pointer is located inside the element.
...nd released while the pointer is located inside the element.
...And 22 more matches
Element: auxclick event - Web APIs
the auxclick event is fired at an element when a non-primary pointing device button (any mouse button other than the primary—usually leftmost—button) has been pressed and released both within the same element.
... the auxclick event is fired at an element when a non-primary pointing device button (any mouse button other than the primary—usually leftmost—button) has been pressed and released both within the same element.
... element when a non-primary pointing device button (any mouse button other than the primary—usually leftmost—button) has been pressed and released both within the same element.
...And 13 more matches
GlobalEventHandlers.onauxclick - Web APIs
the onauxclick property of the globaleventhandlers mixin is an eventhandler for processing auxclick events.
... the onauxclick property of the globaleventhandlers mixin is an eventhandler for processing auxclick events.
...rocessing auxclick events.
...And 13 more matches
GlobalEventHandlers.onclick - Web APIs
the onclick property of the globaleventhandlers mixin is the eventhandler for processing click events on a given element.
... the onclick property of the globaleventhandlers mixin is the eventhandler for processing click events on a given element.
... the onclick property of the globaleventhandlers mixin is the eventhandler for processing click events on a given element.
...And 12 more matches
GlobalEventHandlers.ondblclick - Web APIs
the ondblclick property of the globaleventhandlers mixin is an eventhandler that processes dblclick events on the given element.
... the ondblclick property of the globaleventhandlers mixin is an eventhandler that processes dblclick events on the given element.
... the ondblclick property of the globaleventhandlers mixin is an eventhandler that processes dblclick events on the given element.
...And 9 more matches
msthumbnailclick - Web APIs
non-standard this feature is non-standard and is not on a standards track.
... non-standard this feature is non-standard and is not on a standards track.
...tes facing the web: it will not work for every user.
...And 7 more matches
Element: dblclick event - Web APIs
the dblclick event fires when a pointing device button (such as a mouse's primary button) is double-clicked; that is, when it's rapidly clicked twice on a single element within a very short span of time.
... the dblclick event fires when a pointing device button (such as a mouse's primary button) is double-clicked; that is, when it's rapidly clicked twice on a single element within a very short span of time.
... the dblclick event fires when a pointing device button (such as a mouse's primary button) is double-clicked; that is, when it's rapidly clicked twice on a single element within a very short span of time.
...And 6 more matches
HTMLElement.click() - Web APIs
Web › API › HTMLElement › click
the htmlelement.click() method simulates a mouse click on an element.
... the htmlelement.click() method simulates a mouse click on an element.
... the htmlelement.click() method simulates a mouse click on an element.
...And 6 more matches
Notification.onclick - Web APIs
note: this feature is available in web workers.
... note: this feature is available in web workers.
... note: this feature is available in web workers.
...And 5 more matches
ServiceWorkerGlobalScope: notificationclick event - Web APIs
the notificationclick event is fired to indicate that a system notification spawned by serviceworkerregistration.shownotification() has been clicked.
... the notificationclick event is fired to indicate that a system notification spawned by serviceworkerregistration.shownotification() has been clicked.
... the notificationclick event is fired to indicate that a system notification spawned by serviceworkerregistration.shownotification() has been clicked.
...And 4 more matches
Clearing by clicking - Web APIs
« previousnext » this example demonstrates how to combine user interaction with webgl graphics operations by clearing the rendering context with a random color when the user clicks.
... « previousnext » this example demonstrates how to combine user interaction with webgl graphics operations by clearing the rendering context with a random color when the user clicks.
...colors this example provides a simple illustration of how to combine webgl and user interaction.
...And 4 more matches
ServiceWorkerGlobalScope.onnotificationclick - Web APIs
the serviceworkerglobalscope.onnotificationclick property is an event handler called whenever the notificationclick event is dispatched on the serviceworkerglobalscope object, that is when a user clicks on a displayed notification spawned by serviceworkerregistration.shownotification().
...tificationclick property is an event handler called whenever the notificationclick event is dispatched on the serviceworkerglobalscope object, that is when a user clicks on a displayed notification spawned by serviceworkerregistration.shownotification().
...tion.shownotification().
...And 3 more matches
onclick - Archive of obsolete content
« xul reference home onclick type: script code this event handler is called when the object is clicked.
... « xul reference home onclick type: script code this event handler is called when the object is clicked.
... « xul reference home onclick type: script code this event handler is called when the object is clicked.
onclick - SVG: Scalable Vector Graphics
Web › SVG › Attribute › onclick
the onclick attribute specifies some script to run when the element is clicked.
...>, <lineargradient>, <marker>, <metadata>, <mpath>, <path>, <pattern>, <polygon>, <polyline>, <radialgradient>, <rect>, <script>, <set>, <stop>, <style>, <svg>, <switch>, <symbol>, <text>, <textpath>, <title>, <tref>, <tspan>, <use>, <view> html, body, svg { height: 100%; margin: 0; } <svg viewbox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"> <circle cx="100" cy="100" r="100" onclick="alert('you have clicked the circle.')" /> </svg> usage notes value <anything> default value none animatable no specifications specification status comment scalable vector graphics (svg) 2the definition of 'onclick' in that specification.
..." /> </svg> usage notes value <anything> default value none animatable no specifications specification status comment scalable vector graphics (svg) 2the definition of 'onclick' in that specification.
movetoclick - Archive of obsolete content
« xul reference home movetoclick type: boolean if true, clicking the slide area of the scale moves the thumb directly to that position.
... « xul reference home movetoclick type: boolean if true, clicking the slide area of the scale moves the thumb directly to that position.
browser.altClickSave
the preference browser.altclicksave controls whether clicking a link while holding the alt key starts the download of that link.
... the preference browser.altclicksave controls whether clicking a link while holding the alt key starts the download of that link.
clicktoscroll - Archive of obsolete content
« xul reference home clicktoscroll type: boolean clicktoscroll, if true, the arrows must be clicked to scroll the scrollbox content.
panel.consumeoutsideclicks - Archive of obsolete content
« xul reference home consumeoutsideclicks type: boolean controls whether or not the event that caused the popup to be automatically dismissed (or "rolled up") should be consumed or be dispatched as a normal event.
click - Archive of obsolete content
Archive › Mozilla › XUL › Method › click
« xul reference home click() return type: no return value calls the onclick handler for the element.
clickSelectsAll - Archive of obsolete content
« xul reference clickselectsall type: boolean if set to true, the contents of the textbox are selected when focused; otherwise, the cursor is left unchanged.
clicktoscroll - Archive of obsolete content
« xul reference home clicktoscroll type: boolean if true, the up or down arrow(s) must be clicked to scroll the content.
Index - Web APIs
Web › API › Index
fer.mozsetdataat() method is used to add data to a specific index in the drag event's data transfer object.
... read-only property of the document interface returns an htmlcollection object containing one or more htmlembedelements representing the <embed> elements in the current document.
... the toggleattribute() method of the element interface toggles a boolean attribute (removing it if it is present and adding it if it is not present) on the given element.
...And 75 more matches
ui/button/toggle - Archive of obsolete content
experimental add a toggle button to the firefox user interface.
...rface.
...e you can create buttons that function like a check box, representing an on/off choice.
...And 53 more matches
context-menu - Archive of obsolete content
nstead appear in an overflow menu to avoid making the context menu too large.
...or the occurrence of specific contexts.
...to the page or the node the user clicked to open the menu.
...And 50 more matches
ui/button/action - Archive of obsolete content
experimental add a button to the firefox user interface.
... this module you can create buttons that display icons and can respond to click events.
... events.
...And 44 more matches
Introduction to events - Learn web development
e examples, but let's recap just to cement our knowledge.
...de, we store a reference to the button inside a constant called btn, using the document.queryselector() function.
...n inside a constant called btn, using the document.queryselector() function.
...And 37 more matches
EventTarget.addEventListener() - Web APIs
ed to pass a boolean, and we pass false as the value of the usecapture parameter.
... <tr><td id="t2">two</td></tr> </table> javascript // function to change the content of t2 function modifytext() { const t2 = document.getelementbyid("t2"); if (t2.firstchild.nodevalue == "three") { t2.firstchild.nodevalue = "two"; } else { t2.firstchild.nodevalue = "three"; } } // add event listener to table const el = document.getelementbyid("outside"); el.addeventlistener("click", modifytext, false); in this code, modifytext() is a listener for click events registered using addeventlistener().
...t2 = document.getelementbyid("t2"); if (t2.firstchild.nodevalue == "three") { t2.firstchild.nodevalue = "two"; } else { t2.firstchild.nodevalue = "three"; } } // add event listener to table const el = document.getelementbyid("outside"); el.addeventlistener("click", modifytext, false); in this code, modifytext() is a listener for click events registered using addeventlistener().
...And 31 more matches
Componentizing our Svelte app - Learn web development
— components/filterbutton.svelte.
...n-group stack-exception"> <button class="btn toggle-btn" class:btn__primary={filter === 'all'} aria-pressed={filter === 'all'} on:click={()=> filter = 'all'} > <span class="visually-hidden">show</span> <span>all</span> <span class="visually-hidden">tasks</span> </button> <button class="btn toggle-btn" class:btn__primary={filter === 'active'} aria-pressed={filter === 'active'} on:click={()=> filter = 'active'} > <span class="visually-hidden">show</span> <span>active</span> <span class="visually-hidden">tasks</span> </button> <button class="btn toggle-btn" class:btn__primary={filter === 'completed'} aria-pressed={filter === 'completed'} on:click={()=> filter = 'completed'} > <span class="visually-hidden">show</span> <span>completed</span> <span class=...
...on component, which takes the current filter as a prop — the below line is all you need: <filterbutton {filter} /> note: remember that when the html attribute name and variable matches, they can be replaced with {variable}, that's why we could replace <filterbutton filter={filter} /> with <filterbutton {filter} />.
...And 27 more matches
Index - Archive of obsolete content
ded and installed by a user, or provided pre-packaged with an application or by an external program.
...ngs.
....
...And 26 more matches
Tips - Firefox Developer Tools
general screenshots: entire page: click the screenshot button (; needs to be enabled first).
... general screenshots: entire page: click the screenshot button (; needs to be enabled first).
... general screenshots: entire page: click the screenshot button (; needs to be enabled first).
...And 26 more matches
widget - Archive of obsolete content
n particular, for a simple button, try the action button or toggle button apis, and for a more complex widget try the toolbar or sidebar apis.
...ry the action button or toggle button apis, and for a more complex widget try the toolbar or sidebar apis.
... on amo.
...And 23 more matches
Index - Archive of obsolete content
Archive › Mozilla › XUL › Index
51 checkstate xul attributes, xul reference no summary!
... xul attributes, xul reference no summary!
... summary!
...And 22 more matches
Building up a basic demo with PlayCanvas editor - Game development
al involving editing a 3d rolling ball game.
... what the page looks like — you can create projects and manage them, change their settings etc.
...ect by clicking on the new button: the resulting dialog box will show a few different options.
...And 22 more matches
Localizing with Koala
ple "de" (for german) or "es-es" (for spanish in spain).
...s tutorial on mdc, you will see two string that need to be translated: add "mdc search" manage search engines...
... choose "koala" in the templates list.
...And 21 more matches
What are browser developer tools? - Learn web development
firefox: menu ➤ web developer ➤ toggle tools, or tools ➤ web developer ➤ toggle tools chrome: more tools ➤ developer tools safari: develop ➤ show web inspector.
...loper ➤ toggle tools, or tools ➤ web developer ➤ toggle tools chrome: more tools ➤ developer tools safari: develop ➤ show web inspector.
...the develop menu, go to safari ➤ preferences ➤ advanced, and check the show develop menu in menu bar checkbox.
...And 20 more matches
Eclipse CDT
low you to use wildcards.
...rs of nsdisplaylistbuilder::isintransform, the results will not include the caller in nsobjectframe.cpp because that caller is wrapped in "#ifndef xp_macosx".
...ck type hierarchy" from the context menu.
...And 19 more matches
Examine and edit HTML - Firefox Developer Tools
he html pane is a breadcrumbs toolbar.
...matching words within the text.
...lements but not the letter "a" within the text content.
...And 18 more matches
Build your own function - Learn web development
urly braces: const html = document.queryselector('html'); const panel = document.createelement('div'); panel.setattribute('class', 'msgbox'); html.appendchild(panel); const msg = document.createelement('p'); msg.textcontent = 'this is a message box'; panel.appendchild(msg); const closebtn = document.createelement('button'); closebtn.textcontent = 'x'; panel.appendchild(closebtn); closebtn.onclick = function() { panel.parentnode.removechild(panel); } this is quite a lot of code to go through, so we'll walk you through it bit by bit.
... use of the same createelement() and appendchild() functions we've already seen to create two new elements — a <p> and a <button> — and insert them in the page as children of the panel <div>.
...ragraph, and an 'x' inside the button.
...And 17 more matches
What is JavaScript? - Learn web development
text-align: center; border: 2px solid rgba(0,0,200,0.6); background: rgba(0,0,200,0.3); color: rgba(0,0,200,0.6); box-shadow: 1px 1px 2px rgba(0,0,200,0.4); border-radius: 10px; padding: 3px 10px; display: inline-block; cursor: pointer; } and finally, we can add some javascript to implement dynamic behaviour: const para = document.queryselector('p'); para.addeventlistener('click', updatename); function updatename() { let name = prompt('enter a new name'); para.textcontent = 'player 1: ' + name; } try clicking on this last version of the text label to see what happens (note also that you can find this demo on github — see the source code, or run it live)!
...e example for instance, we ask for a new name to be entered then store that name in a variable called name.
...en store that name in a variable called name.
...And 17 more matches
Multiple Firefox profiles
uctions below, applicable to your operating system.
... to your operating system.
...firefox instance running, you can open another profile from the integrated profile manager on any platform: type about:profiles into the browser url search bar.
...And 17 more matches
Debugging on Mac OS X
e files under the project directory rather than link to them (still the case in xcode 10?) which breaks debugging and the possibility to modify-rebuild-relaunch from inside xcode.
...ry rather than link to them (still the case in xcode 10?) which breaks debugging and the possibility to modify-rebuild-relaunch from inside xcode.
... and the possibility to modify-rebuild-relaunch from inside xcode.
...And 16 more matches
ARIA: button role - Accessibility
the button role should be used for clickable elements that trigger a response when activated by the user.
...pressed="false">save</div> the above example creates a simple button which is first in the focus order, though <button> or <input> with type="button" should be used for buttons: <button id="savechanges">save</button> note: if using role="button" instead of the semantic <button> or <input type="button"> elements, you will need to make the element focusable and have to define event handlers for click and keydown events, including the enter and space keys, in order to process the user's input.
...all for the button label to change from "mute" to "unmute," a toggle button would not be appropriate, so the the aria-pressed attribute would be omitted.
...And 16 more matches
DOM onevent handlers - Developer guides
s are addeventlistener() and the specific onevent handlers.
... handlers the onevent handlers are properties on certain dom elements to manage how that element reacts to events.
... events.
...And 16 more matches
Menu - Archive of obsolete content
Archive › Mozilla › Jetpack › UI › Menu
the item may be modified.
...context is an object describing the context in which the menu was shown.
...n string label.
...And 15 more matches
JavaScript basics - Learn web development
it is available to use.
...ariables defined inside functions are only available inside those functions.
...scoping.
...And 15 more matches
Migrating from Firebug - Firefox Developer Tools
al functions for your convenience.
... firephp allow to log server-side messages to the firebug console.
...ke document.
...And 15 more matches
Examine and edit CSS - Firefox Developer Tools
this can help you understand why certain styles are not being applied.
...: next to the selector is a target icon: click this to highlight all nodes in the page that match this selector.
...is selector.
...And 15 more matches
Event reference
o the clipboard paste the item from the clipboard has been pasted keyboard events event name fired when keydown any key is pressed keypress any key (except shift, fn, or capslock) is in a pressed position (fired continuously).
... event name fired when keydown any key is pressed keypress any key (except shift, fn, or capslock) is in a pressed position (fired continuously).
... keyup any key is released mouse events event name fired when auxclick a pointing device button (any non-primary button) has been pressed and released on an element.
...And 14 more matches
Content Scripts - Archive of obsolete content
mportant differences: first, if you define an event listener by passing it as a string into setattribute(), then the listener is evaluated in the page's context, so it will not have access to any variables defined in the content script.
... is evaluated in the page's context, so it will not have access to any variables defined in the content script.
....
...And 13 more matches
XUL Events - Archive of obsolete content
ent, the blur event is passed after an element loses the focus.
... change this event is sent when the value of the textbox is changed.
...event is not sent until the focus is moved to another element.
...And 13 more matches
React interactivity: Events and state - Learn web development
: to learn about handling events and state in react, and use those to start making the case study app interactive.
...'ve only written vanilla javascript before now, you might be used to having a separate javascript file, where you query for some dom nodes and attach listeners to them.
... in react, we write event handlers directly on the elements in our jsx, like this: <button type="button" onclick={() => alert("hi!")} > say hi!
...And 13 more matches
Rich-Text Editing in Mozilla - Developer guides
ment){ return document.getelementbyid(aid).contentdocument; } else { // ie return document.frames[aid].document; } } the example contains a doricheditcommand function that makes it easier to execute commands on the iframe's document and keeps the html code clean.
...tains a doricheditcommand function that makes it easier to execute commands on the iframe's document and keeps the html code clean.
...en">green</option> <option value="black">black</option> </select> <select onchange="formatdoc('backcolor',this[this.selectedindex].value);this.selectedindex=0;"> <option class="heading" selected>- background -</option> <option value="red">red</option> <option value="green">green</option> <option value="black">black</option> </select> </div> <div id="toolbar2"> <img class="intlink" title="clean" onclick="if(validatemode()&&confirm('are you sure?')){odoc.innerhtml=sdeftxt};" src="data:image/gif;base64,r0lgodlhfgawaiqbad04ktrlyzfrjlldzl9vj1dusy14wyodhpwibbsvfy6o7ioxw5qbms+wubcztca0ccs4kddqjdtltmrl1o3yitha7opcsd/f4pfvrvdv8pv5xv///////////////////yh5baekab8alaaaaaawabyaaav84ceozgmeakqubmteyzk547qobcfwtm/jgshq4rhmloxfiehqqsawr+z4iayaj0kegtfolizlwre4ocqwrxototaihmcz0tvgmbqkzhayyfewev14eq8iflhnehmfdqka...
...And 13 more matches
ContextMenus - Archive of obsolete content
context menus a context menu is a menu where the items on the menu are specific to the context in which the menu was opened.
... context menus a context menu is a menu where the items on the menu are specific to the context in which the menu was opened.
... context menus a context menu is a menu where the items on the menu are specific to the context in which the menu was opened.
...And 12 more matches
Popup Menus - Archive of obsolete content
hree different types of popups, described below.
... when you click on the little down arrows next to the back and forward buttons in a browser window.
... just add additional ones after the first menupopup element.
...And 12 more matches
XUL Event Propagation - Archive of obsolete content
s referred to as the event model.
...ion about user actions to the code behind the interface.
...tton responds to the user action by raising an event, a message meant to travel from one element within the interface to another.
...And 12 more matches
Network request list - Firefox Developer Tools
twork monitor shows a list of all the network requests made in the course of loading the page.
...u.
...re looking for easier to view.
...And 12 more matches
Color picker tool - CSS: Cascading Style Sheets
background-repeat: no-repeat; background-position: left 35px top 60%; text-align: right; border: 3px dashed rgb(221, 221, 221); border-radius: 15px; position: absolute; top: 50px; left: 20%; } #canvas[data-tutorial='drop']:after { content: "adjust, change or modify"; width: 40%; font-size: 24px; position: absolute; top: 130px; left: 32%; z-index: 2; } #canvas [data-tutorial='dblclick'] { background-color: #999 !important; } #canvas [data-tutorial='dblclick']:before { content: "double click to activate"; width: 80px; color: #fff; position: absolute; top: 10%; left: 20%; z-index: 2; } #canvas .sample { width: 100px; height: 100px; min-width: 20px; min-height: 20px; position: absolute; border: 1px solid rgba(255, 255, 255, 0.3); } #canvas .sample:hover { cursor...
...ent('input'); var info = document.createelement('span'); wrapper.classname = 'input'; wrapper.setattribute('data-topic', topic); info.textcontent = title; info.classname = 'name'; input.setattribute('type', 'text'); wrapper.appendchild(info); wrapper.appendchild(input); this.node.appendchild(wrapper); input.addeventlistener('change', onchangefunc); input.addeventlistener('click', function() { this.select(); }); this.subscribe(topic, function(value) { input.value = value; }); }; colorpicker.prototype.createchangemodebutton = function createchangemodebutton() { var button = document.createelement('div'); button.classname = 'switch_mode'; button.addeventlistener('click', function() { if (this.picker_mode === 'hsv') this.setpickermode('hsl'); ...
...e, setpickermode : setpickermode }; })(); /** * ui-slidersmanager */ var inputslidermanager = (function inputslidermanager() { var subscribers = {}; var sliders = []; var inputcomponent = function inputcomponent(obj) { var input = document.createelement('input'); input.setattribute('type', 'text'); input.style.width = 50 + obj.precision * 10 + 'px'; input.addeventlistener('click', function(e) { this.select(); }); input.addeventlistener('change', function(e) { var value = parsefloat(e.target.value); if (isnan(value) === true) setvalue(obj.topic, obj.value); else setvalue(obj.topic, value); }); return input; }; var slidercomponent = function slidercomponent(obj, sign) { var slider = document.createelement('div'); var startx = null; v...
...And 12 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
ent('input'); var info = document.createelement('span'); wrapper.classname = 'input'; wrapper.setattribute('data-topic', topic); info.textcontent = title; info.classname = 'name'; input.setattribute('type', 'text'); wrapper.appendchild(info); wrapper.appendchild(input); this.node.appendchild(wrapper); input.addeventlistener('change', onchangefunc); input.addeventlistener('click', function() { this.select(); }); this.subscribe(topic, function(value) { input.value = value; }); }; colorpicker.prototype.createchangemodebutton = function createchangemodebutton() { var button = document.createelement('div'); button.classname = 'switch_mode'; button.addeventlistener('click', function() { if (this.picker_mode === 'hsv') this.setpickermode('hsl'); ...
...ui-dropdown-list'; select.classname = 'ui-dropdown-select'; while (node.firstelementchild !== null) { option = node.firstelementchild; option_value = option.getattribute('data-value'); if (option_value === null) option.setattribute('data-value', uval); list.appendchild(node.firstelementchild); uval++; } node.appendchild(select); node.appendchild(list); select.onclick = this.toggle.bind(this); list.onclick = this.updatevalue.bind(this); document.addeventlistener('click', clickout); this.state = 0; this.time = 0; this.dropmenu = list; this.select = select; this.toggle(false); this.value = {}; this.topic = topic; if (label) select.textcontent = label; else this.setnodevalue(list.children[selected]); dropdowns[topic] = this; }; ...
....toggle(false); } this.time = date.now(); }; dropdown.prototype.setnodevalue = function setnodevalue(node, send_notify) { this.value['name'] = node.textcontent; this.value['value'] = node.getattribute('data-value'); this.select.textcontent = node.textcontent; this.select.setattribute('data-value', this.value['value']); if (send_notify !== false) notify.call(this); }; var clickout = function clickout(e) { if (active.state === 0 || e.target === active.dropmenu || e.target === active.select) return; active.toggle(false); }; var createdropdown = function createdropdown(topic, options) { var dropdown = document.createelement('div'); dropdown.setattribute('data-topic', topic); dropdown.classname = 'ui-dropdown'; for (var i in options) { var x = ...
...And 12 more matches
Creating a cross-browser video player - Developer guides
inc = document.getelementbyid('volinc'); var voldec = document.getelementbyid('voldec'); var progress = document.getelementbyid('progress'); var progressbar = document.getelementbyid('progress-bar'); var fullscreen = document.getelementbyid('fs'); using these handles, events can now be attached to each of the custom control buttons making them interactive.
...document.getelementbyid('progress-bar'); var fullscreen = document.getelementbyid('fs'); using these handles, events can now be attached to each of the custom control buttons making them interactive.
...es, events can now be attached to each of the custom control buttons making them interactive.
...And 12 more matches
panel - Archive of obsolete content
ssages between the content script and the main add-on code.
... the script using either the postmessage() api or (preferably, usually) the port api.
...mouse clicks on links inside the panel, and sends the target url to the main add-on code.
...And 11 more matches
Implementing the widget - Archive of obsolete content
efox 38.
... no longer works with firefox.
...le for replacements.
...And 11 more matches
Venkman Introduction - Archive of obsolete content
g this degree of flexibility, depth, and power in a visual debugging environment.
...ortunately, the xpinstall technology makes it possible to install new application modules in firefox by just clicking a hyperlink.
...ebugger.
...And 11 more matches
HTML: A good basis for accessibility - Learn web development
keyboard accessibility for more details.
...or for free, just by using the appropriate elements, e.g.
...on> <option>worried</option> </select> </div> </form> this means using links, buttons, form elements, and labels appropriately (including the <label> element for form controls).
...And 11 more matches
HTML: A good basis for accessibility - Learn web development
keyboard accessibility for more details.
...or for free, just by using the appropriate elements, e.g.
...on> <option>worried</option> </select> </div> </form> this means using links, buttons, form elements, and labels appropriately (including the <label> element for form controls).
...And 11 more matches
Practical positioning examples - Learn web development
mation available without having it fill the whole ui.
...> <li>dui neque eleifend lorem, a auctor libero turpis at sem.</li> <li>aliquam ut porttitor urna.</li> <li>nulla facilisi</li> </ol> </article> </div> </section> so here we've got a <section> element with a class of info-box, which contains a <ul> and a <div>.
...vised against setting a fixed height on content containers if at all possible; it is ok in this circumstance because we have fixed content in our tabs.
...And 11 more matches
Vue conditional rendering: editing existing todos - Learn web development
a new file called todoitemeditform.vue.
...e code then read the below description to make sure you understand everything the component is doing before moving on.
...ng before moving on.
...And 11 more matches
Tutorial: Set a breakpoint - Firefox Developer Tools
s scratchpad.
...ck on the options gear at the upper right of the toolbox, and make sure that both “enable browser chrome and add-on debugging toolboxes” and “enable remote debugging” are checked.
...per right of the toolbox, and make sure that both “enable browser chrome and add-on debugging toolboxes” and “enable remote debugging” are checked.
...And 11 more matches
Window.open() - Web APIs
Web › API › Window › open
wobjectreference.focus(); /* else the window reference must exist and the window is not closed; therefore, we can bring it back on top of any other window with the focus() method.
...dfirefox.com/" target="promotefirefoxwindowname" onclick="openffpromotionpopup(); return false;" title="this link will create a new window or will re-use an already opened one" >promote firefox adoption</a></p> the above code solves a few usability problems related to links opening secondary window.
...te firefox adoption</a></p> the above code solves a few usability problems related to links opening secondary window.
...And 11 more matches
Making content editable - Developer guides
en">green</option> <option value="black">black</option> </select> <select onchange="formatdoc('backcolor',this[this.selectedindex].value);this.selectedindex=0;"> <option class="heading" selected>- background -</option> <option value="red">red</option> <option value="green">green</option> <option value="black">black</option> </select> </div> <div id="toolbar2"> <img class="intlink" title="clean" onclick="if(validatemode()&&confirm('are you sure?')){odoc.innerhtml=sdeftxt};" src="data:image/gif;base64,r0lgodlhfgawaiqbad04ktrlyzfrjlldzl9vj1dusy14wyodhpwibbsvfy6o7ioxw5qbms+wubcztca0ccs4kddqjdtltmrl1o3yitha7opcsd/f4pfvrvdv8pv5xv///////////////////yh5baekab8alaaaaaawabyaaav84ceozgmeakqubmteyzk547qobcfwtm/jgshq4rhmloxfiehqqsawr+z4iayaj0kegtfolizlwre4ocqwrxototaihmcz0tvgmbqkzhayyfewev14eq8iflhnehmfdqka...
...:image/gif;base64,r0lgodlhfgawaiqbad04ktrlyzfrjlldzl9vj1dusy14wyodhpwibbsvfy6o7ioxw5qbms+wubcztca0ccs4kddqjdtltmrl1o3yitha7opcsd/f4pfvrvdv8pv5xv///////////////////yh5baekab8alaaaaaawabyaaav84ceozgmeakqubmteyzk547qobcfwtm/jgshq4rhmloxfiehqqsawr+z4iayaj0kegtfolizlwre4ocqwrxototaihmcz0tvgmbqkzhayyfewev14eq8iflhnehmfdqkaiskqci2pdc4qbg+oajc0ewadncogo6anqkkoiqa7" /> <img class="intlink" title="print" onclick="printdoc();" src="data:image/png;base64,ivborw0kggoaaaansuheugaaabyaaaawcayaaadetgw7aaaabgdbtueaalgpc/xhbqaaaazis0deap8a/wd/ol2nkwaaaalwsflzaaalewaacxmbajqcgaaaaad0su1fb9oebxczfmgboiwaaaaidevydenvbw1lbnqa9sywvwaaaufjrefuomvtlutsjfeux//n3nn0ydpbh1abrpt4lfqtqkc3jrkkneisiiribbehjjpklivo4m1rrmkkjqirmjruqudkpt71qpipirkpaqdf55tv5vvuszjqtjolseukd3xu/3dpzusc/22wtu2wrn+jg5so/ocdh8ycmjdflehmlkjkvk7kuyn+uf...
...7dtgdegxacsiznx8zpmwh7k4rkpjcuhdxcul6mdsmmbxdlwch2+xozsgbnzsncee4euyv4pwcpswypw0uhdybkswu1nyjendreqtkjwn2+zvttc1vmstb/mvev/weyslasslimcohobjxw+n3ap/sjefnl5gepzmpu4kg7opr1+tofpyuu3becwykcwqcdfmwfkauo90fhkdinbcamvqnymgqueagqwcohbdc1rjv9pild8ibvkz6qyviibqgtjpx4k0xpigezorn1da0cij4vfr0ta3wvbxh/rjdcufv6r2zpgph/e4pxsbcpeatqprjniso203/5s/za171mv8+w1loaaaaaelftksuqmcc"> <img class="intlink" title="undo" onclick="formatdoc('undo');" src="data:image/gif;base64,r0lgodlhfgawaomkadljwlie33morpgjuykl8aezxqpd+7/i19dv3nha7p///////////////////////yh5baekaa8alaaaaaawabyaaarr8mljq7046807tkayejjbnes4eeujvigapwyac0csocq7sdlwjkakca6tomywiargqf3mrqviejkksvlibsfewhdrih4fh/dzmice3/c4nbqbads=" /> <img class="intlink" title="redo" onclick="formatdoc('redo');" src="data:image/gif;base64,r0lgodlhfgawamihab1chdljwl9vj1ie34kl...
...And 11 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
us by adding class="menuitem-iconic" to a menuitem element, along with a src attribute that gives an image uri.
..., along with a src attribute that gives an image uri.
...ecute a command when a menu item is selected.
...And 10 more matches
More Event Handlers - Archive of obsolete content
s to stop both from occuring.
... has been prevented, neither may be re-enabled again for that event.
...n for that event.
...And 10 more matches
How to build custom form controls - Learn web development
nt.
...der, just like any native control.
... the page loads.
...And 10 more matches
General asynchronous programming concepts - Learn web development
ntensive chunk of code without returning control to the browser, the browser can appear to be frozen.
...ol to the browser, the browser can appear to be frozen.
...t's look at a couple of examples that show what we mean by blocking.
...And 10 more matches
Introducing asynchronous JavaScript - Learn web development
is.
... of the information we saw in the previous article.
...n = document.queryselector('button'); btn.addeventlistener('click', () => { alert('you clicked me!'); let pelem = document.createelement('p'); pelem.textcontent = 'this is a newly-added paragraph.'; document.body.appendchild(pelem); }); in this block, the lines are executed one after the other: we grab a reference to a <button> element that is already available in the dom.
...And 10 more matches
Introduction to automated testing - Learn web development
asics: manual tests once you sign in to lambdatest, you will be routed to the lambdatest dashboard.
...essions are running, your total number of tests to date, and more.
... test logs, and issue tracker at lambdatest.
...And 10 more matches
Storage access policy: Block cookies from trackers
ox through the content blocking settings (these steps will vary by version; the linked documentation includes a dropdown to select the appropriate firefox version).
... not.
... custom domains to the tracking protection url classifier.
...And 10 more matches
Profiling with the Firefox Profiler
tracing markers red: these indicate that the event loop is being unresponsive.
...so note that this indicates what would have happened had there been an event waiting and not necessarily that there was an event pending for that long.
...r very time-sensitive profiling, you may want to consider a non-sampling profiler.
...And 10 more matches
about:debugging - Firefox Developer Tools
the about:debugging page provides a single place from which you can attach the firefox developer tools to a number of debugging targets.
... the about:debugging page.
...r android device and your computer is not authorized yet.
...And 10 more matches
Signaling and video calling - Web APIs
e chat client to support video calling.
...playback in our code.
...ing the user names of every connected user.
...And 10 more matches
Overview of events and handlers - Developer guides
inuously between processing, drawing, presenting content, and waiting for some new event trigger.
...e function which will handle those data structures a method called addeventlistener which expects as arguments a string event type name and the handler function.
...hose data structures a method called addeventlistener which expects as arguments a string event type name and the handler function.
...And 10 more matches
Creating hyperlinks - Learn web development
what is a hyperlink?
...relative url link inside it would now point to a file located at http://www.example.com/pdfs/project-brief.pdf, not a file located at http://www.example.com/projects/pdfs/project-brief.pdf.
...your link text to effectively describe what is being linked to.
...And 9 more matches
Video and Audio APIs - Learn web development
ontrols.style.visibility = 'visible'; these two lines remove the default browser controls from the video, and make the custom controls visible.
...'; these two lines remove the default browser controls from the video, and make the custom controls visible.
...ck whether the video is paused.
...And 9 more matches
Handling common accessibility problems - Learn web development
ving the css from your code, but the easiest way is to use browser features, for example: firefox: select view > page style > no style from the main menu.
...ncluding via tab) by giving each one the attribute tabindex="0" (see webaim's tabindex article for more really useful details).
...ument.onkeydown = function(e) { if(e.keycode === 13) { // the enter/return key document.activeelement.onclick(e); } }; here we add a listener to the document object to detect when a button has been pressed on the keyboard.
...And 9 more matches
Eclipse CDT Manual Setup
workspace" (a directory where eclipse will store files that it generates during indexing, and so on.) it's recommended that you have a separate workspace containing only a single project for each mozilla source tree [rational], and that you choose a directory outside the mozilla source.
...nces) before creating a project in that workspace: in "general > workspace", disable "build automatically" in "c/c++ > indexer", disable "automatically update the index" turning off automatic indexing prevents the cpu intensive indexer from running at various stages during the steps below before we're ready.
... the font size.
...And 9 more matches
MouseEvent - Web APIs
the mouseevent interface represents events that occur due to the user interacting with a pointing device (such as a mouse).
... the mouseevent interface represents events that occur due to the user interacting with a pointing device (such as a mouse).
...only the type of device that generated the event (one of the moz_source_* constants listed below).
...And 9 more matches
Interacting with page scripts - Archive of obsolete content
the sdk.
...n event listener to each: one listener displays a property of the cloned object, and the other listener displays a property of the assigned object: <html> <head> </head> <body> <input id="works" type="button" value="i will work"/> <input id="fails" type="button" value="i will not work"/> <script> var works = document.getelementbyid("works"); works.addeventlistener("click", function() { alert(clonedcontentscriptobject.greeting); }, false); var fails = document.getelementbyid("fails"); fails.addeventlistener("click", function() { alert(assignedcontentscriptobject.greeting); }, false); </script> </body> </html> if you run the example, clicking "i will work" displays the value of "greeting" in an alert.
...listener("click", function() { alert(clonedcontentscriptobject.greeting); }, false); var fails = document.getelementbyid("fails"); fails.addeventlistener("click", function() { alert(assignedcontentscriptobject.greeting); }, false); </script> </body> </html> if you run the example, clicking "i will work" displays the value of "greeting" in an alert.
...And 8 more matches
Reddit Example - Archive of obsolete content
this example uses the action button api, which is only available from firefox 29 onwards.
... action button api, which is only available from firefox 29 onwards.
...t in the context of the reddit page which intercepts mouse clicks on each title link and fetches the link's target url.
...And 8 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
sing the repl, start at https://svelte.dev/repl/76cc90c43a37452e8c7f70521f88b698?version=3.23.2 working on the moreactions component now we'll tackle the check all and remove completed buttons.
...ons component now we'll tackle the check all and remove completed buttons.
...ur moreactions.svelte file: <script> import { createeventdispatcher } from 'svelte' const dispatch = createeventdispatcher() let completed = true const checkall = () => { dispatch('checkall', completed) completed = !completed } const removecompleted = () => dispatch('removecompleted') </script> <div class="btn-group"> <button type="button" class="btn btn__primary" on:click={checkall}>{completed ?
...And 8 more matches
Edit Shape Paths in CSS - Firefox Developer Tools
ide property and <basic-shape> values.
...vate / deactivate the shape path editor the shape path editor is accessed via the css rules panel, which can be opened as described in the guide to opening the inspector.
...t the margin box reference; this is the area that will be clipped by the margin box.
...And 8 more matches
Work with animations - Firefox Developer Tools
point in the timeline and see the page at that point.
...sing css transitions, css @keyframes rules, or the web animations api.
...works, we'll walk through an example.
...And 8 more matches
Element - Web APIs
Web › API › Element
h the specified name and namespace, from the current node.
...f full-screen mode.
...ess fired when a key that produces a character value is pressed down.
...And 8 more matches
<input type="button"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › button
<input> elements of type button are rendered as simple push buttons, which can be programmed to control custom functionality anywhere on a webpage as required when assigned an event handler function (typically for the click event).
...ve-examples and send us a pull request.
..., you can include html in the label, even images.
...And 8 more matches
Appendix E: DOM Building and Insertion (HTML & XUL) - Archive of obsolete content
}); return frag; } // single element?
...amespace prefixes which can be used in the given dom tree.
... ], ['html:form', {id:'mysecondform'}, ['html:input', {type:'text', value:'my field for second form'}], ['html:div', {}, 'sub div with textcontent and siblings', ['html:br', {}], ['html:input', {type:'checkbox', id:'mycheck'}], ['html:label', {for:'mycheck'}, 'here is text of label, click this text will check the box' ] ] ] ]; document.body.appendchild(jsontodom(json, document, {})); jquery templating for extensions which already use jquery, it is possible to use its builtin dom building functions for templating, though care must be taken when passing non-static strings to methods such as .append() and .html().
...And 7 more matches
Building accessible custom components in XUL - Archive of obsolete content
don't want to make every label and description element focusable.
...rimentation, i found the solution for this.
...atically reset the focus to the previously focused cell.
...And 7 more matches
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
ent);"/> </toolbarpalette> notes: the id of the palette (browsertoolbarpalette in the example) depends on the window (the parent window of the toolbar you wish to insert a button).
...sertoolbarpalette in the example) depends on the window (the parent window of the toolbar you wish to insert a button).
...ndow (the parent window of the toolbar you wish to insert a button).
...And 7 more matches
Framework main features - Learn web development
lked about the concept of state in the previous chapter — a robust state-handling mechanism is key to an effective framework, and each component may have data to control the state of.
...ge will persist in some way as long as the component is in use.
... component should be responsible for tracking its own count state, and could be written like this: function counterbutton() { const [count] = usestate(0); return ( <button>clicked {count} times</button> ); } usestate() is a react hook which, given an initial data value, will keep track of that value as it is updated.
...And 7 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
so we can rewrite our last line like this.
...ent.
..."todo-{todo.id}" on:click={() => todo.completed = !todo.completed} checked={todo.completed} /> next we'll add a function to remove a todo from our todos array.
...And 7 more matches
Setting up your own test automation environment - Learn web development
to integrate it with tools like lambdatest, sauce labs, and browserstack.
...quire('selenium-webdriver'), by = webdriver.by, until = webdriver.until; const driver = new webdriver.builder() .forbrowser('firefox') .build(); driver.get('http://www.google.com'); driver.findelement(by.name('q')).sendkeys('webdriver'); driver.sleep(1000).then(function() { driver.findelement(by.name('q')).sendkeys(webdriver.key.tab); }); driver.findelement(by.name('btnk')).click(); driver.sleep(2000).then(function() { driver.gettitle().then(function(title) { if(title === 'webdriver - google search') { console.log('test passed'); } else { console.log('test failed'); } driver.quit(); }); }); in terminal, make sure you are inside your project folder, then enter the following command: node google_test you should see an instance of ...
...assed'); } else { console.log('test failed'); } driver.quit(); }); }); in terminal, make sure you are inside your project folder, then enter the following command: node google_test you should see an instance of firefox automatically open up!
...And 7 more matches
nsIAlertsService
ovided by firefox and have become platform-independent.
...sealert([optional] in astring name, [optional] in nsiprincipal principal); methods showalertnotification() displays a notification window.
...rs imageurl a url identifying the image to display in the notification alert.
...And 7 more matches
about:debugging (before Firefox 68) - Firefox Developer Tools
ebugging page provides a single place from which you can attach the firefox developer tools to a number of debugging targets.
...nect the add-on debugger to any restartless add-ons connecting the add-on debugger the add-ons page in about:debugging lists all restartless add-ons that are currently installed (note that this list may include add-ons that came preinstalled with your firefox).
...bugger the add-ons page in about:debugging lists all restartless add-ons that are currently installed (note that this list may include add-ons that came preinstalled with your firefox).
...And 7 more matches
Using files from web applications - Web APIs
= napprox.tofixed(3) + " " + amultiples[nmultiple] + " (" + nbytes + " bytes)"; } // end of optional code document.getelementbyid("filenum").innerhtml = nfiles; document.getelementbyid("filesize").innerhtml = soutput; } document.getelementbyid("uploadinput").addeventlistener("change", updatesize, false); </script> </body> </html> using hidden file input elements using the click() method you can hide the admittedly ugly file <input> element and present your own interface for opening the file picker and displaying which file or files the user has selected.
...uploadinput").addeventlistener("change", updatesize, false); </script> </body> </html> using hidden file input elements using the click() method you can hide the admittedly ugly file <input> element and present your own interface for opening the file picker and displaying which file or files the user has selected.
... own interface for opening the file picker and displaying which file or files the user has selected.
...And 7 more matches
Window.captureEvents() - Web APIs
the window.captureevents() method registers the window to capture all events of the specified type.
... the window.captureevents() method registers the window to capture all events of the specified type.
...ge, event.dblclick, event.dragddrop, event.error, event.focus, event.keydown, event.keypress, event.keyup, event.load, event.mousedown, event.mousemove, event.mouseout, event.mouseover, event.mouseup, event.move, event.reset, event.resize, event.select, event.submit, event.unload.
...And 7 more matches
Border-image generator - CSS: Cascading Style Sheets
t: left; } javascript content 'use strict'; /** * ui-slidersmanager */ var inputslidermanager = (function inputslidermanager() { var subscribers = {}; var sliders = []; var inputcomponent = function inputcomponent(obj) { var input = document.createelement('input'); input.setattribute('type', 'text'); input.style.width = 50 + obj.precision * 10 + 'px'; input.addeventlistener('click', function(e) { this.select(); }); input.addeventlistener('change', function(e) { var value = parsefloat(e.target.value); if (isnan(value) === true) setvalue(obj.topic, obj.value); else setvalue(obj.topic, value); }); return input; }; var slidercomponent = function slidercomponent(obj, sign) { var slider = document.createelement('div'); var startx = null; v...
...t.addeventlistener('change', function(e) { var value = parsefloat(e.target.value); if (isnan(value) === true) setvalue(obj.topic, obj.value); else setvalue(obj.topic, value); }); return input; }; var slidercomponent = function slidercomponent(obj, sign) { var slider = document.createelement('div'); var startx = null; var start_value = 0; slider.addeventlistener("click", function(e) { document.removeeventlistener("mousemove", slidermotion); setvalue(obj.topic, obj.value + obj.step * sign); }); slider.addeventlistener("mousedown", function(e) { startx = e.clientx; start_value = obj.value; document.body.style.cursor = "e-resize"; document.addeventlistener("mouseup", slideend); document.addeventlistener("mousemove", slidermotion); }); ...
...ui-dropdown-list'; select.classname = 'ui-dropdown-select'; while (node.firstelementchild !== null) { option = node.firstelementchild; option_value = option.getattribute('data-value'); if (option_value === null) option.setattribute('data-value', uval); list.appendchild(node.firstelementchild); uval++; } node.appendchild(select); node.appendchild(list); select.onclick = this.toggle.bind(this); list.onclick = this.updatevalue.bind(this); document.addeventlistener('click', clickout); this.state = 0; this.time = 0; this.dropmenu = list; this.select = select; this.toggle(false); this.value = {}; this.topic = topic; if (label) select.textcontent = label; else this.setnodevalue(list.children[selected]); dropdowns[topic] = this; }; ...
...And 7 more matches
Add a Context Menu Item - Archive of obsolete content
to follow this tutorial you'll need to have learned the basics of jpm.
...ext-menu module.
..."log selection", context: contextmenu.selectioncontext(), contentscript: 'self.on("click", function () {' + ' var text = window.getselection().tostring();' + ' self.postmessage(text);' + '});', onmessage: function (selectiontext) { console.log(selectiontext); } }); try it: run the add-on, load a web page, select some text and right-click.
...And 6 more matches
Storing annotations - Archive of obsolete content
tationtext) handlenewannotation(annotationtext, this.annotationanchor); annotationeditor.hide(); }, onshow: function() { this.postmessage('focus'); } }); listing stored annotations to prove that this works, let's implement the part of the add-on that displays all the previously entered annotations.
...ge(storedannotations) { var annotationlist = $('#annotation-list'); annotationlist.empty(); storedannotations.foreach( function(storedannotation) { var annotationhtml = $('#template .annotation-details').clone(); annotationhtml.find('.url').text(storedannotation.url) .attr('href', storedannotation.url); annotationhtml.find('.url').bind('click', function(event) { event.stoppropagation(); event.preventdefault(); self.postmessage(storedannotation.url); }); annotationhtml.find('.selection-text') .text(storedannotation.anchortext); annotationhtml.find('.annotation-text') .text(storedannotation.annotationtext); annotationlist.append(annotationhtml); ...
...(storedannotation.url); }); annotationhtml.find('.selection-text') .text(storedannotation.anchortext); annotationhtml.find('.annotation-text') .text(storedannotation.annotationtext); annotationlist.append(annotationhtml); }); }); it builds the dom for the panel from the array of annotations it is given.
...And 6 more matches
Getting Started (jpm) - Archive of obsolete content
in "index.js" file in the root of your add-on.
..." file in the root of your add-on.
... add-on.
...And 6 more matches
Getting started (cfx) - Archive of obsolete content
in the "main.js" file in your "lib" directory.
....js" file in your "lib" directory.
...rectory.
...And 6 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
rors to the error console.
...orces strict error output from javascript true table 1: preferences to set for developing extensions to make these changes, start your development profile, type about:config into firefox’s location bar and open the preferences window; find the preferences listed in table 1 and double-click on them to set them accordingly.
...rlay document will insert its content into the base document.
...And 6 more matches
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
in mozilla by going to tools -> web development -> javascript console or in firefox (the standalone browser product from mozilla) at tools -> javascript console.
...cape model.
...orer, if a function is called from an event, it can access the event object through window.event.
...And 6 more matches
Extensions - Archive of obsolete content
by another extension, depending on the order in which the overlays are applied.
...nails.selectalllinks();" insertafter="context-selectall"/> </popup> see firefox context menu for a list of the ids of the items found on the firefox context menu.
....
...And 6 more matches
OpenClose - Archive of obsolete content
opening and closing popups popups and menus may be opened and closed by a script.
...ose automatically once the user has made a selection from the menu.
...tate to check if a menu is open, check the state of the menu's open property.
...And 6 more matches
panel - Archive of obsolete content
Archive › Mozilla › XUL › panel
any type of content.
...en the panel's hidepopup method is called.
... <image src="warning.png"/> <vbox> <description value="you have 6 new messages."/> <hbox> <button label="read mail"/> <button label="new message"/> </hbox> </vbox> </hbox> </panel> <description value="6 new messages" popup="thepanel"/> attributes backdrag type: boolean setting the backdrag attribute on a xul panel lets the user move the panel by clicking and dragging anywhere on its background area.
...And 6 more matches
Desktop mouse and keyboard controls - Game development
you can write everything on your own, but you can also take the advantage of built-in functions in frameworks like phaser — these will make your life easier and development a lot faster.
...er — these will make your life easier and development a lot faster.
... the mouse interactions in the game are focused on clicking the buttons.
...And 6 more matches
CSS and JavaScript accessibility best practices - Learn web development
lor.
...value filled in when the form is submitted, we create a list item with a link and insert it in the errorlist.
...r = document.createelement('a'); anchor.textcontent = testitem.input.name + ' field is empty: fill in your ' + testitem.input.name + '.'; anchor.href = '#' + testitem.input.name; anchor.onclick = function() { testitem.input.focus(); }; listitem.appendchild(anchor); errorlist.appendchild(listitem); } each link serves a dual purpose — it tells you what the error is, plus you can click on it/activate it to jump straight to the input element in question and correct your entry.
...And 6 more matches
Client-side storage - Learn web development
form from actually submitting itself when the submit button is pressed, as this is not the behavior we want.
... hello" button is clicked.
...nts explain in detail what each bit does, but in essence here we are taking the name the user has entered into the text input box and saving it in web storage using setitem(), then running a function called namedisplaycheck() that will handle updating the actual website text.
...And 6 more matches
Working with Svelte stores - Learn web development
ent and see how we can read values from the store.
...the value we receive to the local variable, which will trigger the update of the component's dom.
...sing the component let's now use our component.
...And 6 more matches
Cross Process Object Wrappers
so should only be used when necessary and only as a migration aid.
... used when necessary and only as a migration aid.
... scripts frame scripts can send messages to chrome using one of two global functions: sendasyncmessage() or sendsyncmessage().
...And 6 more matches
Application Translation with Mercurial
check what is available for translation find out on which branch localization is done for your locale: read your localization team's page by clicking on the team with your language code (e.g.
... check what is available for translation find out on which branch localization is done for your locale: read your localization team's page by clicking on the team with your language code (e.g.
...of the texts in the application already translated.
...And 6 more matches
nsIDOMWindowUtils
ong akeycode, in long acharcode, in long amodifiers, [optional] in boolean apreventdefault); obsolete since gecko 15.0 boolean sendkeyevent(in astring atype, in long akeycode, in long acharcode, in long amodifiers, [optional] in unsigned long aadditionalflags); deprecated since gecko 38.0 void sendmouseevent(in astring atype, in float ax, in float ay, in long abutton, in long aclickcount, in long amodifiers, [optional] in boolean aignorerootscrollframe); void sendmouseeventtowindow(in astring atype, in float ax, in float ay, in long abutton, in long aclickcount, in long amodifiers, [optional] in boolean aignorerootscrollframe); void sendmousescrollevent(in astring atype, in float ax, in float ay, in long abutton, in long ascrollflags, in long adelta, in l...
...alled on it, true otherwise.
...ssed from unprivileged context (not content-accessible) will throw a dom security error if called without universalxpconnect privileges.
...And 6 more matches
Thunderbird Configuration Files
warning: the content of this article may be out of date.
... this article may be out of date.
...entioned on this site can be applied by using the built-in config editor.
...And 6 more matches
All keyboard shortcuts - Firefox Developer Tools
/uncomment line(s) ctrl + / cmd + / ctrl + / page inspector command windows macos linux inspect element ctrl + shift + c cmd + shift + c ctrl + shift + c node picker these shortcuts work while the node picker is active.
...t line(s) ctrl + / cmd + / ctrl + / page inspector command windows macos linux inspect element ctrl + shift + c cmd + shift + c ctrl + shift + c node picker these shortcuts work while the node picker is active.
... ctrl + / cmd + / ctrl + / page inspector command windows macos linux inspect element ctrl + shift + c cmd + shift + c ctrl + shift + c node picker these shortcuts work while the node picker is active.
...And 6 more matches
Style Editor - Firefox Developer Tools
appear at the bottom of the browser window, with the style editor activated: the style editor is divided into three main sections: the style sheet pane on the left the editor on the right the media sidebar.
... style sheet pane on the left the editor on the right the media sidebar.
...nu that lets you open the selected style sheet in a new tab.
...And 6 more matches
Examples of web and XML development using the DOM - Web APIs
<title>modifying an image border</title> <script> function setborderwidth(width) { document.getelementbyid("img1").style.borderwidth = width + "px"; } </script> </head> <body> <p> <img id="img1" src="image1.gif" style="border: 5px solid green;" width="100" height="100" alt="border test"> </p> <form name="formname"> <input type="button" value="make border 20px-wide" onclick="setborderwidth(20);" /> <input type="button" value="make border 5px-wide" onclick="setborderwidth(5);" /> </form> </body> </html> example 3: manipulating styles in this simple example, some basic style properties of an html paragraph element are accessed using the style object on the element and that object's css style properties, which can be retrieved and set from the dom.
...al styles directly.
... for whole documents.
...And 6 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
vertex, interpolating as needed from the values found in the texture and applying the lighting effects.
...ting as needed from the values found in the texture and applying the lighting effects.
... cameramatrixout = document.queryselector("#camera-matrix div"); mousematrixout = document.queryselector("#mouse-matrix div"); if (!navigator.xr || enableforcepolyfill) { console.log("using the polyfill"); polyfill = new webxrpolyfill(); } setupxrbutton(); } the load event handler gets a reference to the button that toggles webxr on and off into xrbutton, then adds a handler for click events.
...And 6 more matches
Video player styling basics - Developer guides
} // mute button else if (type == 'mute') { mute.setattribute('data-state', video.muted ?
...ate('playpause'); }, false); video.addeventlistener('pause', function() { changebuttonstate('playpause'); }, false); stop.addeventlistener('click', function(e) { video.pause(); video.currenttime = 0; progress.value = 0; // update the play/pause button's 'data-state' which allows the correct button image to be set via css changebuttonstate('playpause'); }); mute.addeventlistener('click', function(e) { video.muted = !video.muted; changebuttonstate('mute'); }); you might have noticed that there are new handlers where the play and pause events are reacted to on the video.
...gebuttonstate('playpause'); }); mute.addeventlistener('click', function(e) { video.muted = !video.muted; changebuttonstate('mute'); }); you might have noticed that there are new handlers where the play and pause events are reacted to on the video.
...And 6 more matches
Creating annotations - Archive of obsolete content
ents that the user can annotate, and a panel for the user to enter the annotation text itself.
... bound to it which sends a message to the main add-on code.
...gered the selector checks whether the element is eligible for annotation.
...And 5 more matches
Using third-party modules (jpm) - Archive of obsolete content
the modules included in this package will be somewhere in that directory: my-menuitem index.js node_modules menuitem package.json test we're interested in using the "menuitem" module, which is at "addon-pathfinder/lib/ui/menuitem".
...where in that directory: my-menuitem index.js node_modules menuitem package.json test we're interested in using the "menuitem" module, which is at "addon-pathfinder/lib/ui/menuitem".
... node_modules menuitem package.json test we're interested in using the "menuitem" module, which is at "addon-pathfinder/lib/ui/menuitem".
...And 5 more matches
Forms related code snippets - Archive of obsolete content
ncrmonth.innerhtml = "\u003e"; /* &gt; */ oincryear.innerhtml = "\u00bb"; /* &raquo; */ odecryear.id = sprefs + "-decr-year-" + nid; odecrmonth.id = sprefs + "-decr-month-" + nid; oincrmonth.id = sprefs + "-incr-month-" + nid; oincryear.id = sprefs + "-incr-year-" + nid; odecryear.onmousedown = oincryear.onmousedown = odecrmonth.onmousedown = oincrmonth.onmousedown = onheadclick; for (var nthid = 0; nthid < 7; nthid++) { oth = document.createelement("th"); oth.innerhtml = sdays[nthid]; ohrow.appendchild(oth); } othead.appendchild(ohrow); ocapt.appendchild(odecryear); ocapt.appendchild(odecrmonth); ocapt.appendchild(oincryear); ocapt.appendchild(oincrmonth); ocapt.appendchild(this.display); this.container.appendchild(ocapt); this.co...
... oth.innerhtml = sdays[nthid]; ohrow.appendchild(oth); } othead.appendchild(ohrow); ocapt.appendchild(odecryear); ocapt.appendchild(odecrmonth); ocapt.appendchild(oincryear); ocapt.appendchild(oincrmonth); ocapt.appendchild(this.display); this.container.appendchild(ocapt); this.container.appendchild(othead); this.current.setdate(1); this.writedays(); otarget.onclick = function () { if (otable.parentnode) { otable.parentnode.removechild(otable); return; } otable.style.zindex = nzindex++; otable.style.position = "absolute"; otable.style.left = otarget.offsetleft + "px"; otable.style.top = (otarget.offsettop + otarget.offsetheight) + "px"; otarget.parentnode.insertbefore(otable, otarget); }; ain...
...; niter < ntotal; niter++) { if (niter % 7 === 0) { otr = document.createelement("tr"); this.otbody.appendchild(otr); } nday = niter - nendblanks + 1; otd = document.createelement("td"); if (niter + 1 > nendblanks && niter < nend) { otd.classname = sprefs + "-active-cell"; otd.id = sprefs + "-day-" + this.id + "-" + nday; otd.onclick = ondayclick; otd.appendchild(document.createtextnode(nday)); } else { otd.classname = sprefs + "-empty-cell"; } otr.appendchild(otd); } this.display.innerhtml = smonthsnames[this.current.getmonth()] + " " + this.current.getfullyear(); this.container.appendchild(this.otbody); }; function ondocclick (opssevt) { const oevt = opssevt || /* ie ...
...And 5 more matches
JavaScript Daemons Management - Archive of obsolete content
r); orecompose.play(); }; </script> <style type="text/css"> body { font-family: monospace, sans-serif; background: #dddddd; overflow: hidden; } #perform-me { margin: 50px; font-size: 20px; line-height: 20px; } </style> </head> <body> <h1>new daemon(<em>@thisobject</em>, <em>@callback</em>[, <em>@rate</em>, <em>@length</em>, <em>@init</em>, <em>@onstart</em>])</h1> <p><button onclick="orecompose.skipto(11);">skipto(11)</button> <button onclick="orecompose.makesteps(29);">makesteps(29)</button> <button onclick="orecompose.fixposition(-13);">fixposition(-13)</button> <button onclick="orecompose.play();">play</button> <button onclick="orecompose.turn();">turn</button> <button onclick="orecompose.pause();">pause</button> <button onclick="orecompose.reverseplay();">reverseplay</bu...
...pto(11);">skipto(11)</button> <button onclick="orecompose.makesteps(29);">makesteps(29)</button> <button onclick="orecompose.fixposition(-13);">fixposition(-13)</button> <button onclick="orecompose.play();">play</button> <button onclick="orecompose.turn();">turn</button> <button onclick="orecompose.pause();">pause</button> <button onclick="orecompose.reverseplay();">reverseplay</button> <button onclick="orecompose.reversals = 2;alert('changed');">two reversals</button> <button onclick="orecompose.makeloop();alert('changed');">makeloop</button> <button onclick="orecompose.unmakeloop();alert('changed');">unmakeloop</button> <button onclick="orecompose.close();">close</button> <button onclick="orecompose.reclose();">reclose</button><br /> frame rate: <input type="text" id="vello" value="33" style=...
... = function () { ounhide.owner.target.id = "animate-me"; document.body.appendchild(ounhide.owner.target); ounhide.play(); }; </script> <style type="text/css"> body { font-family: monospace, sans-serif; background: #dddddd; overflow: hidden; } #animate-me { margin: 50px; font-size: 20px; line-height: 20px; } </style> </head> <body> <h1>daemon.buildaround()</h1> <p><button onclick="ounhide.skipto(11);">skipto(11)</button> <button onclick="ounhide.makesteps(29);">makesteps(29)</button> <button onclick="ounhide.fixposition(-13);">fixposition(-13)</button> <button onclick="ounhide.play();">play</button> <button onclick="ounhide.turn();">turn</button> <button onclick="ounhide.pause();">pause</button> <button onclick="ounhide.reverseplay();">reverseplay</button> <button onclick...
...And 5 more matches
Appendix C: Avoiding using eval in Add-ons - Archive of obsolete content
ozen or sealed, then creating a proxy around the object might be a viable approach.
...ragment throughout the rest of this section.
...real events has the added bonus that all other event listeners for that element (and the corresponding bubbling/capturing chain) will fire as well, so this method will have the closed resemblance to a real user event.
...And 5 more matches
Panels - Archive of obsolete content
rome://global/skin" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <button label="details" type="panel"> <panel id="search-panel"> <label control="name" value="name:"/> <textbox id="name"/> </panel> </button> </window> many panels will be associated with a button, as in this example.
...automatic behaviour which opens the popup when pressed.
...e used to control the placement of the popup.
...And 5 more matches
Adding Event Handlers - Archive of obsolete content
the most common event used is the 'command' event.
...n the example we display an alert containing the target's tag name.
...y an alert containing the target's tag name.
...And 5 more matches
menupopup - Archive of obsolete content
pup is open, it floats above the window and may extend outside the window border.
...set to "menu" to create a popup that will open when the menu or button is pressed.
...> <menupopup> <menuitem label="mozilla" value="http://mozilla.org"/> <menuitem label="slashdot" value="http://slashdot.org"/> <menuitem label="sourceforge" value="http://sf.net"/> <menuitem label="freshmeat" value="http://freshmeat.net"/> </menupopup> </menulist> the following example shows how a menupopup can be used as a context menu for an element.
...And 5 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
y want to create a variable that starts at 0, then increments by one every second using a constant loop.
...create this example without using a date() object, like we've done in our version, but less accurate — you can't guarantee that the callback will fire after exactly 1000ms.
...utions regardless of how long the code takes to execute, and you won't get errors.
...And 5 more matches
Image gallery - Learn web development
utton> that is used to control the darkening effect.
...y images inside the thumb-bar <div> (so-called "thumbnail" images) to 20%, and floats them to the left so they sit next to one another on a line.
...he left so they sit next to one another on a line.
...And 5 more matches
Website security - Learn web development
new page is loaded.
...icious user who knows that a particular site allows logged-in users to send money to a specified account using an http post request that includes the account name and an amount of money.
...n http post request will be sent to the server containing the transaction details and any client-side cookies that the browser associated with the site (adding associated site cookies to requests is normal browser behavior).
...And 5 more matches
Web Replay
e recording.
...only), go to devtools settings and select "enable webreplay".
...'s features can only be used in a tab that is recording or replaying.
...And 5 more matches
Accessibility Inspector - Firefox Developer Tools
wser performance.
...hen first implemented, the accessibility engine had to be explicitly turned on.
...ence devtools.accessibility.enabled to false.
...And 5 more matches
EventListener - Web APIs
ventlistener accepts both a function and an object with a handleevent() property function.
...mple below.
... any properties.
...And 5 more matches
Recording a media element - Web APIs
rticle using the mediastream recording api demonstrates using the mediarecorder interface to capture a mediastream generated by a hardware device, as returned by navigator.mediadevices.getusermedia(), you can also use an html media element (namely <audio> or <video>) as the source of the mediastream to be recorded.
...re a mediastream generated by a hardware device, as returned by navigator.mediadevices.getusermedia(), you can also use an html media element (namely <audio> or <video>) as the source of the mediastream to be recorded.
...the stop() function simply stops the input media: function stop(stream) { stream.gettracks().foreach(track => track.stop()); } this works by calling mediastream.gettracks(), using foreach() to call mediastreamtrack.stop() on each track in the stream.
...And 5 more matches
Using the MediaStream Recording API - Web APIs
inset 0 3px 4px rgba(0,0,0,0.7); background-color: rgba(0,0,0,0.1); height: calc(100% - 240px - 0.7rem); overflow: scroll; } note: calc() has good support across modern browsers too, even going back to internet explorer 9.
... has good support across modern browsers too, even going back to internet explorer 9.
... which abuses the fact that you can click on the <label> of a checkbox to toggle it checked/unchecked.
...And 5 more matches
Capabilities, constraints, and settings - Web APIs
h media constraints by editing the source code describing the constraint sets for audio and video tracks.
...ding both what the stream looks like and what the actual media settings are set to after applying the new constraints.
...at the complete example by clicking here.
...And 5 more matches
Using the Screen Capture API - Web APIs
splaymediaoptions contains the mediastreamconstraints to pass into getdisplaymedia(); here, the cursor property is set to always, indicating that the mouse cursor should always be included in the captured media.
...st videoelem = document.getelementbyid("video"); const logelem = document.getelementbyid("log"); const startelem = document.getelementbyid("start"); const stopelem = document.getelementbyid("stop"); // options for getdisplaymedia() var displaymediaoptions = { video: { cursor: "always" }, audio: false }; // set event listeners for the start and stop buttons startelem.addeventlistener("click", function(evt) { startcapture(); }, false); stopelem.addeventlistener("click", function(evt) { stopcapture(); }, false); logging content to make logging of errors and other issues easy, this example overrides certain console methods to output their messages to the <pre> block whose id is log.
...html += `<span class="info">${msg}</span><br>`; this allows us to use the familiar console.log(), console.error(), and so on to log information to the log box in the document.
...And 5 more matches
Simple color animation - Web APIs
« previousnext » a very basic color animation created using webgl, performed by clearing the drawing buffer with a different random color every second.
...mation created using webgl, performed by clearing the drawing buffer with a different random color every second.
...in a timer event handler.
...And 5 more matches
Using DTMF with WebRTC - Web APIs
r dtmf digits, telephony tones, and telephony signals.
...ony signals.
...tring = "12024561111"; let callerpc = null; let receiverpc = null; let dtmfsender = null; let hasaddtrack = false; let mediaconstraints = { audio: true, video: false }; let offeroptions = { offertoreceiveaudio: 1, offertoreceivevideo: 0 }; let dialbutton = null; let logelement = null; these are, in order: dialstring the dtmf string the caller will send when the "dial" button is clicked.
...And 5 more matches
Inputs and input sources - Web APIs
ed environment.
... and so on to provide additional input sources for both targeting and selection.
...abase from the webxr input profiles registry.
...And 5 more matches
ARIA: switch role - Accessibility
false.
... false.
...e the aria-readonly attribute is supported by the switch role.
...And 5 more matches
<menu> - HTML: Hypertext Markup Language
Web › HTML › Element › menu
the html <menu> element represents a group of commands that a user can perform or activate.
...flow content describing available commands.
...ow content describing the available commands and options.
...And 5 more matches
Working with Events - Archive of obsolete content
the add-on sdk supports event-driven programming.
...ent, you can define your own events and use them to communicate between the main add-on code and the content scripts.
... and its argument will be the name of the event: var ui = require("sdk/ui"); var panels = require("sdk/panel"); var self = require("sdk/self"); var panel = panels.panel({ contenturl: self.data.url("panel.html") }); panel.on("*", function(e) { console.log("event " + e + " was emitted"); }); var button = ui.actionbutton({ id: "my-button", label: "my button", icon: "./icon-16.png", onclick: handleclick }); function handleclick(state) { panel.show({ position: button }); } this wildcard feature does not yet work for the tabs or windows modules.
...And 4 more matches
Getting Started with Firefox Extensions - Archive of obsolete content
ones in complexity, so you should go through this tutorial before giving them a try.
...on.
...it.
...And 4 more matches
Tabbed browser - Archive of obsolete content
dfixup, postdata, referrerurl ) the following code will open a url in a new tab, an existing tab, or an existing window based on which mouse button was pressed and which hotkeys (ex: ctrl) are being held.
...errerurl ) the following code will open a url in a new tab, an existing tab, or an existing window based on which mouse button was pressed and which hotkeys (ex: ctrl) are being held.
...ing code will open a url in a new tab, an existing tab, or an existing window based on which mouse button was pressed and which hotkeys (ex: ctrl) are being held.
...And 4 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
note this article is the version from 2003 with slight modifications (no images and no links to samples).
...mple demonstrating that the inner-browsing model can be used to dynamically request new data from the server side and provide updates to the ticker.
...tate.
...And 4 more matches
Scroll Bars - Archive of obsolete content
you can slide back and forth.) the value ranges from 0 to the value of maxpos.
... the maximum position of the scroll bar thumb.
...meric value and does not have a unit.
...And 4 more matches
label - Archive of obsolete content
Archive › Mozilla › XUL › label
« xul reference home [ examples | attributes | properties | methods | related ] this element is used to provide a label for a control element.
...l value="email address" control="email"/> <textbox id="email"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
...an <a> link) will have no effect.
...And 4 more matches
scale - Archive of obsolete content
Archive › Mozilla › XUL › scale
increment and decrement the value by one unit, or the page up and page down keys to increment and decrement the value by one page, as specified by the pageincrement attribute.
... the element, leave this attribute out entirely.
... and scale) attribute changes when the arrows are clicked(or scales are dragged).
...And 4 more matches
What will your website look like? - Learn web development
abstract role in addressing how users will experience and interact with the website.
...color to choose a color, go to the color picker and find a color you like.
... a color you like.
...And 4 more matches
A first splash into JavaScript - Learn web development
lastresult.textcontent = 'wrong!'; lastresult.style.backgroundcolor = 'red'; if(userguess < randomnumber) { loworhi.textcontent = 'last guess was too low!' ; } else if(userguess > randomnumber) { loworhi.textcontent = 'last guess was too high!'; } } guesscount++; guessfield.value = ''; } guesssubmit.addeventlistener('click', checkguess); function setgameover() { guessfield.disabled = true; guesssubmit.disabled = true; resetbutton = document.createelement('button'); resetbutton.textcontent = 'start new game'; document.body.append(resetbutton); resetbutton.addeventlistener('click', resetgame); } function resetgame() { guesscount = 1; const resetparas = doc...
...lue out of the form text field and focus it again, ready for the next guess to be entered.
...pen in the browser — a button being clicked, a page loading, a video playing, etc.
...And 4 more matches
React interactivity: Editing, filtering, conditional rendering - Learn web development
ompleted(props.id)} /> <label classname="todo-label" htmlfor={props.id}> {props.name} </label> </div> <div classname="btn-group"> <button type="button" classname="btn"> edit <span classname="visually-hidden">{props.name}</span> </button> <button type="button" classname="btn btn__danger" onclick={() => props.deletetask(props.id)} > delete <span classname="visually-hidden">{props.name}</span> </button> </div> </div> ); we've now got the two different template structures — "edit" and "view" — defined inside two separate constants.
...t button toggle this in the next section!
...ture interactive.
...And 4 more matches
Accessible Toolkit Checklist
and refocuses the previously focused on the parent window.
...wrap, not have invisible items in tab order dynamically added items must not corrupt the tab cycle or make it disorderly tab cycle must be identical backwards and forwards the f6 and shift+f6 key combinations should cycle through panes in a window making focus visible on any widget, and focus must always be visible shift+f10 or context menu key should work like right click on focused item, and context menu should show just under and to the right of the current focus.
...ng focus visible on any widget, and focus must always be visible shift+f10 or context menu key should work like right click on focused item, and context menu should show just under and to the right of the current focus.
...And 4 more matches
Frequently Asked Questions for Lightweight themes
o?
...olors.
...n install a theme and transform the look of your firefox web browser.
...And 4 more matches
mozbrowsercontextmenu
pe of event.
... cancelable read only boolean whether the event is cancellable or not.
... properties: clientx the x value of the coordinate that was clicked inside the browser <iframe>'s viewport.
...And 4 more matches
Localizing with Pontoon
o localize projects, from first sign-in to finalizing your contributions.
...-of-context, or a combination of the two.
...oon's in-context translation mode is what puts it above others.
...And 4 more matches
Basics
mathml basics this document illustrates some basic mathml constructions.
... the symbol font.
...u might get lost trying to locate a mathml fragment with the usual view source.
...And 4 more matches
Add to iPhoto
es as a demonstration of how to use js-ctypes to call mac os x carbon, core foundation, and other system frameworks from an extension written entirely in javascript.
...g have been declared, we can write the core of the extension itself.
...t listener to it that will be called when the context menu is displayed.
...And 4 more matches
Introduction to DOM Inspector - Firefox Developer Tools
ndows that are open, so to inspect the dom of a particular window in the dom inspector, simply access that window as you would normally and then choose its title from this dynamically updated menulist.
...ay close it, but you will not be able to observe any of the visual consequences of your actions.
...zed rules from that style sheet in order.
...And 4 more matches
Tutorial: Show Allocations Per Call Path - Firefox Developer Tools
in the scratchpad, ensure that no text is selected, and press the "run" button.
...hat no text is selected, and press the "run" button.
... div.appendchild(spanfactory('span #' + i)); document.body.appendchild(div); } } function dodivsandspans() { divsandspans(); } </script> open the browser console (menu button > developer > browser console), and then evaluate the expression demotrackallocations() in the browser console.
...And 4 more matches
Console messages - Firefox Developer Tools
pt to see timestamps by selecting show timestamps in the console settings menu (gear icon in the console toolbar).
... http request method.
...ly from those for synchronous functions.
...And 4 more matches
NotificationAction - Web APIs
note: this feature is available in web workers.
...with notifications.
...ame of the action, which can be used to identify the clicked action similar to input names.
...And 4 more matches
SVGRectElement - Web APIs
to the rx attribute of the given <rect> element.
... to the ry attribute of the given <rect> element.
...tribute of the given <rect> element.
...And 4 more matches
Taking still photos with WebRTC - Web APIs
ght to the code on github if you like.
... that after the page is done loading.
...dth, and the width at which we're going to render it, width.
...And 4 more matches
<input type="image"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › image
ontext that is an ancestor of the current one, and has no parent).
...url as parameters, for example ?x=52&y=55.
...me is prefixed on every attribute, so if the name is position, then the returned coordinates would be formatted in the url as ?position.x=52&position.y=55.
...And 4 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
Web › HTML › Element › input
e pair of fruit=cherry and the dirname / direction pair of fruit.dir=ltr to be sent.
... controls based on their ui features, also known as ui pseudo-classes.
...the <input> element: pseudo-class description :enabled any currently enabled element that can be activated (selected, clicked on, typed into, etc.) or accept focus and also has a disabled state, in which it can't be activated or accept focus.
...And 4 more matches
HTML documentation index - HTML: Hypertext Markup Language
Web › HTML › Index
<br>: the line break element element, html, html text-level semantics, reference, web the html <br> element produces a line break in text (carriage-return).
...ilable, depending on the device and user agent.
...recise value, however, is not considered important.
...And 4 more matches
Communicating using "port" - Archive of obsolete content
each time a content script is attached to a page, the worker associated with the page is supplied to the page-mod in its onattach function.
...ted with the page is supplied to the page-mod in its onattach function.
...t.stoppropagation();" + " event.preventdefault();" + "}, false);" + "self.port.on('warning', function(message) {" + "window.alert(message);" + "});" var pagemod = require('sdk/page-mod').pagemod({ include: ['*'], contentscript: pagemodscript, onattach: function(worker) { worker.port.on('click', function(html) { worker.port.emit('warning', 'do not click this again'); }); } }); in the add-on above there are two user-defined messages: click is sent from the page-mod to the add-on, when the user clicks an element in the page warning sends a silly string back to the page-mod port.emit() the port.emit() function sends a message from the "main.js", or another add-on modu...
...And 3 more matches
Display a Popup - Archive of obsolete content
to display a popup dialog, use the panel module.
...ry, and loading the "get-text.js" script // into it.
...ng the "get-text.js" script // into it.
...And 3 more matches
Modifying the Page Hosted by a Tab - Archive of obsolete content
tutorial you'll need to have learned the basics of jpm.
...-tab", label: "style tab", icon: "./icon-16.png", onclick: function() { require("sdk/tabs").activetab.attach({ contentscript: 'document.body.style.border = "5px solid red";' }); } }); to run this example, save an icon file named "icon-16.png" in add-on's "data" directory.
...con-16.png" in add-on's "data" directory.
...And 3 more matches
Displaying web content in an extension without security issues - Archive of obsolete content
lugins.
...; frame.docshell.allowmetaredirects = false; frame.docshell.allowplugins = false; frame.docshell.allowsubframes = false; but what about interactivity, for example if you want a certain reaction to mouse clicks?
...ell.allowmetaredirects = false; frame.docshell.allowplugins = false; frame.docshell.allowsubframes = false; but what about interactivity, for example if you want a certain reaction to mouse clicks?
...And 3 more matches
Interaction between privileged and non-privileged pages - Archive of obsolete content
; element.dispatchevent(evt); this code creates an arbitrary element -- <myextensiondataelement/> -- and inserts it into the web page's dom.
... this code creates an arbitrary element -- <myextensiondataelement/> -- and inserts it into the web page's dom.
... document.head.appendchild(request); var event = document.createevent("htmlevents"); event.initevent("something-query", true, false); request.dispatchevent(event); }, callback: function(response) { return alert("response: " + (response ?
...And 3 more matches
Adding Toolbars and Toolbar Buttons - Archive of obsolete content
tside of the window element.
... this to true, unless you have strong reasons not to want users changing your toolbar.
...s.
...And 3 more matches
Setting Up a Development Environment - Archive of obsolete content
line of the build process.
...place "make" with "make clean" for the clean command.
...es komodo to use bash, which for some reason can't be set properly as the default command shell.
...And 3 more matches
Tamarin build documentation - Archive of obsolete content
n (also works with helios).
...ios).
...t is to have the indexer track the currently selected build config (so the correct conditional compiles are highlighted in the editor).
...And 3 more matches
Menus - Archive of obsolete content
menus a menu provides a list of commands that the user can carry out.
... menus a menu provides a list of commands that the user can carry out.
...sed for commands that apply to the entire application.
...And 3 more matches
Adding Event Handlers to XBL-defined Elements - Archive of obsolete content
« previousnext » next, we'll find out how to add event handlers to xbl-defined elements.
...nt as usual.
...e action taken for a particular event specified by its event attribute.
...And 3 more matches
XUL accessibility guidelines - Archive of obsolete content
yboard planning faq and cross reference.
...mbinations and cross platform issues.
...key faq.
...And 3 more matches
splitter - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] an element which should appear before or after an element inside a container.
...zed.
...r has some styling associated with it.
...And 3 more matches
Adobe Flash - Archive of obsolete content
in a form field can be transferred to a flash animation (the grey text box below).
... element.
...nment that contains the flash animation -- in this case, the html page.
...And 3 more matches
Displaying notifications (deprecated) - Archive of obsolete content
fox 4.
... now!"); this returns a new notification object, but does not actually display the notification.
...gure the event listeners before the notification is shown, if you need to be notified when the notification is dismissed.
...And 3 more matches
Basic native form controls - Learn web development
required to set its name and value attributes.
...on or checkboxes generally being the content of the <legend>.
...pty elements; their displayed content is inserted inside the value attribute, and therefore only accepts plain text as content.
...And 3 more matches
Looping code - Learn web development
height; function random(number) { return math.floor(math.random()*number); } function draw() { ctx.clearrect(0,0,width,height); for (let i = 0; i < 100; i++) { ctx.beginpath(); ctx.fillstyle = 'rgba(255,0,0,0.5)'; ctx.arc(random(width), random(height), random(50), 0, 2 * math.pi); ctx.fill(); } } btn.addeventlistener('click',draw); </script> </body> </html> you don't have to understand all the code for now, but let's look at the part of the code that actually draws the 100 circles: for (let i = 0; i < 100; i++) { ctx.beginpath(); ctx.fillstyle = 'rgba(255,0,0,0.5)'; ctx.arc(random(width), random(height), random(50), 0, 2 * math.pi); ctx.fill(); } random(x), defined earlier in the code, return...
...for="search">search by contact name: </label> <input id="search" type="text"> <button>search</button> <p></p> now on to the javascript: const contacts = ['chris:2232322', 'sarah:3453456', 'bill:7654322', 'mary:9998769', 'dianne:9384975']; const para = document.queryselector('p'); const input = document.queryselector('input'); const btn = document.queryselector('button'); btn.addeventlistener('click', function() { let searchname = input.value.tolowercase(); input.value = ''; input.focus(); for (let i = 0; i < contacts.length; i++) { let splitcontact = contacts[i].split(':'); if (splitcontact[0].tolowercase() === searchname) { para.textcontent = splitcontact[0] + '\'s number is ' + splitcontact[1] + '.'; break; } else { para.textcontent = 'contact not fou...
...search by contact name: </label> <input id="search" type="text"> <button>search</button> <p></p> <script> const contacts = ['chris:2232322', 'sarah:3453456', 'bill:7654322', 'mary:9998769', 'dianne:9384975']; const para = document.queryselector('p'); const input = document.queryselector('input'); const btn = document.queryselector('button'); btn.addeventlistener('click', function() { let searchname = input.value.tolowercase(); input.value = ''; input.focus(); for (let i = 0; i < contacts.length; i++) { let splitcontact = contacts[i].split(':'); if (splitcontact[0].tolowercase() === searchname) { para.textcontent = splitcontact[0] + '\'s number is ' + splitcontact[1] + '.'; break; } else if (i =...
...And 3 more matches
Getting started with Svelte - Learn web development
} </style> we are applying a style to our <h1> element.
...y top level variable in a component.
... like so: <script> export let name; function togglename() { if (name === 'world') { name = 'svelte' } else { name = 'world' } } </script> <main> <h1>hello {name}!</h1> <button on:click={togglename}>toggle name</button> <p>visit the <a href="https://svelte.dev/tutorial">svelte tutorial</a> to learn how to build svelte apps.</p> </main> whenever the button is clicked, svelte executes the togglename() function, which in turn updates the value of the name variable.
...And 3 more matches
Focus management with Vue refs - Learn web development
to the element that you want to access, with a string identifier for the value of the attribute.
...adding a ref to our app so, let's attach a ref to our "edit" button in todoitem.vue.
... focusoneditbutton() { this.$nexttick(() => { const editbuttonref = this.$refs.editbutton; editbuttonref.focus(); }); } now when you activate the "edit" button and then cancel or save your changes via the keyboard, focus should be returned to the "edit" button.
...And 3 more matches
Implementing feature detection - Learn web development
se a dedicated feature detection library however, as it makes things much easier.
...however, as it makes things much easier.
...ure detection libraries is modernizr, and it can detect just about everything you'll ever need.
...And 3 more matches
Tracking Protection
etimes users won’t notice at all, if the page grid works such that other page elements slide in to fill holes left by blocked elements.
...ccess console output using the remote debugger.
...information about the currently loaded page.
...And 3 more matches
Reporting a Performance Problem
this article will guide you in reporting a performance problem using the built-in gecko profiler tool.
... this article will guide you in reporting a performance problem using the built-in gecko profiler tool.
...fox 75+.
...And 3 more matches
A guide to searching crash reports
criteria: crash signature, date, platform, product, version, etc.
...p right of any page in crash-stats.
...nally a list of bugs that have been marked as relating to this signature.
...And 3 more matches
How to embed the JavaScript engine
ructions at spidermonkey build documentation.
...valuearray is not defined.
...4] pass arguments length and the 'jsval *' pointer.
...And 3 more matches
DevTools API - Firefox Developer Tools
implementation.
... in the tooldefintion object, do // build: (window, target) => new mypanel(window, target), function mypanel(window, target) { // the window object that has loaded the url defined in the tooldefinition this.window = window; // the target this toolbox is debugging.
...target; // do synchronous initialization here.
...And 3 more matches
Edit CSS filters - Firefox Developer Tools
css filter properties in the rules view have a circular gray and white swatch next to them: clicking the swatch opens a filter editor: the filter editor lists each of the effects performed by that filter on a separate line.
... the swatch opens a filter editor: the filter editor lists each of the effects performed by that filter on a separate line.
...ffect, enter the settings you want and then press enter to update the effect.
...And 3 more matches
Page inspector keyboard shortcuts - Firefox Developer Tools
command windows macos linux inspect element ctrl + shift + c cmd + shift + c ctrl + shift + c node picker these shortcuts work while the node picker is active.
... command windows macos linux inspect element ctrl + shift + c cmd + shift + c ctrl + shift + c node picker these shortcuts work while the node picker is active.
... command windows macos linux inspect element ctrl + shift + c cmd + shift + c ctrl + shift + c node picker these shortcuts work while the node picker is active.
...And 3 more matches
Waterfall - Firefox Developer Tools
s the marker's duration and some more information that's specific to the marker type.
... gc events are labeled "(non-incremental)".
...is high enough that spidermonkey may run out of memory during incremental gc when the waterfall records a gc marker it indicates: whether the gc was incremental or not the reason the gc was performed if the gc was non-incremental, the reason it was non-incremental starting in firefox 46, if the gc event was caused by allocation pressure, a link appears, labeled "show allocation triggers".
...And 3 more matches
The JavaScript input interpreter - Firefox Developer Tools
your input does not appear to be complete when you press enter, then the console treats this as shift+enter , enabling you to finish your input.
...ne mode for multi-line entry, click the "split pane" icon at the right hand side of the single-line entry field, or press ctrl+b (windows/linux) or cmd+b (macos).
...nippet is echoed under the input prompt (in the right-side pane), followed by the result.
...And 3 more matches
Document - Web APIs
Web › API › Document
playing.
...teration an eventhandler called when an animationiteration event has been sent, indicating that a css animation has begun playing a new iteration of the animation sequence.
...sed.
...And 3 more matches
GlobalEventHandlers - Web APIs
playing.
...teration an eventhandler called when an animationiteration event has been sent, indicating that a css animation has begun playing a new iteration of the animation sequence.
...sed.
...And 3 more matches
Working with the History API - Web APIs
ple of pushstate() method suppose http://mozilla.org/foo.html executes the following javascript: let stateobj = { foo: "bar", } history.pushstate(stateobj, "page 2", "bar.html") this will cause the url bar to display http://mozilla.org/bar.html, but won't cause the browser to load bar.html or even check that bar.html exists.
...n't cause the browser to load bar.html or even check that bar.html exists.
...ce again, the url will change to http://mozilla.org/foo.html, and the document will get a popstate event, this time with a null state object.
...And 3 more matches
Notification - Web APIs
notification.image read only the url of an image to be displayed as part of the notification, as specified in the constructor's options parameter.
...ings.
...tamp read only specifies the time at which a notification is created or applicable (past, present, or future).
...And 3 more matches
NotificationEvent - Web APIs
the parameter passed into the onnotificationclick handler, the notificationevent interface represents a notification click event that is dispatched on the serviceworkerglobalscope of a serviceworker.
...ion click event that is dispatched on the serviceworkerglobalscope of a serviceworker.
...tendableevent interface.
...And 3 more matches
Using the Notifications API - Web APIs
ecifically grant that application permission to present notifications, thereby letting the user control which apps/sites are allowed to display notifications.
...n, which looks like this: notification.requestpermission(); the callback version optionally accepts a callback function that is called once the user has responded to the request to display permissions.
...n.
...And 3 more matches
Pointer Lock API - Web APIs
how far mouse movement can go in a single direction, and removes the cursor from view.
...or viewing maps or satellite imagery.
...y of the browser or screen.
...And 3 more matches
SVGCircleElement - Web APIs
element.r read only this property defines the radius of the <circle> element.
....r read only this property defines the radius of the <circle> element.
...cle> element.
...And 3 more matches
WebGLRenderingContext.makeXRCompatible() - Web APIs
p graphics, switching to vr mode, and so forth looks like this: const outputcanvas = document.queryselector(".output-canvas"); const gl = outputcanvas.getcontext("webgl"); let xrsession = null; let usingxr = false; let currentscene = "scene1"; let glstartbutton; let xrstartbutton; window.addeventlistener("load", (event) => { loadsceneresources(currentscene); glstartbutton.addeventlistener("click", handlestartbuttonclick); xrstartbutton.addeventlistener("click", handlestartbuttonclick); }); outputcanvas.addeventlistener("webglcontextlost", (event) => { /* the context has been lost but can be restored */ event.canceled = true; }); /* when the gl context is reconnected, reload the resources for the current scene.
... case aborterror: showsimplemessagebox("unable to transfer the game to your xr headset.", "cancel"); break; case invalidstateerror: showsimplemessagebox("you don't appear to have a compatible xr headset available.", "cancel"); break; default: handlefatalerror(err); break; } xrsession.end(); } } async function handlestartbuttonclick(event) { if (event.target.classlist.contains("use-webxr") && navigator.xr) { try { xrsession = await navigator.xr.requestsession("immersive-vr"); usingxr = true; } catch(err) { xrsession = null; usingxr = false; } } startgame(); } function startgame() { currentscene = "scene1"; loadsceneresources(currentscene); /* and so on */ } this works by ha...
...sion("immersive-vr"); usingxr = true; } catch(err) { xrsession = null; usingxr = false; } } startgame(); } function startgame() { currentscene = "scene1"; loadsceneresources(currentscene); /* and so on */ } this works by having two buttons, one which starts the game normally and the other which starts the game in vr mode.
...And 3 more matches
Hello vertex attributes - Web APIs
« previousnext » this webgl example demonstrates how to combine shader programming and user interaction by sending user input to the shader using vertex attributes.
...programparameter(program, gl.link_status)) { var linkerrlog = gl.getprograminfolog(program); cleanup(); document.queryselector("p").innerhtml = "shader program did not link successfully.
...s)) { var linkerrlog = gl.getprograminfolog(program); cleanup(); document.queryselector("p").innerhtml = "shader program did not link successfully.
...And 3 more matches
Web Audio API best practices - Web APIs
"more intuitive, declarative interface to web audio".
...not be allowed to automatically play audio; they should instead be started by a user.
...e really annoying and obtrusive.
...And 3 more matches
XRSystem - Web APIs
Web › API › XRSystem
available using the ondevicechange event handler.
...the ondevicechange event handler.
... examples the following example shows how to use both issessionsupported() and requestsession().
...And 3 more matches
Keyboard - Accessibility
3, etc.).
...logical order of the page.
...x values.
...And 3 more matches
Operable - Accessibility
the link purpose is ambiguous to all users (see ambiguous to users in general for a useful explanation of this).
...ose is ambiguous to all users (see ambiguous to users in general for a useful explanation of this).
...us to all users (see ambiguous to users in general for a useful explanation of this).
...And 3 more matches
-moz-image-rect - CSS: Cascading Style Sheets
le-image property to use parts of an image as the bullets in lists.
...round-image: -moz-image-rect(url(https://mdn.mozillademos.org/files/12053/firefox.png), 50%, 50%, 100%, 0%); width:133px; height:136px; position:absolute; } #box4 { background-image: -moz-image-rect(url(https://mdn.mozillademos.org/files/12053/firefox.png), 50%, 100%, 100%, 50%); width:133px; height:136px; position:absolute; } html the html is quite simple: <div id="container" onclick="rotate()"> <div id="box1" style="left:0px;top:0px;">top left</div> <div id="box2" style="left:133px;top:0px;">top right</div> <div id="box3" style="left:0px;top:136px;">bottom left</div> <div id="box4" style="left:133px;top:136px;">bottom right</div> </div> this places the four segments of our image in a two-by-two box grid.
...:0px;top:0px;">top left</div> <div id="box2" style="left:133px;top:0px;">top right</div> <div id="box3" style="left:0px;top:136px;">bottom left</div> <div id="box4" style="left:133px;top:136px;">bottom right</div> </div> this places the four segments of our image in a two-by-two box grid.
...And 3 more matches
Writing forward-compatible websites - Developer guides
released.
...utes with “window.” when an event handler content attribute (onclick, onmouseover, and so forth) is used on html element, all name lookup in the attribute first happens on the element itself, then on the element's form if the element is a form control, then on the document, and then on the window (where the global variables you have defined are).
... an event handler content attribute (onclick, onmouseover, and so forth) is used on html element, all name lookup in the attribute first happens on the element itself, then on the element's form if the element is a form control, then on the document, and then on the window (where the global variables you have defined are).
...And 3 more matches
<input type="radio"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › radio
dividual radio button within the group.
...oup when the above form is submitted with a radio button selected, the form's data includes an entry in the form contact=value.
...act" value="phone"> <label for="contactchoice2">phone</label> <input type="radio" id="contactchoice3" name="contact" value="mail"> <label for="contactchoice3">mail</label> </div> <div> <button type="submit">submit</button> </div> </form> <pre id="log"> </pre> then we add some javascript to set up an event listener on the submit event, which is sent when the user clicks the "submit" button: var form = document.queryselector("form"); var log = document.queryselector("#log"); form.addeventlistener("submit", function(event) { var data = new formdata(form); var output = ""; for (const entry of data) { output = output + entry[0] + "=" + entry[1] + "\r"; }; log.innertext = output; event.preventdefault(); }, false); try this example out and see how ...
...And 3 more matches
contextmenu - HTML: Hypertext Markup Language
the contextmenu attribute is obsolete and will be removed from all browsers the contextmenu global attribute is the id of a <menu> to use as the contextual menu for this element.
... is the id of a <menu> to use as the contextual menu for this element.
... context menu is a menu that appears upon user interaction, such as a right-click.
...And 3 more matches
Add to Home screen - Progressive web apps (PWAs)
ler like the one below to handle the installation: window.addeventlistener('beforeinstallprompt', (e) => { // prevent chrome 67 and earlier from automatically showing the prompt e.preventdefault(); // stash the event so it can be triggered later.
... deferredprompt = null; }); }); }); so here we: call event.preventdefault() to stop chrome 67 and earlier from calling the install prompt automatically (this behavior changed in chrome 68).
...dprompt = null; }); }); }); so here we: call event.preventdefault() to stop chrome 67 and earlier from calling the install prompt automatically (this behavior changed in chrome 68).
...And 3 more matches
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
otifications let's start with notifications — they can work without push, but are very useful when combined with them.
...ombined with them.
...=== 'granted') { randomnotification(); } }); }); this shows a popup using the operating system’s own notifications service: when the user confirms to receive notifications, the app can then show them.
...And 3 more matches
Communicating With Other Scripts - Archive of obsolete content
reverse.
... contentscriptfile: data.url("listen.js") }); the web page "talk.html" embeds a script that uses window.postmessage() to send the content script a message when the user clicks a button: <!doctype html> <html> <head></head> <body> <script> function sendmessage() { window.postmessage("message from page script", "http://my-domain.org/"); } </script> <button onclick="sendmessage()">send message</button> </body> </html> finally, the content script "listen.js" uses window.addeventlistener() to listen for messages from the page script: // listen.js window.addeventlistener('message', function(event) { console.log(event.data); // message from page script console.log(event.origin); }, false); using postmessage() before firefox 31 if your add-on is r...
... <meta charset="utf-8"> </head> <body> <input id="message" type="button" value="send a message"/> <script type="text/javascript" src="page-script.js"></script> </body> </html> the content script "content-script.js" adds an event listener to the button, that sends a custom event containing a message: var messenger = document.getelementbyid("message"); messenger.addeventlistener("click", sendcustomevent, false); function sendcustomevent() { var greeting = {"greeting" : "hello world"}; var event = document.createevent('customevent'); event.initcustomevent("addon-message", true, true, greeting); document.documentelement.dispatchevent(event); } finally, the page script "page-script.js" listens for the message and logs the greeting to the web console: window.addeventlist...
...And 2 more matches
notifications - Archive of obsolete content
display transient, toaster-style desktop messages to the user.
...cations on windows, os x using growl (and notification center as of os x 10.9 mavericks), and linux using libnotify.
... : object optional options: name type title string a string to display as the message's title.
...And 2 more matches
ui/frame - Archive of obsolete content
eive such messages in the frame script, listen for the window's message event: window.addeventlistener("message", handlepong, false); sending json in all cases, you can send a string as a message or a json object.
...ntlistener("message", handlepong, false); sending json in all cases, you can send a string as a message or a json object.
...ack to this particular frame instance.
...And 2 more matches
Tree - Archive of obsolete content
e tree item from the focused row assuming <tree id="my-tree">, you can use the following to get the tree item: var view = document.getelementbyid("my-tree").view; var sel = view.selection.currentindex; //returns -1 if the tree is not focused var treeitem = view.getitematindex(sel); note that the current index may be unselected (for example, a multi-select tree).
...y-tree">, you can use the following to get the tree item: var view = document.getelementbyid("my-tree").view; var sel = view.selection.currentindex; //returns -1 if the tree is not focused var treeitem = view.getitematindex(sel); note that the current index may be unselected (for example, a multi-select tree).
....
...And 2 more matches
Installing Extensions and Themes From Web Pages - Archive of obsolete content
ef, iconurl: aevent.target.getattribute("iconurl"), hash: aevent.target.getattribute("hash"), tostring: function () { return this.url; } } }; installtrigger.install(params); return false; } //--> </script> <a href="http://www.example.com/foo.xpi" iconurl="http://www.example.com/foo.png" hash="sha1:28857e60d043447c5f4550853f2d40770b326a13" onclick="return install(event);">install extension!</a> let's go through this piece by piece.
...ample.com/foo.png" hash="sha1:28857e60d043447c5f4550853f2d40770b326a13" onclick="return install(event);">install extension!</a> let's go through this piece by piece.
...13" onclick="return install(event);">install extension!</a> let's go through this piece by piece.
...And 2 more matches
Adding Events and Commands - Archive of obsolete content
relevant to them, but there are several events that are implemented for most elements.
... it's very useful because it represents the most common action for input controls such as menu items, buttons and checkboxes.
...presents the most common action for input controls such as menu items, buttons and checkboxes.
...And 2 more matches
Using Breakpoints in Venkman - Archive of obsolete content
the url of a future breakpoint, and has executable code at the specified line, venkman will automatically set a future breakpoint.
...ou can change the values of the variables that venkman displays (only in the context of the debugging environment itself) and see how these changes affect the execution of the code.
...bles that venkman displays (only in the context of the debugging environment itself) and see how these changes affect the execution of the code.
...And 2 more matches
Elements - Archive of obsolete content
mplied phase (capturing|bubbling|target) #implied button (1|2|3) #implied modifiers cdata #implied keycode cdata #implied key cdata #implied charcode cdata #implied clickcount (1|2|3) #implied command id #implied preventdefault false|true #implied > the handler element describes a single event handler.
..., "z".
...tribute is present, then its value must match the charcode field of the dom key event object in order for the handler to fire.
...And 2 more matches
Event Handlers - Archive of obsolete content
ed, the attribute wins.
...vascript body is compiled just before execution; code that does not depend on the context of the event should be factored into normal javascript file.
..., modifier keys can be specified using the modifiers attribute.
...And 2 more matches
A XUL Bestiary - Archive of obsolete content
rdened developers.
...derstand them adequately myself, but here goes a simple explanation of events and of how they are used, basically, in a event-based interface like those created in xul.
...nterface like those created in xul.
...And 2 more matches
Positioning - Archive of obsolete content
ead of their usual placement if there is not enough room to display the menu at full size below or to the right.
...ough room on either side, the menu will be shrunk down to fit.
...arbutton, the position attribute controls how the menupopup is anchored to the parent menu, button or toolbarbutton.
...And 2 more matches
Splitters - Archive of obsolete content
« previousnext » we'll now look at how to add splitters to a window.
...as follows: id the unique identifier of the splitter.
...wn (collapsed) and the other occupying all of the space.
...And 2 more matches
Tabboxes - Archive of obsolete content
« previousnext » it is common in preference dialogs for tabbed pages to appear.
... you have more options than will fit in one screen.
...w <tabbox> <tabs> <tab label="mail"/> <tab label="news"/> </tabs> <tabpanels> <tabpanel id="mailtab"> <checkbox label="automatically check for mail"/> </tabpanel> <tabpanel id="newstab"> <button label="clear news buffer"/> </tabpanel> </tabpanels> </tabbox> here, two tabs have been added, the first labeled 'mail' and the other 'news'.
...And 2 more matches
XUL element attributes - Archive of obsolete content
from the datasource are containers and thus can have child nodes and which ones are not containers.
...s and thus can have child nodes and which ones are not containers.
...tainers.
...And 2 more matches
tooltip - Archive of obsolete content
ial.
...he tooltip being filled automatically as appropriate for a browser content area tooltip, i.e.
...s closed and not visible.
...And 2 more matches
Accessible multimedia - Learn web development
er than just not including the controls attribute in the first place has the advantage that if our javascript fails for any reason, the user still has some controls available.
... to toggle between play and pause with a simple conditional function, like the following.
...bottom, which controls the stop button: stopbtn.onclick = function() { player.pause(); player.currenttime = 0; playpausebtn.textcontent = 'play'; }; there is no stop() function available on htmlmediaelements, so instead we pause() it, and at the same time set the currenttime to 0.
...And 2 more matches
Debugging CSS - Learn web development
malize all of the html, and the dom will also show any changes made by javascript.
...css that is being inherited by the box from its ancestors, in this case to <body>.
...using the problem.
...And 2 more matches
How do you set up a local testing server? - Learn web development
rver on your machine, and the basics of how to use it.
... purposes is to use python's simplehttpserver (or http.server, depending on the version of python installed.) to do this: install python.
...an get an installer from the python homepage and follow the instructions to install it: go to python.org under the download section, click the link for python "3.xxx".
...And 2 more matches
HTML text fundamentals - Learn web development
98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solut...
... 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solut...
... 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solut...
...And 2 more matches
From object to iframe — other embedding technologies - Learn web development
find a video you like.
... body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const output = document.queryselector('.output'); let code = textarea.value; let userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solut...
... if they are trying to maliciously modify your webpage, or trick people into doing something they don't want to do, such as reveal sensitive information like usernames and passwords.
...And 2 more matches
Functions — reusable blocks of code - Learn web development
tion myfunction() { alert('hello'); } but you can also create a function that doesn't have a name: function() { alert('hello'); } this is called an anonymous function — it has no name!
...on that doesn't have a name: function() { alert('hello'); } this is called an anonymous function — it has no name!
...thing on its own.
...And 2 more matches
Third-party APIs - Learn web development
which to display the marker, and an options object containing an icon property that defines the icon to display at that point.
...d of developer key, for reasons of security and accountability.
...the first 10 (0-9) if the page url parameter is set to 0 (or not included at all — 0 is the default value), the next 10 (10-19) if it is set to 1, and so on.
...And 2 more matches
Arrays - Learn web development
put id="reset" type="button" value="reset"> <input id="solution" type="button" value="show solution"> </div> const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = jssolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solutio...
...— here we're giving you a fake search site, with a search box.
...1y-label">press esc to move focus away from the code area (tab inserts a tab character).</p> <textarea id="code" class="playable-code" style="height: 370px; width: 95%"> const list = document.queryselector('.output ul'); const searchinput = document.queryselector('.output input'); const searchbtn = document.queryselector('.output button'); list.innerhtml = ''; let myhistory = []; searchbtn.onclick = function() { // we will only allow a term to be entered if the search input isn't empty if (searchinput.value !== '') { // number 1 // empty the list so that we don't display duplicate entries // the display is regenerated every time a search term is entered.
...And 2 more matches
Debugging on Windows
tent process, gpu process, etc.
...the same command line.
... example, without the quotes).
...And 2 more matches
Communicating with frame scripts
with your add-on's id.
...d after that you can pass any objects it wants to pass to content as cpows.
...e script messagemanager.addmessagelistener("my-addon@me.org:my-e10s-extension-message", listener); function listener(message) { console.log(message.name); console.log(message.sync); console.log(message.data); console.log(message.target); console.log(message.objects); } so combining this message listener with the message above will give console output somewhat like this, when the user clicks a <div>: "my-addon@me.org:my-e10s-extension-message" false object { details: "they clicked", tag: "div" } <xul:browser anonid="initialbrowser" ...
...And 2 more matches
Fonts for Mozilla's MathML engine
ost of these instructions may as well apply to other web rendering engines.
...9 directory and then inside the otf directory.
...tively good mathml rendering.
...And 2 more matches
about:memory
perhaps someone has asked you to use about:memory to generate "memory reports" so they can investigate a problem you are having.
... file dialog that lets you save the memory reports to a file of your choosing.
...ead on a website, click on the "measure..." button.
...And 2 more matches
nsIDOMXULElement
dom/interfaces/xul/nsidomxulelement.idlscriptable represents a xul element within the dom.
...lement.
...ooltiptext domstring gets/sets the value of the element's tooltiptext attribute.
...And 2 more matches
nsIFrameLoader
); void activateremoteframe(); void destroy(); void loadframe(); void loaduri(in nsiuri auri); void sendcrossprocesskeyevent(in astring atype, in long akeycode, in long acharcode, in long amodifiers, [optional] in boolean apreventdefault); void sendcrossprocessmouseevent(in astring atype, in float ax, in float ay, in long abutton, in long aclickcount, in long amodifiers, [optional] in boolean aignorerootscrollframe); void updatepositionandsize(in nsiframe aiframe); native code only!
...efault whether or not to prevent default actions from being performed.
...s equivalent for cross-process event handling.
...And 2 more matches
nsINavHistoryResultViewObserver
; parameters row the row at which the drop occurred.
...r, indicating whether the drop destination is before, on, or after the target row.
...is opened or closed.
...And 2 more matches
nsITaskbarPreviewController
er the controller is connected to an nsitaskbartabpreview or nsitaskbarwindowpreview, only certain methods and attributes need to be implemented.
...y attached to a canvas element.
...ill equal the thumbnailaspectratio, within the margin of rounding errors.
...And 2 more matches
Using popup notifications
ve a moment to do so, instead of being forced to deal with them at possibly inconvenient times.
...deal with them at possibly inconvenient times.
...", callback: function() { alert("first secondary option selected."); } }, { label: "second secondary option", accesskey: "2", callback: function() { alert("second secondary option selected."); } } ] ); when this notification is presented, and the user clicks on the menu button in the panel, the display looks like this: when the user chooses one of your secondary actions from the drop-down menu, the corresponding callback is invoked.
...And 2 more matches
Flash Activation: Browser Comparison - Plugins
r-site basis.
...power saver peripheral content pause each of the browser vendors has a roadmap about the future of flash and changes to the user experience.
...yed when the site attempts to use flash.
...And 2 more matches
Browser Console - Firefox Developer Tools
tom, a command line interpreter enables you to evaluate javascript expressions.
...service"); var hud = hudservice.getbrowserconsole(); var clearbtn = hud.chromewindow.document.queryselector('.webconsole-clear-console-button'); clearbtn.addeventlistener('mouseover', function() { hud.jsterm.clearoutput(true); }, false); bonus features available for add-on sdk add-ons, the console api is available automatically.
...n'); clearbtn.addeventlistener('mouseover', function() { hud.jsterm.clearoutput(true); }, false); bonus features available for add-on sdk add-ons, the console api is available automatically.
...And 2 more matches
UI Tour - Firefox Developer Tools
the top level sources are organized by origin, and under that they're organized by the directory structure from which they are served.
...log so you can save the file locally.
...o enable/disable it: watch expressions you can add watch expressions in the right pane.
...And 2 more matches
Eyedropper - Firefox Developer Tools
> inspector > default color unit: you can use it in one of two ways: to select a color from the page and copy it to the clipboard to change a color value in the inspector's rules view to a color you've selected from the page copying a color to the clipboard open the eyedropper in one of these two ways: select "eyedropper" under the "web developer" menu open the page inspector tab and click the eyedropper button in its toolbar as you move the mouse around the page you'll see the current color value in the eyedropper change.
...e a color value in the inspector's rules view to a color you've selected from the page copying a color to the clipboard open the eyedropper in one of these two ways: select "eyedropper" under the "web developer" menu open the page inspector tab and click the eyedropper button in its toolbar as you move the mouse around the page you'll see the current color value in the eyedropper change.
...r" under the "web developer" menu open the page inspector tab and click the eyedropper button in its toolbar as you move the mouse around the page you'll see the current color value in the eyedropper change.
...And 2 more matches
Basic operations - Firefox Developer Tools
opening the memory tool before firefox 50, the memory tool is not enabled by default.
...mory tool is enabled by default.
...on the left: the snapshot will occupy the large pane on the right-hand side.
...And 2 more matches
Network request details - Firefox Developer Tools
the request details pane appears when you click on a network request in the request list.
... the request details pane appears when you click on a network request in the request list.
... firefox 78.
...And 2 more matches
Web Audio Editor - Firefox Developer Tools
love it if you filed them in bugzilla.
...de as the destination.
...ghted and you get a node inspector on the right hand side.
...And 2 more matches
Web Console UI Tour - Firefox Developer Tools
the web console's interface is split into three horizontal sections, detailed in the sections below.
... the web console's interface is split into three horizontal sections, detailed in the sections below.
... the web console's interface is split into three horizontal sections, detailed in the sections below.
...And 2 more matches
Animation.playbackRate - Web APIs
= newrate; value takes a number that can be 0, negative, or positive.
... animation’s playbackrate to 0 effectively pauses the animation (however, its playstate does not necessarily become paused).
...king alice game example, clicking or tapping the bottle causes alice's growing animation (alicechange) to reverse, causing her to shrink: var shrinkalice = function() { alicechange.playbackrate = -1; alicechange.play(); } // on tap or click, alice will shrink.
...And 2 more matches
EffectTiming.fill - Web APIs
Web › API › EffectTiming › fill
as indicate that the box should be centered both vertically and horizontally inside its container.
...r it ends, and so forth.
...element will be rendered in its natural, unaltered condition anytime the animation isn't actively running.
...And 2 more matches
EventTarget.removeEventListener() - Web APIs
will not be triggered by the current actions.
...oked for the event it was registered for after being removed.
...r after being removed.
...And 2 more matches
GlobalEventHandlers.onanimationiteration - Web APIs
; } the animation's keyframes are defined next; they describe an animation which causes the box to migrate from the top-left corner of the container to the bottom-right corner.
...+1); }; this sets up two global variables: box, which references the "box" element that we're animating, and iterationcounter, which is initially zero, which indicates how many iterations of the animation have occurred.
...iterationcounter, which is initially zero, which indicates how many iterations of the animation have occurred.
...And 2 more matches
Using IndexedDB - Web APIs
'(biblioid: ' + value.biblioid + ') ' + value.title + '</li>'); if (value.year != null) list_item.append(' - ' + value.year); if (value.hasownproperty('blob') && typeof value.blob != 'undefined') { var link = $('<a href="' + cursor.key + '">file</a>'); link.on('click', function() { return false; }); link.on('mouseenter', function(evt) { setinviewer(evt.target.getattribute('href')); }); list_item.append(' / '); list_item.append(link); } else { list_item.append(" / no attached file"); } pub_list.append(list_item); }; // move on to the next object...
...(msg) { msg = typeof msg != 'undefined' ?
... $('#msg').html('<span class="action-failure">' + msg + '</span>'); } function resetactionstatus() { console.log("resetactionstatus ..."); $('#msg').empty(); console.log("resetactionstatus done"); } function addeventlisteners() { console.log("addeventlisteners"); $('#register-form-reset').click(function(evt) { resetactionstatus(); }); $('#add-button').click(function(evt) { console.log("add ..."); var title = $('#pub-title').val(); var biblioid = $('#pub-biblioid').val(); if (!title || !biblioid) { displayactionfailure("required field(s) missing"); return; } var year = $('#pub-year').val(); if (year != '') { // better use number.isinteger if the engine has ecmascript 6 if (isna...
...And 2 more matches
MouseEvent.initMouseEvent() - Web APIs
ggering events gives more information about the way to use these.
...e events include: click, mousedown, mouseup, mouseover, mousemove, mouseout.
...as depressed during the event.
...And 2 more matches
NotificationEvent.notification - Web APIs
the notification read-only property of the notificationevent interface returns the instance of the notification that was clicked to fire the event.
... the notification read-only property of the notificationevent interface returns the instance of the notification that was clicked to fire the event.
...erface returns the instance of the notification that was clicked to fire the event.
...And 2 more matches
PaymentRequest.show() - Web APIs
the paymentrequest interface's show() method instructs the user agent to begin the process of showing and handling the user interface for the payment request to the user.
...quires that the payment request's details need to be updated between instantiating the payment interface and the user beginning to interact with it.
...eady been shown for this request (its state is interactive because it is being shown already).
...And 2 more matches
Using the Payment Request API - Web APIs
the following snippet, a merchant page performs this check, and if it returns true updates the checkout button to use paymentrequest instead of legacy web forms.
...), buildshoppingcartdetails()); checkoutbutton.addeventlistener('click', function() { request.show().then(function(paymentresponse) { // handle successful payment }).catch(function(error) { // handle cancelled or failed payment.
....canmakepayment() .then(function(result) { shouldcallpaymentrequest = result; }).catch(function(error) { console.log(error); // the user may have turned off query ability in their privacy settings.
...And 2 more matches
Selection.modify() - Web APIs
Web › API › Selection › modify
o.
...e following space, regardless of the default platform behavior.
...m behavior.
...And 2 more matches
UIEvent.detail - Web APIs
Web › API › UIEvent › detail
the uievent.detail read-only property, when non-zero, provides the current (or next, depending on the event) click count.
... the uievent.detail read-only property, when non-zero, provides the current (or next, depending on the event) click count.
... the uievent.detail read-only property, when non-zero, provides the current (or next, depending on the event) click count.
...And 2 more matches
Raining rectangles - Web APIs
« previousnext » a simple webgl game that demonstrates clearing with solid colors, scissoring, animation, and user interaction.
..., setupanimation, false); var gl, timer, rainingrect, scoredisplay, missesdisplay; function setupanimation (evt) { window.removeeventlistener(evt.type, setupanimation, false); if (!(gl = getrenderingcontext())) return; gl.enable(gl.scissor_test); rainingrect = new rectangle(); timer = settimeout(drawanimation, 17); document.queryselector("canvas") .addeventlistener("click", playerclick, false); var displays = document.queryselectorall("strong"); scoredisplay = displays[0]; missesdisplay = displays[1]; } var score = 0, misses = 0; function drawanimation () { gl.scissor(rainingrect.position[0], rainingrect.position[1], rainingrect.size[0] , rainingrect.size[1]); gl.clear(gl.color_buffer_bit); rainingrect.position[1] -= rainingrect.velocity; if...
...it); rainingrect.position[1] -= rainingrect.velocity; if (rainingrect.position[1] < 0) { misses += 1; missesdisplay.innerhtml = misses; rainingrect = new rectangle(); } // we are using settimeout for animation.
...And 2 more matches
Using the Web Speech API - Web APIs
iri on ios, cortana on windows 10, android speech, etc.
...ed to chrome for desktop and android — chrome has supported it since around version 33 but with prefixed interfaces, so you need to include prefixed versions of them, e.g.
...e default anyway.) recognition.grammars = speechrecognitionlist; recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; starting the speech recognition after grabbing references to the output <div> and the html element (so we can output diagnostic messages and update the app background color later on), we implement an onclick handler so that when the screen is tapped/clicked, the speech recognition service will start.
...And 2 more matches
window.location - Web APIs
Web › API › Window › location
example #4: display the properties of the current url in an alert dialog: function showloc() { var olocation = location, alog = ["property (typeof): value", "location (" + (typeof olocation) + "): " + olocation ]; for (var sprop in olocation){ alog.push(sprop + " (" + (typeof olocation[sprop]) + "): " + (olocation[sprop] || "n/a")); } alert(alog.join("\n")); } // in html: <button onclick="showloc();">show location properties</button> example #5: send a string of data to the server by modifying the search property: function senddata (sdata) { location.search = sdata; } // in html: <button onclick="senddata('some data');">send data</button> the current url with "?some%20data" appended is sent to the server (if no action is taken by the server, the current document is reload...
...cursus.
...tae eros.
...And 2 more matches
Window - Web APIs
Web › API › Window
enthandlers.onbeforeprint called when the print dialog box is opened.
...ent.
...beforeunload an event handler property for before-unload events on the window.
...And 2 more matches
XRSystem: isSessionSupported() - Web APIs
name is one of the following strings.
... the device supports vr mode by checking to see if an immersive-vr session is supported.
...st the vr session and, if successful, set up the session in a method called onsessionstarted(), not shown.
...And 2 more matches
CSS Animations tips and tricks - CSS: Cascading Style Sheets
the element's animation-play-state to "running" again.
...ng" class, which says that the @keyframes named "colorchange" should be used over the course of two seconds to animate the box.
...) a second time!
...And 2 more matches
Box-shadow generator - CSS: Cascading Style Sheets
node.appendchild(pointer); this.pointer = pointer; setmousetracking(node, updateslider.bind(this)); sliders[topic] = this; setvalue(topic, this.value); } var setbuttoncomponent = function setbuttoncomponent(node) { var type = node.getattribute('data-type'); var topic = node.getattribute('data-topic'); if (type === "sub") { node.textcontent = '-'; node.addeventlistener("click", function() { decrement(topic); }); } if (type === "add") { node.textcontent = '+'; node.addeventlistener("click", function() { increment(topic); }); } } var setinputcomponent = function setinputcomponent(node) { var topic = node.getattribute('data-topic'); var unit_type = node.getattribute('data-unit'); var input = document.createelement('input'); var unit...
...ar setinputcomponent = function setinputcomponent(node) { var topic = node.getattribute('data-topic'); var unit_type = node.getattribute('data-unit'); var input = document.createelement('input'); var unit = document.createelement('span'); unit.textcontent = unit_type; input.setattribute('type', 'text'); node.appendchild(input); node.appendchild(unit); input.addeventlistener('click', function(e) { this.select(); }); input.addeventlistener('change', function(e) { setvalue(topic, e.target.value | 0); }); subscribe(topic, function(value) { node.children[0].value = value; }); } var increment = function increment(topic) { var slider = sliders[topic]; if (slider === null || slider === undefined) return; if (slider.value + slider.step <= slider.ma...
... action = node.getattribute('data-action'); title = title === null ?
...And 2 more matches
Cross-browser audio basics - Developer guides
> </audio> <!-- custom play and pause buttons --> <button id="play">play</button> <button id="pause">pause</button> next, we attach some functionality to the player using javascript: window.onload = function(){ var myaudio = document.getelementbyid('my-audio'); var play = document.getelementbyid('play'); var pause = document.getelementbyid('pause'); // associate functions with the 'onclick' events play.onclick = playaudio; pause.onclick = pauseaudio; function playaudio() { myaudio.play(); } function pauseaudio() { myaudio.pause(); } } media loading events above we have shown how you can create a very simple audio player, but what if we want to show progress, buffering and only activate the buttons when the media is ready to play?
...splaycontrols() { loading.style.display = "none"; play.style.display = "block"; } // check that the media is ready before displaying the controls if (myaudio.paused) { displaycontrols(); } else { // not ready yet - wait for canplay event myaudio.addeventlistener('canplay', function() { displaycontrols(); }); } play.addeventlistener('click', function() { myaudio.play(); play.style.display = "none"; pause.style.display = "block"; }); pause.addeventlistener('click', function() { myaudio.pause(); pause.style.display = "none"; play.style.display = "block"; }); // display progress myaudio.addeventlistener('timeupdate', function() { //sets the percentage bar.style.width = ...
...ing using the seek bar this is a good start, but it would be nice to be able to navigate the audio using the progress bar.
...And 2 more matches
<label> - HTML: Hypertext Markup Language
Web › HTML › Element › label
ith an <input> element offers some major advantages: the label text is not only visually associated with its corresponding text input; it is programmatically associated with it too.
...nest the <input> directly inside the <label>, in which case the for and id attributes are not needed because the association is implicit: <label>do you like peas?
... attributes are not needed because the association is implicit: <label>do you like peas?
...And 2 more matches
<template>: The Content Template element - HTML: Hypertext Markup Language
Web › HTML › Element › template
th two new rows appended to it via javascript: table { background: #000; } table td { background: #fff; } avoiding documentfragment pitfall a documentfragment is not a valid target for various events, as such it is often preferable to clone or refer to the elements within it.
...tfragment is not a valid target for various events, as such it is often preferable to clone or refer to the elements within it.
... for various events, as such it is often preferable to clone or refer to the elements within it.
...And 2 more matches
begin - SVG: Scalable Vector Graphics
Web › SVG › Attribute › begin
t's animation should begin.
...mation should begin.
...uld begin.
...And 2 more matches
end - SVG: Scalable Vector Graphics
Web › SVG › Attribute › end
ment's animation should end.
...animation should end.
...should end.
...And 2 more matches
Types of attacks - Web security
this article describes various types of security attacks and techniques to mitigate them.
... this article describes various types of security attacks and techniques to mitigate them.
... this article describes various types of security attacks and techniques to mitigate them.
...And 2 more matches
XUL Migration Guide - Archive of obsolete content
eforwardbutton() { var window = require("sdk/window/utils").getmostrecentbrowserwindow(); var forward = window.document.getelementbyid('forward-button'); var parent = window.document.getelementbyid('urlbar-container'); parent.removechild(forward); } require("sdk/ui/button/action").actionbutton({ id: "remove-forward-button", label: "remove forward button", icon: "./icon-16.png", onclick: removeforwardbutton }); there are more useful examples of this technique in the jetpack wiki's collection of third party modules.
...uire("sdk/tabs/utils").getactivetab(window); if (tab.style.getpropertyvalue('background-color')) { tab.style.setproperty('background-color','','important'); } else { tab.style.setproperty('background-color','rgb(255,255,100)','important'); } } require("sdk/ui/button/action").actionbutton({ id: "highlight-active-tab", label: "highlight active tab", icon: "./icon-16.png", onclick: highlightactivetab }); security implications the sdk implements a security model in which an add-on only gets to access the apis it explicitly imports via require().
... use to load and access any xpcom object.
...org/embedcomp/prompt-service;1"].
ui - Archive of obsolete content
lbar, and sidebar ui objects.
...its own reference page, linked above: for all the details please refer to the reference page.
...the details please refer to the reference page.
...te) { console.log("you clicked '" + state.label + "'"); } }); you can make a button standalone or add it to a toolbar.
List Open Tabs - Archive of obsolete content
to follow this tutorial you'll need to have learned the basics of jpm.
... to follow this tutorial you'll need to have learned the basics of jpm.
...: "list-tabs", label: "list tabs", icon: "./icon-16.png", onclick: listtabs }); function listtabs() { var tabs = require("sdk/tabs"); for (let tab of tabs) console.log(tab.url); } note: to get this working, you will need to save an icon for the button to your add-on's "data" directory as "icon-16.png".
.../about/ info: http://www.bbc.co.uk/ you don't get direct access to any content hosted in the tab.
Dialogs and Prompts - Archive of obsolete content
dialog, process those arguments in the dialog, and return user-modified arguments to the caller.
... code to open a dialog named mydialog.xul and pass it arguments: var params = {inn:{name:"foo", description:"bar", enabled:true}, out:null}; window.opendialog("chrome://myext/content/mydialog.xul", "", "chrome, dialog, modal, resizable=yes", params).focus(); if (params.out) { // user clicked ok.
...alog.js: // called once when the dialog displays function onload() { // use the arguments passed to us by the caller document.getelementbyid("name").value = window.arguments[0].inn.name; document.getelementbyid("description").value = window.arguments[0].inn.description; document.getelementbyid("enabled").checked = window.arguments[0].inn.enabled; } // called once if and only if the user clicks ok function onok() { // return the changed arguments.
...guments passed to us by the caller document.getelementbyid("name").value = window.arguments[0].inn.name; document.getelementbyid("description").value = window.arguments[0].inn.description; document.getelementbyid("enabled").checked = window.arguments[0].inn.enabled; } // called once if and only if the user clicks ok function onok() { // return the changed arguments.
Offering a context menu for form controls - Archive of obsolete content
firefox 3 changed the behavior of right-click on form controls to no longer display a context menu by default.
...tent the first thing to do is to establish an overlay over the chrome for the window in which you want to allow context menus on form controls.
... in which you want to allow context menus on form controls.
...f (this.istargetaformcontrol(anode)) this.shoulddisplay = true; }; }, false); this code, which is run when the window is opened up, works by replacing the settarget() routine for the prototype of nscontextmenu with one that forces the context menu to display if the target of the menu is a form control.
Custom XUL Elements with XBL - Archive of obsolete content
ht after they are created and inserted to the document.
...due to some asynchronous operation related to node insertion.
... node insertion.
...not including the content tag, and then just add the methods and properties you wish to override.
Handling Preferences - Archive of obsolete content
m as you please.
...rence windows it's very common for extensions to have a few settings that their users can change to tailor them to their needs.
...ystems where the instant apply rule is not used.
...s not used.
The Box Model - Archive of obsolete content
rences window.
... it was cut.
...need to restrict the width using css.
...is way, but string bundles won't do anything special with it.
User Notifications and Alerts - Archive of obsolete content
evel, to prevent the user from getting used to dismissing high-level notifications.
...t the user from getting used to dismissing high-level notifications.
...so, clicking on any of your custom buttons will cause the notification to be immediately closed, so you should only use notification boxes for single-step processes.
....getstring("xulschoolhello.greeting.title"); let message = this._bundle.getstring("xulschoolhello.greeting.label"); alertsservice.showalertnotification( "chrome://xulschoolhello/skin/hello-notification.png", title, message, true, "", this, "xulschool hello message"); we pass this as an argument, assuming that this is an object that implements nsiobserver.
Signing an extension - Archive of obsolete content
you're working on mac and you've already got a valid certificate from ca.
...on.
...efox, export it by following the steps below.
...y installed to firefox.
Creating a Microsummary - Archive of obsolete content
o contains basic functions for manipulating those nodes and their content.
...b page that calls firefox's window.sidebar.addmicrosummarygenerator() method to download and install the generator.
....mozilla.com/~myk/micro...-generator.xml, and we wanted users to be able to install it from http://people.mozilla.com/~myk/micro...ial/index.html, we might add the following code to the index.html page: <button onclick="window.sidebar.addmicrosummarygenerator('http://people.mozilla.com/~myk/microsummaries/tutorial/sfx-generator.xml')">install the spread firefox home page microsummary!</button> clicking that button will generate a javascript error on browsers that don't support microsummaries, however, so to improve the experience for those users, we should check to see if the user is using a microsummaries-enabled browser and display an explanatory message if not.
...ng code: <script> const warning = "sorry, you need a microsummary-enabled browser like firefox 2.0 to install and use microsummary generators."; function addgenerator(url) { if (typeof window.sidebar == "object" && typeof window.sidebar.addmicrosummarygenerator == "function") window.sidebar.addmicrosummarygenerator(url); else alert(warning); } </script> <button onclick="addgenerator('http://people.mozilla.com/~myk/microsummaries/tutorial/sfx-generator.xml')">install the spread firefox home page microsummary!</button> note that due to bug 341283, addmicrosummarygenerator() will not accept a relative url.
In-Depth - Archive of obsolete content
that you've got everything extracted and you know how to modify items, you might be wondering, how do i know where everything is?
...aller again.
...rowser window.
...ll be xul:toolbarbutton.
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
32,371" href="#open"> <area alt="(4)" coords="90,384,127,417" href="#openuri-innards"> <area alt="(0) registercontentlistener()" coords="37,474,346,474,346,505,88,505,88,535,37,535" href="#registercontentlistener" shape="poly"> <area alt="(3) openuri() (nsuriloader)" coords="5,207,312,269" href="#openuri"> <area alt="(2)" coords="102,114,139,148" href="#internalload"> <area alt="(1) loaduri/onlinkclick" coords="77,5,449,59" href="#loaduri"> <area alt="nsiexternalhelperappservice" coords="527,305,839,339" href="#nsiexternalhelperappservice"> <area alt="category manager" coords="683,467,807,527" href="#nscategorymanager"> <area alt="nsdocumentopeninfo" coords="371,71,635,185" href="#nsdocumentopeninfo"> <area alt="necko" coords="721,113,821,157" href="#necko"> <area alt="nsuriloader" coords="23,3...
...n the diagram are still accurate.
...urrent page), and session history issues.
...hands off to nsuriloader::openchannel.
slideBar - Archive of obsolete content
s of browsers.
...functiononreadyfunction)this is a list of options to specify modifications to your slidebar instance.
... a list of options to specify modifications to your slidebar instance.
... of the content area and the selected slide sizeint persistdefault slide behavior when being selectedbool autoreloadautomatically reload content on selectbool onclickcallback when the icon is clickedfunction onselectcallback when the feature is selectedfunction onreadycallback when featured is loadedfunction an example: jetpack.slidebar.append({ url: "http://mozilla.com", width: 150, onclick: function(slide){ slide.icon.src = "chrome://branding/content/icon48.png"; }}); ...
Proxy UI - Archive of obsolete content
products firefox menu: preferences > advanced tab > networking tab > connection button.
...list of proxy types that require a hostname and a port number.
...stname and a port number.
...uttons: ( ) socks v4 ( ) socks v5 "no proxy for:" discussed in detail elsewhere...
Tamarin Build System Documentation - Archive of obsolete content
n appears in the buildbot status page, please describe what you are trying to build and test after submitting a sandbox build view the build status page or the queue (if buildbot is busy) how do i view and change the queue?
...ceptance-release.sh <optional hg revision number like 1902> how do i navigate the build status page?
... page is divided into the phase table at the top and the waterfall table below the phase table shows all phases at the top of the page, each slave is shown as a box with a red,green, or yellow color: red means failed, green passed, and yellow has warnings.
...idual box to display the test result below the phase table the waterfall displays each buildstep and result the left side contains the time column and the user/revision link to represent the revision triggering a build, mouse over the user to see the revision and submission notes each buildstep run on a slave is a box with color indicating status, red is failed, green passed, yellow has warnings click the stdio link to see the output click on the build yellow box at the bottom of a set of buildsteps to see the result of all of the buildsteps for a build and the time each buildstep took scroll down to see previous builds triggered at the bottom of the page click on the [next page] link to display more previous builds what are the goals of the build system (qos)?
Introduction to XUL - Archive of obsolete content
xul file, so script is just mixed in with the other content, delimited by a script element in the html namespace.
...hanges of state between widgets.
...this document.
... { display: block; width: 100%; height: 100%; } for example, the above style rule would apply to the main window and dictates that the window should consume the full width and height available to it in a content area.
PopupEvents - Archive of obsolete content
tems on the popup based on the context.
...e popupshowing event just before a popup is about to be displayed, a popupshowing event will fired on the popup.
...ill fired on the popup.
...puphiding event when a popup is closed, the popuphiding event is fired on the popup just before it is removed from the screen.
Custom toolbar button - Archive of obsolete content
e.
... the name of the saved file is: button-1.png explanation: the image is in four parts.
...cking it).
...the application's extension manager window.
Using the Editor from XUL - Archive of obsolete content
et content.
...space, delete, enter/return).
...ndles the drop by inserting data in dragdrop.
...istener this is an odd-man-out event listener, in that it's registered from the editorshell, rather than internally to the editor.
arrowscrollbox - Archive of obsolete content
ies | methods | related ] a box which provides scroll arrows along its edges for scrolling through the contents of the box.
...es, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortdirection, sortresource, sortresource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width clicktoscroll type: boolean clicktoscroll, if true, the arrows must be clicked to scroll the scrollbox content.
... and sets the value of the disabled attribute.
...ative value to scroll backward that many lines.
colorpicker - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a palette of colors from which a user may select by clicking on one of the grid cells.
...type: integer the tab order of the element.
...sabled attribute.
...x, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related interfaces nsidomxulcontrolelement bugs the onchange event only fires if attribute type is set to "button".
scrollbar - Archive of obsolete content
butes | properties | methods | related ] when a container's contents which are larger that the size of the container, scroll bars may be placed at the side of the container to allow the user to scroll around in the container.
...ageincrement examples <scrollbar curpos="5" maxpos="50"/> attributes curpos type: integer the current position of the scrollbar, which ranges from 0 to the value of the maxpos attribute.
...ber boxes and scale) attribute changes when the arrows are clicked(or scales are dragged).
... , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
textbox - Archive of obsolete content
eld with multiple rows.
... code.
...f this attribute is not specified, word wrapping is enabled.
... return type: no return value sets the selected portion of the textbox, where the start argument is the index of the first character to select and the end argument is the index of the character after the selection.
Gecko Compatibility Handbook - Archive of obsolete content
ng these browsers is that if you're only detecting netscape or netscape6 you'll see the issues right away.
...all the user agent switcher extension.
...pecify quirks mode layout via the doctype.
...yout instead.
2006-11-22 - Archive of obsolete content
ccessibility - nov 17-nov 22, 2006 announcements mozilla osk project grant aaron leventhal (on behalf of michael curran) mentiond that there is now an nvda email list you can join if you wish to keep up to date with the latest changes, or if you wish to discuss new features or talk with other nvda users.
...d that there is now an nvda email list you can join if you wish to keep up to date with the latest changes, or if you wish to discuss new features or talk with other nvda users.
...mail address) michael would like to thank stormdragon for setting this up.
...if anyone has experience with these issues, and is comfortable helping out in the mozilla/accessible module, would you please take a look at https://bugzilla.mozilla.org/show_bug.cgi?id=166994 he stated that he almost had it working a couple of years ago.
2D maze game with device orientation - Game development
s showing the progress on the screen.
...rtbutton.input.usehandcursor = true; }, startgame: function() { this.game.state.start('howto'); } }; to create a new button there's add.button method with the following list of optional arguments: top absolute position on canvas in pixels.
...te position on canvas in pixels.
...rmation on how to play the game.
Mobile accessibility - Learn web development
global options relating to the device as a whole, and the latter provides options relating just to the current app/screen you are in.
...testing on ios, see test accessibility on your device with voiceover.
...ur css and javascript accessibility article, we looked at the idea of events that are specific to a certain type of control mechanism (see mouse-specific events).
...n is consequently known as a "hamburger menu".
WAI-ARIA basics - Learn web development
to take a copy of aria-no-live.html and quotes.json, and update your <section> tag as follows: <section aria-live="assertive"> this will cause a screenreader to read out the content as it is updated.
...l accessibility article, and enhancing keyboard accessibility, above).
...s as buttons.
...sing phrases like "click me!, group", which is obviously confusing.
Styling links - Learn web development
e :visited pseudo class.
... illustrates what a link will behave like by default (the css is simply enlarging and centering the text to make it stand out more.) <p><a href="#">a simple link</a></p> p { font-size: 2rem; text-align: center; } note: all the links in the examples in this page are fake links — a # (hash, or pound sign) is put in place of the real url.
...link makes the mouse pointer change to a little hand icon.
....value; var csscode = cssinput.value; var output = document.queryselector(".output"); var solution = document.getelementbyid("solution"); var styleelem = document.createelement('style'); var headelem = document.queryselector('head'); headelem.appendchild(styleelem); function drawoutput() { output.innerhtml = htmlinput.value; styleelem.textcontent = cssinput.value; } reset.addeventlistener("click", function() { htmlinput.value = htmlcode; cssinput.value = csscode; drawoutput(); }); solution.addeventlistener("click", function() { htmlinput.value = htmlcode; cssinput.value = 'p {\n font-size: 1.2rem;\n font-family: sans-serif;\n line-height: 1.4;\n}\n\na {\n outline: none;\n text-decoration: none;\n padding: 2px 1px 0;\n}\n\na:link {\n color: #265301;\n}\n\na:visited {\n ...
How do I use GitHub Pages? - Learn web development
-site when the command line is pointing inside your website directory, type the following command, which tells the git tool to turn the directory into a git repository: git init an aside on command line interfaces the best way to upload your code to github is via the command line — this is a window where you type in commands to do things like create files and run programs, rather than clicking inside a user interface.
... a terminal with ctrl + alt + t.
...ating a repo for your code next, you need to create a new repo for your files to go in.
...ster now you need to turn github pages on for your repository.
HTML forms in legacy browsers - Learn web development
supported not supported form buttons there are two ways to define buttons within html forms: the <input> element with its attribute type set to the values button, submit, reset or image the <button> element <input> the <input> element can make things a little difficult if you want to apply some css by using the element selector: <input type="button" value="click me"> if we remove the border on all inputs, can we restore the default appearance on input buttons only?
...sest to restoring default rendering, when supported.
...tion.
...t instead of the content of the value attribute when clicked.
How to structure a web form - Learn web development
bel> even in such cases however, it is considered best practice to set the for attribute to ensure all assistive technologies understand the relationship between label and widget.
...or attribute to ensure all assistive technologies understand the relationship between label and widget.
...abel, or if the form control is neither implicitly or explicitly associated with a label, and a screenreader will read out something like "edit text blank", which isn't very helpful at all.
... properly set up labels is that you can click or tap the label to activate the corresponding widget.
Sending forms through JavaScript - Learn web development
request manually.
...eventlistener( 'error', function(event) { alert( 'oops!
...h the formdata object.
... { alert( 'yeah!
Your first form - Learn web development
ility, we include an explicit label for each form control.
...d to add a button to allow the user to send, or "submit", their data once they have filled out the form.
...lement; add the following just above the closing </ul> tag: <li class="button"> <button type="submit">send your message</button> </li> the <button> element also accepts a type attribute — this accepts one of three values: submit, reset, or button.
...tton.
Advanced text formatting - Learn web development
y { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const output = document.queryselector('.output'); const code = textarea.value; const userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solut...
...y { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const output = document.queryselector('.output'); const code = textarea.value; const userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solut...
...y { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const output = document.queryselector('.output'); const code = textarea.value; const userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solut...
... editor.
Getting started with HTML - Learn web development
98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solut...
...ute.
... 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solut...
...100%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solut...
Test your skills: Links - Learn web development
in this task we want you to help fill in the links on our whales information page: the first link should be linked to a page called whales.html, which is in the same directory as the current page.
...cond link should be turned into a link you can click to open up an email in the user's default mail application, with the recipient set as "whales@example.com".
...nt directory.
... page about narwhals, a support email address, and a pdf factfile that is 4mb in size.
TypeScript support in Svelte - Learn web development
has been discontinued.
...n a continuous integration (ci) pipeline.
... replace the content of the filterbutton.svelte file with the following: <!-- components/filterbutton.svelte --> <script lang='ts'> import { filter } from '../types/filter.enum' export let filter: filter = filter.all </script> <div class="filters btn-group stack-exception"> <button class="btn toggle-btn" class:btn__primary={filter === filter.all} aria-pressed={filter === filter.all} on:click={()=> filter = filter.all} > <span class="visually-hidden">show</span> <span>all</span> <span class="visually-hidden">tasks</span> </button> <button class="btn toggle-btn" class:btn__primary={filter === filter.active} aria-pressed={filter === filter.active} on:click={()=> filter = filter.active} > <span class="visually-hidden">show</span> <span>active</span> <span clas...
...btn toggle-btn" class:btn__primary={filter === filter.active} aria-pressed={filter === filter.active} on:click={()=> filter = filter.active} > <span class="visually-hidden">show</span> <span>active</span> <span class="visually-hidden">tasks</span> </button> <button class="btn toggle-btn" class:btn__primary={filter === filter.completed} aria-pressed={filter === filter.completed} on:click={()=> filter = filter.completed} > <span class="visually-hidden">show</span> <span>completed</span> <span class="visually-hidden">tasks</span> </button> </div> here we are just importing the filter enum, and using it instead of the string values we used previously.
Handling common JavaScript problems - Learn web development
examples like this one, which shows a typical pattern of saving a this scope to a separate variable, then using that variable in nested functions so you can be sure you are applying functionality to the correct this scope.
...ows a typical pattern of saving a this scope to a separate variable, then using that variable in nested functions so you can be sure you are applying functionality to the correct this scope.
...ful details pertaining to the current environment — breakpoints, callstack and currently active scopes.
... code was stopped.
Debugging a hang on OS X (Archived)
ation is still hung, open up spin control.app (it’s in your <tt>/developer/applications/performance tools/</tt> folder; if it is missing, install the latest computer hardware understanding development (chud) tools from apple).
... understanding development (chud) tools from apple).
...button; a new window will open with a couple of rows with stacktraces for all the threads in the sampled application.
...en…” button.
HTMLIFrameElement.sendMouseEvent()
not work for every user.
...ver, mouseout, or contextmenu.
...enu.
...ls.
How to get a stacktrace with WinDbg
these four commands, pressing enter after each one.
...rnel32!exitprocess+0x14 this looks wrong to me?!
...n without the "debug child processes also" check box being checked.
...he application again, this time with the check box being checked.
How to Report a Hung Firefox
crashfirefox.exe here (source code).
... any process monitoring tool to find the firefox process id (pid).
...end the crash report to mozilla start firefox.
... this link.
CustomizableUI.jsm
l windows for you.
... parameters aarea the id of the area whose customize target you want to have awindow the window where you want to fetch the dom node.
...ting the element, because otherwise, the icon will not be set as the buttons are added, then we register the listener.
... it needs a 16x16 icon.
Interfacing with the Add-on Repository
the add-on repository javascript code module makes it easy for your extension to interface with the amo repository.
...ns() queries the add-on repository for add-ons matching given search criteria.
... popupnotifications.remove(box); } } }, null /* secondary action */ ); } the code here starts by stashing the passed-in addoninstall object for later use, then creates and displays the pop-up notification box with the text and button label passed into the method.
... here starts by stashing the passed-in addoninstall object for later use, then creates and displays the pop-up notification box with the text and button label passed into the method.
PopupNotifications.jsm
for 30 seconds).
...ation should persist across location changes.
...therwise been dismissed (that is, any time the popup is closed due to user interaction).
...s the url in a new tab.
Localizing with Mercurial
ld\hg to do this.
... /result .
...ich means the current directory.
...orrectly." alternatively, you can edit the %path% variable manually.
McCoy
ccoy https://bugzilla.mozilla.org/show_bug.cgi?id=396525 signing update manifests before you release your add-on in order to verify the update manifests applications need to already have information from you for how to verify it.
...button or select "create key" from the "keys" menu.
... do this is to select the key then click the install toolbar button.
...he key, select \"copy public key\" and then add it to the file as an updatekey entry.
PKCS11 FAQ
Mozilla › Projects › NSS › PKCS11 › FAQ
ession handle of 0 is indeed invalid.
...rt card which has initial pin set at '9999', i insert it into my reader and download with my certificate (keygen completed), can i issue 'change password' from the firefox to set a new pin to the smart card?
...nto my reader and download with my certificate (keygen completed), can i issue 'change password' from the firefox to set a new pin to the smart card?
...ificate (keygen completed), can i issue 'change password' from the firefox to set a new pin to the smart card?
Rhino Debugger
d watch windows are updated to reflect the names and values of the variables visible at that scope.
...aring breakpoints the main desktop of the debugger contains file windows which display the contents of each script you are debugging.
...menu item.
...cted line contains executable code a red dot will appear next to the line number and a breakpoint will be set at that location.
Shumway
e flash player especially when unavoidable patents (such as those surrounding flash drm) get in the way.
...your swf file.
...lems relating to shumway, itself.
...humway into firefox.
Building the WebLock UI
-browsers].
...st: function addthissite() { var tf = document.getelementbyid("dialog.input"); // weblock is global and declared above weblock.addsite(tf.value); } this javascript function can be called directly from the xul widget, where the input string is retrieved as the value property of the textbox element.
...og, so it can use a single declaration to import the "global" skin from the browser and make it available to the widgets you define in weblock.xul.
...lable there.
nsIPromptService
constant value description button_pos_0_default 0 button_pos_1_default 16777216 button_pos_2_default 33554432 button_delay_enable button_delay_enable causes the buttons to be initially disabled.
...nterpret this loosely, as the intent is to ensure that the user does not click through a security dialog too quickly.
...ck.value is now true if the box was checked and false if the box was cleared confirm example confirm displays a dialog with ok/cancel.
...as checked and false if the box was cleared confirm example confirm displays a dialog with ok/cancel.
Troubleshooting XPCOM components registration
le/extensions/$plugindirectory/components!
...code, and then check them again.
...pendency walker, open the options menu and select configure module search order....
..., check for any missing dependencies using file -> open -> firefox.exe (or equivalent).
3D view - Firefox Developer Tools
from firefox 47 onwards, 3d view is no longer available.
... from firefox 47 onwards, 3d view is no longer available.
...m of the page.
...g and dragging the view, you can rotate and re-orient the 3d presentation of the dom hierarchy of your page to see it from different angles, to better examine its structure.
DOM Inspector FAQ - Firefox Developer Tools
earches, and will do partial matching.
...h nodes' tags for "tab", you'll get matches for tabpanel and tabbox as well as tab.
... get matches for tabpanel and tabbox as well as tab.
...he beginning-of-string and end-of-string markers; e.g., searching nodes for "^tab$" will return only nodes whose names are exactly "tab".
Use watchpoints - Firefox Developer Tools
chpoints: get, set, and get or set.
...he debugger user interface, find an object you want to watch, and right-click it to open its context menu.
...oint type (get or set), the debugger pauses, enabling you to see line of code responsible, and to inspect anything else you wish at that time.
... pauses, enabling you to see line of code responsible, and to inspect anything else you wish at that time.
Index - Firefox Developer Tools
e tags and summary 1 firefox developer tools developing mozilla, guide, tools, web development, web development:tools, l10n:priority firefox developer tools is a set of web developer tools built into firefox.
... using the pause button.
...ks and works properly on a range of different devices — particularly mobile phones and tablets as well as desktops and laptops.
...ibrary’s abstraction leaks during debugging sessions when you are forced to step through its stack frames in order to reach your own code.
Dominators view - Firefox Developer Tools
about 21% and 8% of the total size of the memory snapshot, respectively.
...ee all the nodes for which this root is the immediate dominator.
...window dominates a css2properties object, whose retained size is 2% of the total snapshot size.
...n stack" in firefox 46.
CSS Flexbox Inspector: Examine Flexbox layouts - Firefox Developer Tools
ining and modifying them, debugging layout issues, and more.
...ontainer or flex item, the tooltip includes the appropriate information.
...note: the layout view can be found underneath the layout tab on the right-hand pane of the page inspector.
... color picker so you can select a different color for the overlay.
Select an element - Firefox Developer Tools
ng the box model, and a tooltip showing its tag and size: with the context menu to open the inspector and select an element immediately, activate the context menu over the element in the page and select "inspect element": with the html pane when the inspector is open, as you move the mouse around the elements listed in the html pane, the corresponding elements are highlighted in the page.
...ment": with the html pane when the inspector is open, as you move the mouse around the elements listed in the html pane, the corresponding elements are highlighted in the page.
...e highlighted in the page.
... you can also use the arrow keys to move around the dom with the keyboard.
UI Tour - Firefox Developer Tools
e the same as what getcomputedstyle would return.): compatibility view starting with firefox developer edition version 77, the compatibility view shows css compability issues, if any, for properties applied to the selected element, and for the current page as a whole.
... element, and for the current page as a whole.
...r deprecated.
... compatibility" section of the article gives details of browser support for the property.
Settings - Firefox Developer Tools
opening settings beginning with firefox 62, the icon to open developer tools settings has been moved into a menu accessed by clicking/touching ...
... useful if you have a widescreen monitor.
...es the style editor to display the original, preprocessor, sources rather than the generated css.
...or rules view will also provide links to the original sources.
Storage Inspector - Firefox Developer Tools
orage items cannot be shared between them.
...en by object store name: with the cookies, local storage, and session storage types, there's only one level in the hierarchy, so stored items are listed directly under each origin: you can click on each item in the tree to expand or collapse its children.
...rarchy, so stored items are listed directly under each origin: you can click on each item in the tree to expand or collapse its children.
...s storage type will show all the cookies belonging to that domain.
View Source - Firefox Developer Tools
view source lets you look at the html or xml source for the page you're viewing.
...rrors.
...ing the #linennn anchor to the url the browser will jump to the nnn line.
...://www.mozilla.org/#line100 view selection source if you select part of a web page and conext-click, you'll see a context menu item labeled "view selection source", that behaves just like "view page source", except you only see the source for the selection.
Rich output - Firefox Developer Tools
utput for many object types, including the following: object array date promise regexp window document element event examining object properties when an object is logged to the console it has a right-pointing triangle next to it, indicating that it can be expanded.
...ts: starting with firefox 67 (available now in firefox developer) you can use the arrow keys on your keyboard to navigate through objects displayed in the console.
...s.
... object { status: "to do", description: "normalize table", datecreated: 1552404533790 } ​ length: 4 ​ <prototype>: array [] debugger eval code:1:9 undefined highlighting and inspecting dom nodes if you hover the mouse over any dom element in the console output, it's highlighted on the page: in the screenshot above you'll also see a blue "target" icon next to the node in the console output: click it to switch to the inspector with that node selected.
Using dynamic styling information - Web APIs
e</title> <script type="text/javascript"> function alterstyle(elem) { elem.style.background = 'green'; } function resetstyle(elemid) { elem = document.getelementbyid(elemid); elem.style.background = 'white'; } </script> <style type="text/css"> #p1 { border: solid blue 2px; } </style> </head> <body> <!-- passes a reference to the element's object as parameter 'this'.
...t/javascript"> function alterstyle(elem) { elem.style.background = 'green'; } function resetstyle(elemid) { elem = document.getelementbyid(elemid); elem.style.background = 'white'; } </script> <style type="text/css"> #p1 { border: solid blue 2px; } </style> </head> <body> <!-- passes a reference to the element's object as parameter 'this'.
...document.getelementbyid(elemid); elem.style.background = 'white'; } </script> <style type="text/css"> #p1 { border: solid blue 2px; } </style> </head> <body> <!-- passes a reference to the element's object as parameter 'this'.
... <title>style property example</title> <link rel="stylesheet" href="example.css" type="text/css"> <script type="text/javascript"> function stilo() { document.getelementbyid('d').style.color = 'orange'; } function resetstyle() { document.getelementbyid('d').style.color = 'black'; } </script> </head> <body> <div id="d" class="thunder">thunder</div> <button onclick="stilo()">click here to change text color</button> <button onclick="resetstyle()">reset text color</button> </body> </html> the media and type of the style may or may not be given.
Using channel messaging - Web APIs
the <iframe>.
...t.getelementbyid('message-input'); var output = document.getelementbyid('message-output'); var button = document.queryselector('button'); var iframe = document.queryselector('iframe'); var channel = new messagechannel(); var port1 = channel.port1; // wait for the iframe to load iframe.addeventlistener("load", onload); function onload() { // listen for button clicks button.addeventlistener('click', onclick); // listen for messages on port1 port1.onmessage = onmessage; // transfer port2 to the iframe iframe.contentwindow.postmessage('init', '*', [channel.port2]); } // post a message on port1 when the button is clicked function onclick(e) { e.preventdefault(); port1.postmessage(input.value); } // handle messages received on port1 function onmessage(e) { output.innerhtml = ...
...nel.port2]); } // post a message on port1 when the button is clicked function onclick(e) { e.preventdefault(); port1.postmessage(input.value); } // handle messages received on port1 function onmessage(e) { output.innerhtml = e.data; input.value = ''; } we start off by creating a new message channel by using the messagechannel() constructor.
...is initial port transfering this message could be an empty string but in this example it is set to 'init'.
Clients.openWindow() - Web APIs
the openwindow() method of the clients interface creates a new top level browsing context and loads a given url.
...t to open in the window.
... otherwise.
...plicable if (self.notification.permission === 'granted') { const notificationobject = { body: 'click here to view your messages.', data: { url: self.location.origin + '/some/path' }, // data: { url: 'http://example.com' }, }; self.registration.shownotification('you\'ve got messages!', notificationobject); } // notification click event listener self.addeventlistener('notificationclick', e => { // close the notification popout e.notification.close(); // get all the window clients e.waituntil(clients.matchall({ type: 'window' }).then(clientsarr => { // if a window tab matching the targeted url already exists, focus that; const hadwindowtofocus = clientsarr.some(windowclient => windowclient.url === e.notification.data.url ?
Document.cookie - Web APIs
Web › API › Document › cookie
ccessor property with native setter and getter functions, and consequently is not a data property with a value: what you write is not the same as what you read, everything is always mediated by the javascript interpreter.
...unction alertcookie() { alert(document.cookie); } <button onclick="alertcookie()">show cookies</button> example #2: get a sample cookie named test2 document.cookie = "test1=hello"; document.cookie = "test2=world"; const cookievalue = document.cookie .split('; ') .find(row => row.startswith('test2')) .split('=')[1]; function alertcookievalue() { alert(cookievalue); } <button onclick="alertcookievalue()">show cookie value</button> example #3: do something only once in order to use the following code, please replace all occurrences of the word dosomethingonlyonce (the name of the cookie) with a custom name.
... once in order to use the following code, please replace all occurrences of the word dosomethingonlyonce (the name of the cookie) with a custom name.
...d(row => row.startswith('dosomethingonlyonce'))) { alert("do something here!"); document.cookie = "dosomethingonlyonce=true; expires=fri, 31 dec 9999 23:59:59 gmt"; } } <button onclick="doonce()">only do something once</button> example #4: reset the previous cookie function resetonce() { document.cookie = "dosomethingonlyonce=; expires=thu, 01 jan 1970 00:00:00 gmt"; } <button onclick="resetonce()">reset only once cookie</button> example #5: check a cookie existence //es5 if (document.cookie.split(';').some(function(item) { return item.trim().indexof('reader=') == 0 })) { console.log('the cookie "reader" exists (es5)') } //es2016 if (document.cookie.split(';').some((item) => item.trim().startswith('reader='))) { console.log('the cookie "reader" exists (es6)'...
Document.mozSetImageElement() - Web APIs
t); parameters imageelementid is a string indicating the name of an element that has been specified as a background image using the -moz-element css function.
...ck each time the block is clicked by the user.
...ked() { var canvas = document.createelement("canvas"); canvas.setattribute("width", 100); canvas.setattribute("height", 100); var ctx = canvas.getcontext('2d'); ctx.fillstyle = "#" + c.tostring(16) + "0000"; ctx.fillrect(25, 25, 75, 75); c += 0x11; if (c > 0xff) { c = 0x00; } document.mozsetimageelement("canvasbg", canvas); } the code here is called each time the user clicks the <div> element.
...> 0xff) { c = 0x00; } document.mozsetimageelement("canvasbg", canvas); } the code here is called each time the user clicks the <div> element.
Events and the DOM - Web APIs
the three phases of event flow through the dom in the dom level 3 events draft.
...uments) alert('hello world') } this is the method you should use in modern web pages.
...passed the event object via the event parameter.
...le shows how an event object is passed to the event handler function, and can be used from within one such function.
Event.eventPhase - Web APIs
Web › API › Event › eventPhase
r, starting with the parent, and eventually reaching the containing window.
...ng window.
... border: thin black solid; } #divinfo { margin: 18px; padding: 8px; background-color:white; font-size:80%; } javascript let clear = false, divinfo = null, divs = null, usecapture = false; window.onload = function () { divinfo = document.getelementbyid('divinfo') divs = document.getelementsbytagname('div') chcapture = document.getelementbyid('chcapture') chcapture.onclick = function () { removelisteners() addlisteners() } clear() addlisteners() } function removelisteners() { for (let i = 0; i < divs.length; i++) { let d = divs[i] if (d.id != "divinfo") { d.removeeventlistener("click", ondivclick, true) d.removeeventlistener("click", ondivclick, false) } } } function addlisteners() { for (let i = 0; i < divs.length; i++...
... { for (let i = 0; i < divs.length; i++) { let d = divs[i] if (d.id != "divinfo") { d.removeeventlistener("click", ondivclick, true) d.removeeventlistener("click", ondivclick, false) } } } function addlisteners() { for (let i = 0; i < divs.length; i++) { let d = divs[i] if (d.id != "divinfo") { if (chcapture.checked) { d.addeventlistener("click", ondivclick, true) } else { d.addeventlistener("click", ondivclick, false) d.onmousemove = function () { clear = true } } } } } function ondivclick(e) { if (clear) { clear() clear = false } if (e.eventphase == 2) e.currenttarget.style.backgroundcolor = 'red'; let level = e.eventphase == 0 ?
Event.preventDefault() - Web APIs
to propagate as usual, unless one of its event listeners calls stoppropagation() or stopimmediatepropagation(), either of which terminates propagation at once.
...ls stoppropagation() or stopimmediatepropagation(), either of which terminates propagation at once.
...elable event, such as one dispatched via eventtarget.dispatchevent(), without specifying cancelable: true has no effect.
...x is the default action of clicking on a checkbox.
Event.type - Web APIs
Web › API › Event › type
the type read-only property of the event interface returns a string containing the event's type.
...string containing the event's type.
...n the event is constructed and is the name commonly used to refer to the specific event, such as click, load, or error.
...events document.addeventlistener('keydown', geteventtype, false); // first document.addeventlistener('keypress', geteventtype, false); // second document.addeventlistener('keyup', geteventtype, false); // third // mouse events document.addeventlistener('mousedown', geteventtype, false); // first document.addeventlistener('mouseup', geteventtype, false); // second document.addeventlistener('click', geteventtype, false); // third result specifications specification status comment domthe definition of 'event.type' in that specification.
Force Touch events - Web APIs
and is not on a standards track.
...dware) new interactions based on how hard the user clicks or presses down on the touchscreen or trackpad.
...fired before the mousedown event.
...wn, webkitmouseforceup, mousemove, and mouseup event objects: mouseevent.webkitforce read only the amount of pressure currently being applied to the trackpad/touchscreen constants these constants are useful for determining the relative intensity of the pressure indicated by mouseevent.webkitforce: mouseevent.webkit_force_at_mouse_down read only minimum force necessary for a normal click mouseevent.webkit_force_at_force_mouse_down read only minimum force necessary for a force click specifications not part of any specification.
GeolocationCoordinates.longitude - Web APIs
he iers reference meridian, which is located 5.3 arcseconds (102 meters / 335 feet) east of the greenwich meridian.
...splay the resulting coordinates once they're returned.
....latitude; let long = position.coords.longitude; lattext.innertext = lat.tofixed(2); longtext.innertext = long.tofixed(2); }); }); after setting up variables to more conveniently reference the button element and the two elements into which the latitude and logitude will be drawn, the event listener is established by calling addeventlistener() on the <button> element.
...ed(2); longtext.innertext = long.tofixed(2); }); }); after setting up variables to more conveniently reference the button element and the two elements into which the latitude and logitude will be drawn, the event listener is established by calling addeventlistener() on the <button> element.
GlobalEventHandlers.onpointerdown - Web APIs
watch for and act upon pointerdown events using onpointerdown.
...e contents of the target box.
...ust restore the original text into the target box after the user's interaction with the element ends (for example, when they release the mouse button, or when they lift the stylus or finger from the screen).
...ect its functionality at all.
HTMLElement.hidden - Web APIs
syntax ishidden = htmlelement.hidden; htmlelement.hidden = true | false; value a boolean which is true if the element is hidden from view; otherwise, the value is false.
... = true; document.getelementbyid("awesome").hidden = false; }, false); this code sets up a handler for the welcome panel's "ok" button that hides the welcome panel and makes the follow-up panel—with the curious name "awesome"—visible in its place.
...visible in its place.
...shown here.
HTMLInputElement.select() - Web APIs
the htmlinputelement.select() method selects all the text in a <textarea> element or in an <input> element that includes a text field.
... the htmlinputelement.select() method selects all the text in a <textarea> element or in an <input> element that includes a text field.
...) { const input = document.getelementbyid('text-box'); input.focus(); input.select(); } result notes calling element.select() will not necessarily focus the input, so it is often used with htmlelement.focus().
...put.select(); } result notes calling element.select() will not necessarily focus the input, so it is often used with htmlelement.focus().
HTMLInputElement - Web APIs
eckbox as originally specified in html that created this object.
... browsers as to the type of virtual keyboard configuration to use when editing this element or its contents.
...e of virtual keyboard configuration to use when editing this element or its contents.
... available via the onsearch event handler property.
HTMLElement.blur() - Web APIs
the htmlelement.blur() method removes keyboard focus from the current element.
... the htmlelement.blur() method removes keyboard focus from the current element.
... the htmlelement.blur() method removes keyboard focus from the current element.
... the htmlelement.blur() method removes keyboard focus from the current element.
HTMLElement.focus() - Web APIs
scroll (the default) means that the browser will scroll the element into view after focusing it.
...eans that the browser will scroll the element into view after focusing it.
... document.getelementbyid("mytextfield").focus(); } html <input type="text" id="mytextfield" value="text field."> <p></p> <button type="button" onclick="focusmethod()">click me to focus on the text field!</button> result focus on a button javascript focusmethod = function getfocus() { document.getelementbyid("mybutton").focus(); } html <button type="button" id="mybutton">click me!</button> <p></p> <button type="button" onclick="focusmethod()">click me to focus on the button!</button> result focus with focusoption javascript focusscrollmethod = function getfocus() { document.getelementbyid("mybutton").focus({preventscroll:false}); } focusnoscrollmethod = function getfocuswithoutscrolling() { document.getelementbyid("mybutton").focus({preve...
..."focusmethod()">click me to focus on the button!</button> result focus with focusoption javascript focusscrollmethod = function getfocus() { document.getelementbyid("mybutton").focus({preventscroll:false}); } focusnoscrollmethod = function getfocuswithoutscrolling() { document.getelementbyid("mybutton").focus({preventscroll:true}); } html <button type="button" onclick="focusscrollmethod()">click me to focus on the button!</button> <button type="button" onclick="focusnoscrollmethod()">click me to focus on the button without scrolling!</button> <div id="container" style="height: 1000px; width: 1000px;"> <button type="button" id="mybutton" style="margin-top: 500px;">click me!</button> </div> result specification specification status commen...
MediaStreamConstraints.audio - Web APIs
eature policy enabled, the samples below need the microphone feature enabled.
...der: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } javascript content let audioelement = document.getelementbyid("audio"); let logelement = document.getelementbyid("log"); function log(msg) { logelement.innerhtml += msg + "<br>"; } document.getelementbyid("startbutton").addeventlistener("click", function() { navigator.mediadevices.getusermedia({ audio: true }).then(stream => audioelement.srcobject = stream) .catch(err => log(err.name + ": " + err.message)); }, false); here we see an event handler for a click event which uses getusermedia() to obtain an audio-only stream with no specific constraints, then attaches the resulting stream to an <audio> element once the stream i...
...re we see an event handler for a click event which uses getusermedia() to obtain an audio-only stream with no specific constraints, then attaches the resulting stream to an <audio> element once the stream is returned.
...der: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } javascript content let audioelement = document.getelementbyid("audio"); let logelement = document.getelementbyid("log"); function log(msg) { logelement.innerhtml += msg + "<br>"; } document.getelementbyid("startbutton").addeventlistener("click", function() { navigator.mediadevices.getusermedia({ audio: { samplesize: 8, echocancellation: true } }).then(stream => audioelement.srcobject = stream) .catch(err => log(err.name + ": " + err.message)); }, false); here we see an event handler for a click event which calls getusermedia(), specifying a set of audio constraints requesting that echo cancellation be enabl...
MediaStreamConstraints.video - Web APIs
/or required values or ranges of values for the track's constrainable properties.
...der: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } javascript content let videoelement = document.getelementbyid("video"); let logelement = document.getelementbyid("log"); function log(msg) { logelement.innerhtml += msg + "<br>"; } document.getelementbyid("startbutton").addeventlistener("click", function() { navigator.mediadevices.getusermedia({ video: true }).then(stream => videoelement.srcobject = stream) .catch(err => log(err.name + ": " + err.message)); }, false); here we see an event handler for a click event which uses getusermedia() to obtain a video-only stream with no specific constraints, then attaches the resulting stream to a <video> element once the stream i...
...here we see an event handler for a click event which uses getusermedia() to obtain a video-only stream with no specific constraints, then attaches the resulting stream to a <video> element once the stream is returned.
...der: 1px solid black; font-size: 16px; text-align: center; padding-top: 2px; padding-bottom: 4px; color: white; background-color: darkgreen; } javascript content let videoelement = document.getelementbyid("video"); let logelement = document.getelementbyid("log"); function log(msg) { logelement.innerhtml += msg + "<br>"; } document.getelementbyid("startbutton").addeventlistener("click", function() { navigator.mediadevices.getusermedia({ video: { width: 160, height: 120, framerate: 15 } }).then(stream => videoelement.srcobject = stream) .catch(err => log(err.name + ": " + err.message)); }, false); here we see an event handler for a click event which calls getusermedia(), specifying a set of video constraints that indicate a preferenc...
MouseEvent.altKey - Web APIs
Web › API › MouseEvent › altKey
the mouseevent.altkey read-only property is a boolean that indicates whether the alt key was pressed or not when a given mouse event occurs.
... left mouse click combined with the alt key is used to move or resize windows.
...ned with the alt key is used to move or resize windows.
...instanceofmouseevent.altkey return value a boolean, where true indicates that the key is pressed, and false indicates that the key is not pressed.
Notifications API - Web APIs
ms, across different platforms.
... supported platforms, showing a system notification generally involves two things.
...sing the notifications api.
...tion defines a notification object.
Selection.deleteFromDocument() - Web APIs
the deletefromdocument() method of the selection interface deletes the selected text from the document's dom.
... the deletefromdocument() method of the selection interface deletes the selected text from the document's dom.
...rom the document's dom.
...pon clicking the button, the window.getselection() method gets the selected text, and the deletefromdocument() method removes it.
Selection.rangeCount - Web APIs
the selection.rangecount read-only property returns the number of ranges in the selection.
... the selection.rangecount read-only property returns the number of ranges in the selection.
... rangecount is 0.
...after the user clicks on the page, rangecount is 1, even if no selection is visible.
SubtleCrypto.exportKey() - Web APIs
(".exported-key"); exportkeyoutput.textcontent = `[${exportedkeybuffer}]`; } /* generate an encrypt/decrypt secret key, then set up an event listener on the "export" button.
... "export" button.
...port" button.
...d-key"); exportkeyoutput.textcontent = json.stringify(exported, null, " "); } /* generate a sign/verify key pair, then set up an event listener on the "export" button.
A simple RTCDataChannel sample - Web APIs
function startup() { connectbutton = document.getelementbyid('connectbutton'); disconnectbutton = document.getelementbyid('disconnectbutton'); sendbutton = document.getelementbyid('sendbutton'); messageinputbox = document.getelementbyid('message'); receivebox = document.getelementbyid('receivebox'); // set event listeners for user interface widgets connectbutton.addeventlistener('click', connectpeers, false); disconnectbutton.addeventlistener('click', disconnectpeers, false); sendbutton.addeventlistener('click', sendmessage, false); } this is quite straightforward.
...terface widgets connectbutton.addeventlistener('click', connectpeers, false); disconnectbutton.addeventlistener('click', disconnectpeers, false); sendbutton.addeventlistener('click', sendmessage, false); } this is quite straightforward.
...l) { console.log("receive channel's status has changed to " + receivechannel.readystate); } } the handlereceivechannelstatuschange() method receives as an input parameter the event which occurred; this will be an rtcdatachannelevent.
...this method simply performs some basic dom injection; it creates a new <p> (paragraph) element, then creates a new text node containing the message text, which is received in the event's data property.
Controlling multiple parameters with ConstantSourceNode - Web APIs
let's look at the setup() function, which is our handler for the window's load event; it handles all the initialization tasks that require the dom to be in place.
...w.addeventlistener("load", setup, false); first, we get access to the window's audiocontext, stashing the reference in context.
..., a recording stream, or any other destination type.
...nto all of its outputs, which are, as set above, gainnode2 and gainnode3.
Using IIR filters - Web APIs
fer) { const soundsource = audiocontext.createbuffersource(); soundsource.buffer = audiobuffer; soundsource.connect(audiocontext.destination); soundsource.start(); return soundsource; } this function is called when the play button is pressed.
...oundsource.buffer = audiobuffer; soundsource.connect(audiocontext.destination); soundsource.start(); return soundsource; } this function is called when the play button is pressed.
...tlistener('click', function() { if (this.dataset.playing === 'false') { srcnode = playsourcenode(audioctx, sample); ...
... ...
WindowOrWorkerGlobalScope.setInterval() - Web APIs
r oelem = document.getelementbyid('my_box'); oelem.style.color = oelem.style.color == 'red' ?
...px; overflow: auto; font-size: 12px; margin: 4px; border-radius: 5px; /* visibility: hidden; */ } </style> </head> <body> <p id="copyleft" style="font-style: italic; font-size: 12px; text-align: center;">copyleft 2012 by <a href="https://developer.mozilla.org/" target="_blank">mozilla developer network</a></p> <p id="controls" style="text-align: center;">[&nbsp;<span class="intlink" onclick="otwexample1.play();">play</span> | <span class="intlink" onclick="otwexample1.pause();">pause</span> | <span class="intlink" onclick="otwexample1.terminate();">terminate</span>&nbsp;]</p> <div id="info"> vivamus blandit massa ut metus mattis in fringilla lectus imperdiet.
...eased/decreased (depending on the actual direction of the process).
...l page: <!doctype html> <html> <head> <meta charset="utf-8" /> <title>minidaemin example - mdn</title> <script type="text/javascript" src="minidaemon.js"></script> <style type="text/css"> #sample_div { visibility: hidden; } </style> </head> <body> <p> <input type="button" onclick="fadeinout.start(false /* optional */);" value="fade in" /> <input type="button" onclick="fadeinout.start(true);" value="fade out"> <input type="button" onclick="fadeinout.pause();" value="pause" /> </p> <div id="sample_div">some text here</div> <script type="text/javascript"> function opacity (nindex, nlength, bbackwards) { this.style.opacity = nindex / nlength; if (bbackwards ?
XMLHttpRequest: abort event - Web APIs
the abort event is fired when a request has been aborted, for example because the program called xmlhttprequest.abort().
...le because the program called xmlhttprequest.abort().
...lable no interface progressevent event handler property onabort examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrb...
....addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comm...
XMLHttpRequest: error event - Web APIs
the error event is fired when the request encountered an error.
...event is fired when the request encountered an error.
...lable no interface progressevent event handler property onerror examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrb...
....addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comm...
XMLHttpRequest: load event - Web APIs
the load event is fired when an xmlhttprequest transaction completes successfully.
... an xmlhttprequest transaction completes successfully.
...elable no interface progressevent event handler property onload examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrb...
....addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comm...
XMLHttpRequest: loadend event - Web APIs
the loadend event is fired when a request has completed, whether successfully (after load) or unsuccessfully (after abort or error).
...ter load) or unsuccessfully (after abort or error).
...ble no interface progressevent event handler property onloadend examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrb...
....addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comm...
XMLHttpRequest: loadstart event - Web APIs
the loadstart event is fired when a request has started to load data.
...is fired when a request has started to load data.
...e no interface progressevent event handler property onloadstart examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrb...
....addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comm...
XMLHttpRequest: progress event - Web APIs
the progress event is fired periodically when a request receives more data.
...ed periodically when a request receives more data.
...le no interface progressevent event handler property onprogress examples live example html <div class="controls"> <input class="xhr success" type="button" name="xhr" value="click to start xhr (success)" /> <input class="xhr error" type="button" name="xhr" value="click to start xhr (error)" /> <input class="xhr abort" type="button" name="xhr" value="click to start xhr (abort)" /> </div> <textarea readonly class="event-log"></textarea> css .event-log { width: 25rem; height: 4rem; border: 1px solid black; margin: .5rem; padding: .2rem; } input { width: 11rem; margin: .5rem; } js const xhrbuttonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrb...
....addeventlistener('loadend', handleevent); xhr.addeventlistener('progress', handleevent); xhr.addeventlistener('error', handleevent); xhr.addeventlistener('abort', handleevent); } function runxhr(url) { log.textcontent = ''; const xhr = new xmlhttprequest(); addlisteners(xhr); xhr.open("get", url); xhr.send(); return xhr; } xhrbuttonsuccess.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg'); }); xhrbuttonerror.addeventlistener('click', () => { runxhr('https://somewhere.org/i-dont-exist'); }); xhrbuttonabort.addeventlistener('click', () => { runxhr('https://mdn.mozillademos.org/files/16553/dgszyjnxcaipwzy.jpg').abort(); }); result specifications specification status comm...
XRSystem: requestSession() - Web APIs
ode the following example shows how to use both issessionsupported() and requestsession().
... enabling controls for entering xr.
...ls for entering xr.
....xr.issessionsupported('immersive-vr') .then((issupported) => { if (issupported) { immersivebutton.addeventlistener('click', onbuttonclicked); immersivebutton.innerhtml = 'enter xr'; immersivebutton.disabled = false; } else { console.log("webxr doesn't support immersive-vr mode!"); } }); } else { console.log("webxr is not available!"); } function onbuttonclicked() { if (!xrsession) { navigator.xr.requestsession('immersive-vr') .then((session) => { xrsession = session; // onsessionstarted() not shown for reasons of brevity and clarity.
ARIA: checkbox role - Accessibility
the checkbox is checked false the checkbox is not checked mixed the checkbox is partially checked, or indeterminate tabindex="0" used to make it focusable so the assistive technology user can tab to it and start reading right away.
...ked false the checkbox is not checked mixed the checkbox is partially checked, or indeterminate tabindex="0" used to make it focusable so the assistive technology user can tab to it and start reading right away.
...ey to change the state of the checkbox by changing the value of the aria-checked attribute and the appearance of the checkbox so it appears checked or unchecked to the sighted user examples the following example creates a simple checkbox element using css and javascript to handle the checked or unchecked status of the element.
...ppears checked or unchecked to the sighted user examples the following example creates a simple checkbox element using css and javascript to handle the checked or unchecked status of the element.
Using CSS animations - CSS: Cascading Style Sheets
e special aliases: from and to.
...he left margin is set to 0% and the width of the element is set to 100%.
...th: 100%; } } <p>the caterpillar and alice looked at each other for some time in silence: at last the caterpillar took the hookah out of its mouth, and addressed her in a languid, sleepy voice.</p> this tells the browser that 75% of the way through the animation sequence, the header should have its left margin at 25% and the width should be 150%.
...information about the received events: <h1 id="watchme">watch me move</h1> <p> this example shows how to use css animations to make <code>h1</code> elements move across the page.
Getting Started - Developer guides
which contains the text "i'm a test." then we'll alert() the contents of the response.
...echange = alertcontents; httprequest.open('get', 'test.html'); httprequest.send(); } function alertcontents() { if (httprequest.readystate === xmlhttprequest.done) { if (httprequest.status === 200) { alert(httprequest.responsetext); } else { alert('there was a problem with the request.'); } } } })(); </script> in this example: the user clicks the "make a request" button; the event handler calls the makerequest() function; the request is made and then (onreadystatechange) the execution is passed to alertcontents(); alertcontents() checks if the response was received and ok, then alert()s the contents of the test.html file.
...p request we used the request object's responsetext property , which contained the contents of the test.html file.
...er their name: <label>your name: <input type="text" id="ajaxtextbox" /> </label> <span id="ajaxbutton" style="cursor: pointer; text-decoration: underline"> make a request </span> we'll also add a line to our event handler to get the user's data from the text box and send it to the makerequest() function along with the url of our server-side script: document.getelementbyid("ajaxbutton").onclick = function() { var username = document.getelementbyid("ajaxtextbox").value; makerequest('test.php',username); }; we need to modify makerequest() to accept the user data and pass it along to the server.
Printing - Developer guides
n finished if you want to be able to automatically close a popup window (for example, the printer-friendly version of a document) after the user prints its contents, you can use code like this: <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>javascript window close example </title> <script type="text/javascript"> function popuponclick() { my_window = window.open('', 'mywindow', 'status=1,width=350,height=150'); my_window.document.write('<html><head><title>print me</title></head>'); my_window.document.write('<body onafterprint="self.close()">'); my_window.document.write('<p>when you print this window, it will close afterward.</p>'); my_window.document.write('</body></html>'); } </script> </head...
...,width=350,height=150'); my_window.document.write('<html><head><title>print me</title></head>'); my_window.document.write('<body onafterprint="self.close()">'); my_window.document.write('<p>when you print this window, it will close afterward.</p>'); my_window.document.write('</body></html>'); } </script> </head> <body> <p>to try out the <code>afterprint</code> event, click the link below to open the window to print.
..._window.document.write('<p>when you print this window, it will close afterward.</p>'); my_window.document.write('</body></html>'); } </script> </head> <body> <p>to try out the <code>afterprint</code> event, click the link below to open the window to print.
...rl) { var ohiddframe = document.createelement("iframe"); ohiddframe.onload = setprint; ohiddframe.style.position = "fixed"; ohiddframe.style.right = "0"; ohiddframe.style.bottom = "0"; ohiddframe.style.width = "0"; ohiddframe.style.height = "0"; ohiddframe.style.border = "0"; ohiddframe.src = surl; document.body.appendchild(ohiddframe); } </script> </head> <body> <p><span onclick="printpage('externalpage.html');" style="cursor:pointer;text-decoration:underline;color:#0000ff;">print external page!</span></p> </body> </html> note: older versions of internet explorer cannot print the contents of a hidden <iframe>.
User input and controls - Developer guides
ue); where handlekeydown and handlekeyup are the functions implementing the controls about the keydown and keyup events.
...e handlekeydown and handlekeyup are the functions implementing the controls about the keydown and keyup events.
...msrequestfullscreen) { elem.msrequestfullscreen(); } else if (elem.mozrequestfullscreen) { elem.mozrequestfullscreen(); } else if (elem.webkitrequestfullscreen) { elem.webkitrequestfullscreen(); } note: to find more out about adding fullscreen functionality your application, read our documentation about using fullscreen mode.
...time this example tracks multiple touch points at a time, allowing the user to draw in a <canvas> with more than one finger at a time.
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
: next, we enter our color's hex code (d79c7a) into the "base rgb" box at the bottom-left corner of the tool: we now see a monochromatic palette based on the color we picked from the mars photo.
...e picked from the mars photo.
...he palette type (currently "monochromatic").
...he bottom-right corner tells us that this color is #508d7c.
<a>: The Anchor element - HTML: Hypertext Markup Language
Web › HTML › Element › a
tpink'; function draw(x, y) { if (isdrawing) { c.beginpath(); c.arc(x, y, 10, 0, math.pi*2); c.closepath(); c.fill(); } } canvas.addeventlistener('mousemove', event => draw(event.offsetx, event.offsety) ); canvas.addeventlistener('mousedown', () => isdrawing = true); canvas.addeventlistener('mouseup', () => isdrawing = false); document.queryselector('a').addeventlistener('click', event => event.target.href = canvas.todataurl() ); result security and privacy <a> elements can have consequences for users’ security and privacy.
...ation attacks (vulnerability description), although note that, in newer browser versions (e.g.
..."/products">here</a>.
...about our products</a>.
<button>: The Button element - HTML: Hypertext Markup Language
Web › HTML › Element › button
the html <button> element represents a clickable button, used to submit forms or anywhere in a document for accessible, standard button functionality.
...ound the button is placed on.
....
...66px and bold or larger, or 24px or larger.) webaim: color contrast checker mdn understanding wcag, guideline 1.4 explanations understanding success criterion 1.4.3 | w3c understanding wcag 2.0 clicking and focus whether clicking on a <button> causes it to (by default) become focused varies by browser and os.
<input type="checkbox"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › checkbox
<div> <input type="checkbox" id="coding" name="interest" value="coding" checked> <label for="coding">coding</label> </div> <div> <input type="checkbox" id="music" name="interest" value="music"> <label for="music">music</label> </div> </fieldset> providing a bigger hit area for your checkboxes in the above examples, you may have noticed that you can toggle a checkbox by clicking on its associated <label> element as well as on the checkbox itself.
...type="checkbox" id="music" name="interest" value="music"> <label for="music">music</label> </div> </fieldset> providing a bigger hit area for your checkboxes in the above examples, you may have noticed that you can toggle a checkbox by clicking on its associated <label> element as well as on the checkbox itself.
... checkbox is set to indeterminate.
...inate state is used to state that collecting the ingredients has started, but the recipe is not yet complete.
<input type="reset"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › reset
<input> elements of type "reset" are rendered as buttons, with a default click event handler that resets all of the inputs in the form to their initial values.
...he form to their initial values.
...e for this interactive example is stored in a github repository.
...ractive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
HTTP Index - HTTP
Web › HTTP › Index
nd enforcing a same-origin policy.
...s (onclick) and xslt stylesheets which can trigger script execution.
... event handlers like onclick, but not urls loaded directly into <script> elements.
...protocol used between the client and the load balancer, the x-forwarded-proto request header can be used.
Closures - JavaScript
bject's properties) with one or more methods.
...() { document.body.style.fontsize = size + 'px'; }; } var size12 = makesizer(12); var size14 = makesizer(14); var size16 = makesizer(16); size12, size14, and size16 are now functions that resize the body text to 12, 14, and 16 pixels, respectively.
... }; } var size12 = makesizer(12); var size14 = makesizer(14); var size16 = makesizer(16); size12, size14, and size16 are now functions that resize the body text to 12, 14, and 16 pixels, respectively.
...sizer(14); var size16 = makesizer(16); size12, size14, and size16 are now functions that resize the body text to 12, 14, and 16 pixels, respectively.
Web security
shared with requesting code from the given origin.
...from the given origin.
...nt-type-options the x-content-type-options response http header is a marker used by the server to indicate that the mime types advertised in the content-type headers should not be changed and be followed.
...liberately configured.
port - Archive of obsolete content
a particular message, use port.removelistener().
... the button sends the content script a message called "get-first-para" when it is clicked: // main.js pageworker = require("sdk/page-worker").page({ contentscriptfile: require("sdk/self").data.url("listener.js"), contenturl: "http://en.wikipedia.org/wiki/chalk" }); require("sdk/ui/button/action").actionbutton({ id: "get-first-para", label: "get-first-para", icon: "./icon-16.png", onclick: function() { console.log("sending 'get-first-para'"); pageworker.port.emit("get-first-para"); } }); the content script listens for "get-first-para".
...e document and then calls removelistener() to stop listening.
page-mod - Archive of obsolete content
not work properly in many real-world cases.
...mple, we might want to run a script in the context of the currently active tab when the user clicks a button: to block certain content, to change the font style, or to display the document's dom structure.
...the attach method of the tab object, you can attach a set of content scripts to a particular tab.
simple-storage - Archive of obsolete content
our code, or you may zero them each time the construction code runs.
...array is only constructed if it does not already exist: if (!ss.storage.pages) ss.storage.pages = []; deleting data you can delete properties using the delete operator.
...at adds three buttons to write, read, and delete a value: var ss = require("sdk/simple-storage"); require("sdk/ui/button/action").actionbutton({ id: "write", label: "write", icon: "./write.png", onclick: function() { ss.storage.value = 1; console.log("setting value"); } }); require("sdk/ui/button/action").actionbutton({ id: "read", label: "read", icon: "./read.png", onclick: function() { console.log(ss.storage.value); } }); require("sdk/ui/button/action").actionbutton({ id: "delete", label: "delete", icon: "./delete.png", onclick: function() { delete ss.storage.value; console.log("deleting value"); } }); if you run it, you'll see that after clicking "read" after clicking "delete" gives you the expected output: info: undefined note that t...
Creating Reusable Modules - Archive of obsolete content
e file const pr_uint32_max = 0xffffffff; ch.updatefromstream(istream, pr_uint32_max); // pass false here to get binary data back var hash = ch.finish(false); // convert the binary hash data to a hex string.
...urnok || rv == nsifilepicker.returnreplace) { var file = fp.file; // get the path as string.
...h, (c, i) => tohexstring(hash.charcodeat(i))).join(""); return s; } exports.hashfile = md5file; index.js finally, update index.js to import these two new modules and use them: var filepicker = require("./filepicker.js"); var md5 = require("./md5.js"); require("sdk/ui/button/action").actionbutton({ id: "show-panel", label: "show panel", icon: { "16": "./icon-16.png" }, onclick: function() { console.log(md5.hashfile(filepicker.promptforfile())); } }); distributing modules with jpm, we use npm as the package manager for sdk modules that don't ship inside firefox.
Miscellaneous - Archive of obsolete content
own in the following table mousewheel.withxxxkey.action result 0 scroll by lines.
... mousewheel.withxxxkey.action result 0 scroll by lines.
...es.
Progress Listeners - Archive of obsolete content
progress listeners progress listeners allow extensions to be notified of events associated with documents loading in the browser and with tab switching events.
...wser only notifies you of the events for which you provide a callback.
...of which is when the tab is changed.
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
chanism in quicknote1 for our debugger.
...t: function() { }, push: function(val) { }, plus: function() { }, pop: function() { } } implement the addition operation create test case begin by creating the test case.
... prompt and navigate to the directory containing gonzui.
Setting up an extension development environment - Archive of obsolete content
m in your user home directory, and name folders for easy navigation to firenightly and firedevedition or similar.
... install any additional extensions, and finally close this instance of firefox.
...erence settings in firefox or seamonkey, type about:config in the location bar.
Adding preferences to an extension - Archive of obsolete content
s.stockwatcher2.symbol" type="string" title="stock to watch" /> </vbox> adding the context menu adding the contextual menu is easy; all the work that needs doing is done in the stockwatcher2.xul file.
...he context menu adding the contextual menu is easy; all the work that needs doing is done in the stockwatcher2.xul file.
... done in the stockwatcher2.xul file.
Creating a dynamic status bar extension - Archive of obsolete content
version="1.0" encoding="utf-8"?> <!doctype overlay> <overlay id="stockwatcher-overlay" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://stockwatcher/content/stockwatcher.js"/> <!-- firefox --> <statusbar id="status-bar"> <statusbarpanel id="stockwatcher" label="loading..." tooltiptext="current value" onclick="stockwatcher.refreshinformation()" /> </statusbar> </overlay> also, notice that the definition of the status bar panel now includes a new property, onclick, which references the javascript function that will be executed whenever the user clicks on the status bar panel.
...loading..." tooltiptext="current value" onclick="stockwatcher.refreshinformation()" /> </statusbar> </overlay> also, notice that the definition of the status bar panel now includes a new property, onclick, which references the javascript function that will be executed whenever the user clicks on the status bar panel.
... as soon as possible.
Source Navigator - Archive of obsolete content
executing: $ which snavigator /usr/bin/snavigator importing the source execute the following: snavigator.
... the "more" button.) in my case, i inputted the followings: project file: <tt>~/snav-mozilla</tt> add directory (where your source files reside in -- i understand that the label here is not so self-explanatory...): <tt>~/moz1.9/mozilla</tt> (because i saved my source at ~/moz1.9/mozilla.) remember to ensure that "include subdirectories" and "build cross-reference database" are checked.
... click "ok".
jspage - Archive of obsolete content
ative({name:"event",initialize:function(a,f){f=f||window;var k=f.document;a=a||f.event;if(a.$extended){return a;}this.$extended=true;var j=a.type; var g=a.target||a.srcelement;while(g&&g.nodetype==3){g=g.parentnode;}if(j.test(/key/)){var b=a.which||a.keycode;var m=event.keys.keyof(b);if(j=="keydown"){var d=b-111; if(d>0&&d<13){m="f"+d;}}m=m||string.fromcharcode(b).tolowercase();}else{if(j.match(/(click|mouse|menu)/i)){k=(!k.compatmode||k.compatmode=="css1compat")?k.html:k.body; var i={x:a.pagex||a.clientx+k.scrollleft,y:a.pagey||a.clienty+k.scrolltop};var c={x:(a.pagex)?a.pagex-f.pagexoffset:a.clientx,y:(a.pagey)?a.pagey-f.pageyoffset:a.clienty}; if(j.match(/dommousescroll|mousewheel/)){var h=(a.wheeldelta)?a.wheeldelta/120:-(a.detail||0)/3;}var e=(a.which==3)||(a.button==2);var l=null;if(j.mat...
...a.wheeldelta/120:-(a.detail||0)/3;}var e=(a.which==3)||(a.button==2);var l=null;if(j.match(/over|out/)){switch(j){case"mouseover":l=a.relatedtarget||a.fromelement; break;case"mouseout":l=a.relatedtarget||a.toelement;}if(!(function(){while(l&&l.nodetype==3){l=l.parentnode;}return true;}).create({attempt:browser.engine.gecko})()){l=false; }}}}return $extend(this,{event:a,type:j,page:i,client:c,rightclick:e,wheel:h,relatedtarget:l,target:g,code:b,key:m,shift:a.shiftkey,control:a.ctrlkey,alt:a.altkey,meta:a.metakey}); }});event.keys=new hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});event.implement({stop:function(){return this.stoppropagation().preventdefault(); },stoppropagation:function(){if(this.event.stoppropagation){this.event.stoppropagation();}e...
...{var c=this.retrieve("events");if(!c||!c[d]){return this;}c[d].keys.each(function(e){e.create({bind:this,delay:a,"arguments":b})(); },this);return this;},cloneevents:function(d,a){d=document.id(d);var c=d.retrieve("events");if(!c){return this;}if(!a){for(var b in c){this.cloneevents(d,b); }}else{if(c[a]){c[a].keys.each(function(e){this.addevent(a,e);},this);}}return this;}});element.nativeevents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,dommousescroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,domcontentloaded:1,readystatechange:1,error:1,abort:1,scroll:1}; (function(){var a=function(b){var c=b.relatedtarget;if(c==undefined)...
PyDOM - Archive of obsolete content
he global object (i.e., the window), instead of to a module's __dict__ as you expect in the python world.
...rint foo"/> should be able to reference 'foo' via globals as shown.
... able to reference 'foo' via globals as shown.
allowevents - Archive of obsolete content
e allowevents type: boolean if true, events are passed to children of the element.
... also retargeted to the element itself.
...s may be set to true on a descendant instead.
collapse - Archive of obsolete content
« xul reference home collapse type: one of the values below determines which side of the splitter is collapsed when its grippy is clicked.
... « xul reference home collapse type: one of the values below determines which side of the splitter is collapsed when its grippy is clicked.
...hen its grippy is clicked.
context - Archive of obsolete content
« xul reference home context type: id should be set to the value of the id of the popup element that should appear when the user context-clicks on the element.
... « xul reference home context type: id should be set to the value of the id of the popup element that should appear when the user context-clicks on the element.
... « xul reference home context type: id should be set to the value of the id of the popup element that should appear when the user context-clicks on the element.
label - Archive of obsolete content
ring the label that will appear on the element.
...his attribute is copied to the menulist.value property upon user selection of the menuitem.
...value="whaw" id="the-big-label" command="the-big-button"/> <button id="the-big-button" label="click me" oncommand="alert(document.getelementbyid('the-big-label').value)"/> <label id="mylabel" value="my label"/> <button label="click me" oncommand="document.getelementbyid('mylabel').setattribute('value','value changed');" /> <checkbox label="my checkbox" id="mycheckbox"/> <button label="another click" oncommand="document.getelementbyid('mycheckbox').setattribute('label','still not checked');"/> <button label="show label of checkbox" oncommand="alert( document.getelementbyid('mycheckbox').getattribute('label') )"/> ...
Sorting Results - Archive of obsolete content
gnore whether results are containers and just sort by a value, alphabetically or numerically depending on the type of data.
...be sorted by the ?name variable and the second column by the ?date variable.
...value should be either 'ascending', 'descending' or 'natural'.
Adding Labels and Images - Archive of obsolete content
ample: example 2 : <label>this is some longer text that will wrap onto several lines.</label> as with html, line breaks and extra whitespace are collapsed into a single space.
... control attribute to set which control the label is associated with.
...ociated label, that control will be focused.
Focus and Selection - Archive of obsolete content
iousnext » the section will describe how to handle the focus and selection of elements.
...and dispatcher and sets a label to its tag name.
...box' as we might expect.
Input Controls - Archive of obsolete content
dd these lines before the buttons we created in the last section.
...use most of the same attributes on checkboxes and radio buttons as with buttons.
...will appear beside the check box.
List Controls - Archive of obsolete content
e that the column stretches as the window does.
...a menulist element which can be used for this purpose.
...s the individual choices.
More Button Features - Archive of obsolete content
nside the button to cause a menu to drop down when the button is pressed, much like the menulist.
...ttached to each item to perform a task.
...set the type attribute to the value menu-button.
Urlbar-icons - Archive of obsolete content
[ examples | attributes | properties | methods | related ] the location of ui elements like the bookmarks, feed and go buttons.
...tion of ui elements like the bookmarks, feed and go buttons.
...dress bar and the navigation bar.) example the default contents of browser.xul: <hbox id="urlbar-icons"> <button be="" chromedir="ltr" class="urlbar-icon" click="" for="" id="safebrowsing-urlbar-icon" img="" level="safe" might="" onclick="godocommand('safebrowsing-show-warning');" page="" style="-moz-user-focus:" tooltiptext="this" type="menu"> <img class="urlbar-icon" id="star-button" onclick="placesstarbutton.onclick(event);" /> <img address="" chromedir="ltr" class="urlbar-icon" id="go-button" in="" location="" onclick="handleurlbarcommand(event);" p="" the="" to="" tooltiptext="go" /> </button> </hbox> ...
Using Remote XUL - Archive of obsolete content
web site uses an html navigation bar on the left-hand side of its pages to provide site navigation.
...g/" /> </menupopup> </menu> <button label="faq" value="https://www.mozilla.org/faq.html" /> <button label="search" value="https://www.mozilla.org/search.html" /> </menubar> <iframe src="https://www.mozilla.org/" flex="1" /> </window> the menupopup element is a container for menu items.
...first we write an event handler function that receives an event, extracts a url from the value attribute of the element where the event occurred (a.k.a.
button - Archive of obsolete content
.
... created.
...s and sets the value of the open attribute.
tabbrowser - Archive of obsolete content
rea in the tabbrowser.
...llable directly on the element itself, such as goback and goforward.
...oad a url into the document, with the specified load flags, the given referrer, character set, and post data.
tabpanels - Archive of obsolete content
mples | attributes | properties | methods | related ] a container to hold the set of pages in a tabbox.
...container to hold the set of pages in a tabbox.
...o this property, all items will be deselected.
tabs - Archive of obsolete content
Archive › Mozilla › XUL › tabs
o effect.
... out entirely.
...abindex type: integer gets and sets the value of the tabindex attribute.
titlebar - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] boxes created with the titlebar element behave just like a normal window titlebar: when the element is clicked and dragged, the window moves with it.
... when the element is clicked and dragged, the window moves with it.
... , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
treecol - Archive of obsolete content
arger than this maximum width, you may be able to use the max-width css property (or the maxwidth attribute) to override this size.
...n the cell.
... , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
2006-12-01 - Archive of obsolete content
rnal website use universalbrowserwrite on a local intranet.
... microsummary generator questions and discussion surrounding microsummaries in ff 2.0.
...and discussion surrounding microsummaries in ff 2.0.
Building a Theme - Archive of obsolete content
" menu), and go to "file->inspect chrome document".
...one should remember to include a closing slash and remove any trailing spaces.
...changes to your css files, close and restart firefox, and see the updates.
Common Firefox theme issues and solutions - Archive of obsolete content
t(0, 48px, 16px, 32px); } #page-proxy-favicon[pageproxystate="invalid"] { opacity: 0.5; } for more information about identity boxes please see the identity box section of the amo editors theme review guidelines no visual clue for disabled url bars there needs to be a visual clue when url bar is disabled.
...he "click me" link.
...ult theme into the mozapps/extensions/ folder of your theme and add the following style rule to the css file extensions.css: .addon[active="false"] .icon { filter: url("chrome://mozapps/skin/extensions/extensions.svg#greyscale"); opacity:0.3; } about:memory about:memory nodes do not collapse the styling of about:memory is a little messed up in that nodes do not collapse as they should when clicked on.
XForms Submit Element - Archive of obsolete content
it element doesn't interact with the data in the bound node.
...ons the xforms submit element can be represented by the following widgets for the specified appearance attribute values: button - default representation (xhtml/xul) link/clickable text - used when appearance = 'minimal' (xhtml only) button displaying a button is the default presentation (xhtml/xul).
...mal' (xhtml only) button displaying a button is the default presentation (xhtml/xul).
Audio for Web games - Game development
ormation about it here from the google developers site.
...wn.mp3" mp3 file consists of a number being spoken every 2 seconds, the idea being that we play back that number when the corresponding button is pressed.
...nst anchor = el.queryselector('a'); const loadtext = el.queryselector('p'); const playbutton = el.queryselector('button'); // load file loadfile(anchor.href).then((track) => { // set loading to false el.dataset.loading = 'false'; // hide loading text loadtext.style.display = 'none'; // show button playbutton.style.display = 'inline-block'; // allow play on click playbutton.addeventlistener('click', function() { // check if context is in suspended state (autoplay policy) if (audioctx.state === 'suspended') { audioctx.resume(); } playtrack(track); playbutton.dataset.playing = true; }) }) }) note: you can see this demo in action here and view the source code here.
Mobile touch controls - Game development
this.button.events.oninputover.add(itemtouched, this); function itemtouched(button, pointer) { // do something } that way you'll be able to attach an event to any object in the game, like the player's ship, and react to the actions performed by the user.
...r.
... this out in the background for you.
Implementing game control mechanisms - Game development
actual gameplay.
...ne is needed for preloading required assets, create() is executed once the state had started, and update() is executed on every frame.
...s, create() is executed once the state had started, and update() is executed on every frame.
Extra lives - Game development
labels defining the texts look like something we already did in the score lesson.
...use this variable when stlying our text labels — update your code so that the multiple instances of the text styling are replaced with the variable: scoretext = game.add.text(5, 5, 'points: 0', textstyle); livestext = game.add.text(game.world.width-5, 5, 'lives: '+lives, textstyle); livestext.anchor.set(1,0); lifelosttext = game.add.text(game.world.width*0.5, game.world.height*0.5, 'life lost, click to continue', textstyle); lifelosttext.anchor.set(0.5); lifelosttext.visible = false; this way changing the font in one variable will apply the changes to every place it is used.
...t, game over!'); location.reload(); } } instead of instantly printing out the alert when you lose a life, we first subtract one life from the current number and check if it's a non-zero value.
Prefetch - MDN Web Docs Glossary: Definitions of Web-related terms
ll likely be requested, enabling the content to load instantly if and when the user requests it.
...al websites that may be clicked on, like search engine results, dns prefetching resolves domain names in advance thereby speeding up load times by reducing the time associated with domain lookup at request time.
...hing resolves domain names in advance thereby speeding up load times by reducing the time associated with domain lookup at request time.
Advanced form styling - Learn web development
fore { /* use `visibility` instead of `display` to avoid recalculating layout */ visibility: visible; } input[type="checkbox"]:disabled { border-color: black; background: #ddd; color: gray; } you'll find more out about such pseudo-classes and more in the next article; the above ones do the following: :checked — the checkbox (or radio button) is in a checked state — the user has clicked/activated it.
...> we then use generated content to generate a little down arrow, and put it in the right place using positioning: .select-wrapper { position: relative; } .select-wrapper::after { content: "▼"; font-size: 1rem; top: 6px; right: 10px; position: absolute; } the second, slightly more major issue is that you don't have control over the box that appears containing the options when you click on the <select> box to open it.
... custom list of file names and sizes in any way you want; we created it after all.
Dealing with files - Learn web development
e a folder called images, inside your test-site folder.
... a folder called scripts, inside your test-site folder.
... same directory as index.html.
What’s in the head? Metadata in HTML - Learn web development
e your page appear higher in relevant searches performed in search engines (such activities are termed search engine optimization, or seo.) active learning: the description's use in search engines the description is also used on search engine result pages.
...n the html file in both your browser, and your text editor.
....
Test your skills: Events - Learn web development
this yet in the course, but you'll have seen some examples that make use of it, and we'd like you to do some research into what dom apis you need to successfully answer the questions.
...e seen some examples that make use of it, and we'd like you to do some research into what dom apis you need to successfully answer the questions.
...ordinate of the circle.
Manipulating documents - Learn web development
ral parent interface htmlelement, and node — which represents all nodes in a dom).
...ping-list.html starting file and make a copy of it somewhere.
....
Useful string methods - Learn web development
: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = jssolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solutio...
...: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = jssolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solutio...
... 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = jssolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solutio...
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
ate.
... <strong>0</strong> todos left with this, which populates the incomplete number with the length of the incomplete array: <strong>{{this.todos.incomplete.length}}</strong> todos left next, replace this: <button type="button" class="clear-completed"> with this: <button type="button" class="clear-completed" {{on 'click' this.todos.clearcompleted}}> so now when the button is clicked, the clearcompleted() action we added earlier is run.
...th the length of the incomplete array: <strong>{{this.todos.incomplete.length}}</strong> todos left next, replace this: <button type="button" class="clear-completed"> with this: <button type="button" class="clear-completed" {{on 'click' this.todos.clearcompleted}}> so now when the button is clicked, the clearcompleted() action we added earlier is run.
Accessibility in React - Learn web development
s we set out to implement.
...f ref to each element, and set their values to the appropriately named ref objects.
... react reads the current value of the editfieldref and moves browser focus to it.
Adding a new todo form: Vue events, methods, and models - Learn web development
late>, like so: <template> <div id="app"> <h1>my to-do list</h1> <to-do-form></to-do-form> <ul> <li v-for="item in todoitems" :key="item.id"> <to-do-item :label="item.label" :done="item.done" :id="item.id"></to-do-item> </li> </ul> </div> </template> now when you view your running site, you should see the new form displayed.
...el by logging the value of the data submitted in our onsubmit() method.
...ins the old value.
Strategies for carrying out testing - Learn web development
te than global browser stats like those mentioned above.
...d disk now, vdi (virtual disk image), and dynamically allocated).
...w some steps and report the results they get.
Deploying our app - Learn web development
oncise, and descriptive, so they clearly describe what the change does.
... step.
...l chain: a test to ensure our code works.
API-provided widgets
string indicating the type of widget.
... non-custom widgets; a function that will be invoked after the widget has a dom node destroyed, passing the document from which it was removed.
...estroyed, passing the document from which it was removed.
Localizing without a specialized tool
ou have set up the proper build environment on your local machine?
...d localize.
...at the change is visible in the ui.
QA phase
omething (oops!).
...ut needing a language pack.
... steps below to test your localization: install aurora in your preferred language.
Activity Monitor, Battery Status Menu and top
upport documentation specifically recommends it for troubleshooting battery life problems.) unfortunately "energy impact" is not a good measure for either users or software developers and it should be avoided.
...res, among other things, cpu usage and idle wakeups for each running process.
... energy”.
Gecko Profiler FAQ
ly also for rayon threads (used in stylo).
...tform thread spawning functions but nobody has looked at it yet.
...ge that you’re interested in in its manifest.
Profiling with Instruments
for memory profiling and for statistical profiling.
...instruments user guide instruments user reference instruments help articles instruments help performance overview basic usage select "time profiler" from the "choose a profiling template for:" dialog.
...ance overview basic usage select "time profiler" from the "choose a profiling template for:" dialog.
Profile Manager
efox will be launched when that profile is selected.
...ly, you can manually add firefox versions by clicking the "manage firefox versions..." button: each firefox version in the list has the following properties: path, version, and default.
...backup, and choose "backup to->archive" from the toolbar's backup menu.
Index
m provides a complete management solution for creating, deploying, and managing certificates, including cas that issue object-signing certificates.
... token: ----------------------------------------------- using netscape signing tool and a smart card to sign files the signtool command normally takes an argument of the -k option to specify a signing certificate.
...------------------- using netscape signing tool and a smart card to sign files the signtool command normally takes an argument of the -k option to specify a signing certificate.
PKCS11 Implement
se these two functions but uses c_encrypt and c_decrypt instead if c_wrapkey and c_unwrapkey aren't implemented.
...en't implemented.
...ny convenient location on the user's hard disk, but you must tell the user to type the module name and location in the cryptographic modules portion of the communicator security info window.
NSS tools : signtool
m provides a complete management solution for creating, deploying, and managing certificates, including cas that issue object-signing certificates.
... token: ----------------------------------------------- using netscape signing tool and a smart card to sign files the signtool command normally takes an argument of the -k option to specify a signing certificate.
...------------------- using netscape signing tool and a smart card to sign files the signtool command normally takes an argument of the -k option to specify a signing certificate.
Signing Mozilla apps for Mac OS X
e easiest way to get a signing certificate is to use apple's keychain feature to create one.
...o use apple's keychain feature to create one.
...ing identity".
Gecko states
f this second state is defined, then clients can communicate the information about the object to users.
...oth state_invisible and state_offscreen set.
...focusable the object can be focused.
Components.utils.cloneInto
oned object.
...s.exportfunction: // add-on script var addonscriptobject = { greetme: function() { alert("hello from add-on"); } }; contentwindow.addonscriptobject = cloneinto(addonscriptobject, contentwindow, {clonefunctions: true}); // page script var test = document.getelementbyid("test"); test.addeventlistener("click", function() { window.addonscriptobject.greetme(); }, false); cloning objects that contain dom elements by default, if the object you clone contains objects that are reflected from c++, such as dom elements, the cloning operation will fail with an error.
...clone is allowed to contain these objects: // add-on script var addonscriptobject = { body: contentwindow.document.body }; contentwindow.addonscriptobject = cloneinto(addonscriptobject, contentwindow, {wrapreflectors: true}); // page script var test = document.getelementbyid("test"); test.addeventlistener("click", function() { console.log(window.addonscriptobject.body.innerhtml); }, false); access to these objects in the target scope is subject to the normal security checks.
Components.utils.exportFunction
ted function will affect the original object that was passed in: // privileged scope: for example, a content script function changemyname(user) { user.name = "bill"; } exportfunction(changemyname, contentwindow, { defineas: "changemyname" }); // less-privileged scope: for example, a page script var user = {name: "jim"}; var test = document.getelementbyid("test"); test.addeventlistener("click", function() { console.log(user.name); // "jim" window.changemyname(user); console.log(user.name); // "bill" }, false); note that this is subject to the normal rules of xrays: for example, an expando property added to a dom node will not be visible in the original object.
...ontent script function loguser(user) { // console.log(user.getuser()); // error console.log(user.wrappedjsobject.getuser()); // "bill" } exportfunction(loguser, contentwindow, { defineas: "loguser" }); // less-privileged scope: for example, a page script var user = {getuser: function() {return "bill";}} var test = document.getelementbyid("test"); test.addeventlistener("click", function() { window.loguser(user); }, false); passing functions as arguments if functions are given as arguments, these are also passed as xrays.
...rks, making the allowcallbacks option redundant: // privileged scope: for example, a content script function loguser(getuser) { console.log(getuser()); // "bill" } exportfunction(loguser, unsafewindow, { defineas: "loguser" }); // less-privileged scope: for example, a page script function getuser() { return "bill"; } var test = document.getelementbyid("test"); test.addeventlistener("click", function() { window.loguser(getuser); }, false); cross-origin checking when the exported function is called each argument, including this, is checked to make sure that the caller subsumes that argument.
nsIAccessibleStates
defined, then clients can communicate the information about the object to users.
... and state_offscreen set.
...ically announces information.
nsITreeView
behavior where drops are only allowed on items, such as the mailnews folder pane, always return false from candropbeforeafter().
...he index of the item.
...lue to change the cell to.
Index
in related bug reports.
... 56 thunderbird configuration files config editor, configuration files many of the tips and tricks mentioned on this site can be applied by using the built-in config editor.
... 70 thunderbird extensions add-ons, extensions, thunderbird categori 71 adding items to the folder pane this tutorial examines how to add items to an existing folder pane view.
Adding items to the Folder Pane
this tutorial examines how to add items to an existing folder pane view.
... (attribute) the level in the tree to display the item at open (rw, attribute) whether or not this container is open children (attribute) an array of child items also conforming to this spec getproperties (function) a call from getrowproperties or getcellproperties for this item will be passed into this function command (function) this function will be called when the item is double-clicked for our example extension, two different types of folder-tree-items will be defined.
... it all together all that is left at this point is to actually add these newly defined folder-tree-items to the folder pane's _rowmap at the appropriate time.
Plug-in Basics - Plugins
keyboard and mouse events obtain data from the network using urls post data to urls add hyperlinks or hotspots that link to new urls draw into sections on an html page communicate with javascript/dom from native code you can see which plug-ins are installed on your system and have been properly associated with the browser by consulting the installed plug-ins page.
...["application/x-shockwave-flash"]; if (mimetype) { // yes, so can we display with a plug-in?
...nstall a plug-in, because the default plug-in is only automatically invoked when you use the embed element.
Debugging service workers - Firefox Developer Tools
al for creating offline apps, it can be annoying to test the cache.
...rite code to empty the cache, and then fill it again.
...s’ storage tab has a cache storage section that lists all the different caches you have stored under each different origin.
Browser Toolbox - Firefox Developer Tools
remote debugging".
... content windows as well as any iframes they contain.
...ables you to inspect documents in individual chrome windows and popups, as well as in content tabs.
Examine, modify, and watch variables - Firefox Developer Tools
ngs.
...he variable's current value and you'll be able to type there: watch an expression watch expressions are expressions that are evaluated each time execution pauses.
...he watch expression does nothing until you begin to step through your code, so nothing happens until you reach a breakpoint.
Pretty-print a minified file - Firefox Developer Tools
to prettify a minified file, click the pretty print source icon () at the bottom of the source pane.
... to prettify a minified file, click the pretty print source icon () at the bottom of the source pane.
...the source pane.
Set a breakpoint - Firefox Developer Tools
ur console rather than pausing execution as a breakpoint does.
...source pane and pressing ctrl + b (windows/linux) or cmd + b (macos).
...e condition you want it to break on: once you've entered your condition and pressed enter/return, the line number will be highlighted in orange: breakpoints list once you've set some breakpoints, the breakpoints list in the right-hand column shows the filename and line number for each one: unsetting a breakpoint once a breakpoint has been set, you can unset it again in various ways: click on the line number highlight.
Set an XHR breakpoint - Firefox Developer Tools
an xhr (xmlhttprequest) breakpoint breaks code execution when an xhr request is dispatched so that you can examine the current state of the program.
... an xhr (xmlhttprequest) breakpoint breaks code execution when an xhr request is dispatched so that you can examine the current state of the program.
...s header, enter the url in which you are interested, and press enter.
Using the Debugger map scopes feature - Firefox Developer Tools
with all concatenated module files).
...nt at line 102 in the increment function.
...itional section is added to the right-hand panel below the call stack to display variables mapped from the original scope, like this: as useful as this is, it would be even nicer if you could view the original code (before it was packages into the "bundle.js" file.
Measure a portion of the page - Firefox Developer Tools
ol you can measure a specific area of a web page.
...port, you'll see the mouse has a crosshair cursor with its current coordinates displayed beside it.
...ton down and then drag, you'll start to draw a rectangle, with its x, y, and diagonal dimensions displayed.
Aggregate view - Firefox Developer Tools
ach category, and that number as a percentage of the whole heap size for that tab.
... the monster example page.
...s where the "bytes" and "count" columns are useful: they show allocation size and number of allocations at that exact point.
Inspecting web sockets - Firefox Developer Tools
a web app that utilizes a web socket connection, the web socket requests are listed in the list of requests in the network monitor along with all other requests.
...dshake) are visible, which indicates that the server is switching to a web socket connection.
...messages for control frames sent by the browser.
Performance Analysis - Firefox Developer Tools
the network monitor includes a performance analysis tool, to help show you how long the browser takes to download the different parts of your site.
...for each run side by side, or vertically if the browser window is narrow: the results for each run are summarised in a table and a pie chart.
...ly if the browser window is narrow: the results for each run are summarised in a table and a pie chart.
CSS Grid Inspector: Examine grid layouts - Firefox Developer Tools
en an html element on your page has display: grid applied to it, a number of features are made available in the devtools to provide easy access to grid features.
...eparate page.
...grid present on a page has an entry in the "overlay grid" section: each entry consists of (from left to right): a checkbox allowing you to toggle the grid overlay for that grid on and off.
Inspect and select colors - Firefox Developer Tools
in the css pane's rules view, if a rule contains a color value, you'll see a sample of the color next to the value: a color sample is also shown for css custom properties (variables) that represent colors.
... that represent colors.
... change the color: if the color is a foreground color, the color picker tells you whether its contrast with the background color meets accessibility guidelines.
Select and highlight elements - Firefox Developer Tools
ng the box model, and a tooltip showing its tag and size: with the context menu to open the inspector and select an element immediately, activate the context menu over the element in the page and select "inspect element": with the html pane when the inspector is open, as you move the mouse around the elements listed in the html pane, the corresponding elements are highlighted in the page.
...ment": with the html pane when the inspector is open, as you move the mouse around the elements listed in the html pane, the corresponding elements are highlighted in the page.
...e highlighted in the page.
Allocations - Firefox Developer Tools
llocation-samples in this function (also shown as a percentage of the total) rows are sorted by the "self bytes" column.
...eral, though: allocation pressure - allocating a lot of memory, or allocating memory at a high rate - makes spidermonkey more likely to run garbage collection, and more likely to run full, non-incremental garbage collection.
...n, and more likely to run full, non-incremental garbage collection.
How to - Firefox Developer Tools
r tools menu if you display the menu bar or are on os x) select "performance" from tools button, in the toolbar, if you have one: record a profile to start a new recording, press the stopwatch icon in the recordings pane.
...tton, in the toolbar, if you have one: record a profile to start a new recording, press the stopwatch icon in the recordings pane.
...watch icon in the recordings pane.
Responsive Design Mode - Firefox Developer Tools
informed about how you can make them automatic.
...ct this to see a panel containing all the choices, which enables you to check the devices you want to see in the drop-down.
... gprs 50 kb/s 20 kb/s 500 regular 2g 250 kb/s 50 kb/s 300 good 2g 450 kb/s 150 kb/s 150 regular 3g 750 kb/s 250 kb/s 100 good 3g 1.5 mb/s 750 kb/s 40 regular 4g/lte 4 mb/s 3 mb/s 20 dsl 2 mb/s 1 mb/s 5 wi-fi 30 mb/s 15 mb/s 2 to select a network, click the list box that's initially labeled "no throttling": ...
Shader Editor - Firefox Developer Tools
tex and fragment shaders.
...ree panes: a list of all the glsl programs on the left, the vertex shader for the currently selected program in the middle, and the fragment shader for the currently selected program on the right: managing programs the left hand pane lists all programs currently in use by a webgl context.
...cted program on the right: managing programs the left hand pane lists all programs currently in use by a webgl context.
Cookies - Firefox Developer Tools
sent with requests initiated from the same registrable domain.
...ated — date and time when the cookie was created.
... is, the domain value matches exactly the domain of the current website.
AddressErrors - Web APIs
e taken from defaultpaymentdetails.
...to call the event's updatewith() method, passing along the updatedetails object.
...ified error or errors but to allow the user to keep trying to edit the address.
AudioContext.createMediaStreamDestination() - Web APIs
on = audioctx.createmediastreamdestination(); returns a mediastreamaudiodestinationnode.
...blob.
... <button>make sine wave</button> <audio controls></audio> <script> var b = document.queryselector("button"); var clicked = false; var chunks = []; var ac = new audiocontext(); var osc = ac.createoscillator(); var dest = ac.createmediastreamdestination(); var mediarecorder = new mediarecorder(dest.stream); osc.connect(dest); b.addeventlistener("click", function(e) { if (!clicked) { mediarecorder.start(); osc.start(0); e.target.innerhtml = "stop recording"; clicked = true; } else { mediarecorder.stop(); osc.stop(0); e.target.disabled = true; } }); mediarecorder.ondataavailable = function(evt) { // push each chunk (blobs) in a...
AudioContext.getOutputTimestamp() - Web APIs
contexttime: a point in the time coordinate system of the currenttime for the baseaudiocontext; the time after the audio context was first created.
...nterface; the time after the document containing the audio context was first rendered examples in the following code we start to play an audio file after a play button is clicked, and start off a requestanimationframe loop running, which constantly outputs the contexttime and performancetime.
...hich constantly outputs the contexttime and performancetime.
Body.text() - Web APIs
Web › API › Body › text
ponse is always decoded using utf-8.
... value a promise that resolves with a usvstring.
...request() constructor, then use it to fetch a specific .txt file.
Document.createTextNode() - Web APIs
nt.createtextnode(data); text is a text node.
...is a string containing the data to be put in the text node.
...node.
Document.forms - Web APIs
Web › API › Document › forms
tion object listing all of the document's forms.
... single <form> element.
... examples getting form information <!doctype html> <html lang="en"> <head> <title>document.forms example</title> </head> <body> <form id="robby"> <input type="button" onclick="alert(document.forms[0].id);" value="robby's form" /> </form> <form id="dave"> <input type="button" onclick="alert(document.forms[1].id);" value="dave's form" /> </form> <form id="paul"> <input type="button" onclick="alert(document.forms[2].id);" value="paul's form" /> </form> </body> </html> getting an element from within a form var selectform = document.forms[index]; var selectformelement = document.forms[index].elements[index]; named form access <!doctype html> <html lang="en"> <head> <title>document.forms example</title> </head> <body> <form name="login"> <input name="email" type="email"> ...
Document.requestStorageAccess() - Web APIs
lve.
...utomatic access grants are given through our compatibility heuristics.
...emeral storage access grant is: invalidated at the end of the browser session.
Element: contextmenu event - Web APIs
the contextmenu event fires when the user attempts to open a context menu.
... the contextmenu event fires when the user attempts to open a context menu.
...g fired at the targeted element.
Element: fullscreenchange event - Web APIs
es into or out of full-screen mode.
...es yes cancelable no interface event event handler property onfullscreenchange this event is sent to the element which is transitioning into or out of full-screen mode.
...cument.fullscreenelement will point to the element that // is in fullscreen mode if there is one.
Element.innerHTML - Web APIs
Web › API › Element › innerHTML
"; } log("logging mouse events inside this container..."); the log() function creates the log output by getting the current time from a date object using tolocaletimestring(), and building a string with the timestamp and the message text.
..."event <strong>" + event.type + "</strong> at <em>" + event.clientx + ", " + event.clienty + "</em>"; log(msg); } then we use this as the event handler for a number of mouse events on the box that contains our log: var boxelem = document.queryselector(".box"); boxelem.addeventlistener("mousedown", logevent); boxelem.addeventlistener("mouseup", logevent); boxelem.addeventlistener("click", logevent); boxelem.addeventlistener("mouseenter", logevent); boxelem.addeventlistener("mouseleave", logevent); html the html is quite simple for our example.
...he container for the log text itself.
Element.insertAdjacentElement() - Web APIs
he position specified is not a recognised value.
...e: the beforebegin and afterend positions work only if the node is in a tree and has an element parent.
...listener('click', function() { var tempdiv = document.createelement('div'); tempdiv.style.backgroundcolor = randomcolor(); if (activeelem) { activeelem.insertadjacentelement('afterend',tempdiv); } setlistener(tempdiv); }); have a look at our insertadjacentelement.html demo on github (see the source code too.) here we have a sequence of <div> elements inside a container.
Element: mousedown event - Web APIs
the mousedown event is fired at an element when a pointing device button is pressed while the pointer is inside the element.
... the mousedown event is fired at an element when a pointing device button is pressed while the pointer is inside the element.
... the mousedown event is fired at an element when a pointing device button is pressed while the pointer is inside the element.
Event.composed - Web APIs
Web › API › Event › composed
ss the shadow dom boundary into the standard dom.
...er(); let pelem = document.createelement('p'); pelem.textcontent = this.getattribute('text'); let shadowroot = this.attachshadow({mode: 'open'}) .appendchild(pelem); } }); we then insert one of each element into our page: <open-shadow text="i have an open shadow root"></open-shadow> <closed-shadow text="i have a closed shadow root"></closed-shadow> then include a click event listener on the <html> element: document.queryselector('html').addeventlistener('click',function(e) { console.log(e.composed); console.log(e.composedpath()); }); when you click on the <open-shadow> element and then the <closed-shadow> element, you'll notice two things.
..."i have a closed shadow root"></closed-shadow> then include a click event listener on the <html> element: document.queryselector('html').addeventlistener('click',function(e) { console.log(e.composed); console.log(e.composedpath()); }); when you click on the <open-shadow> element and then the <closed-shadow> element, you'll notice two things.
Event.currentTarget - Web APIs
et examples event.currenttarget is interesting to use when attaching the same event handler to several elements.
...ng to use when attaching the same event handler to several elements.
...de(e){ e.currenttarget.style.visibility = 'hidden'; console.log(e.currenttarget); // when this function is used as an event handler: this === e.currenttarget } var ps = document.getelementsbytagname('p'); for(var i = 0; i < ps.length; i++){ // console: print the clicked <p> element ps[i].addeventlistener('click', hide, false); } // console: print <body> document.body.addeventlistener('click', hide, false); // click around and make paragraphs disappear note: the value of event.currenttarget is only available while the event is being handled.
Event.initEvent() - Web APIs
Web › API › Event › initEvent
nt.
...hrough the event chain or not.
...ubbles will give its value.
Event - Web APIs
Web › API › Event
the event interface represents an event which takes place in the dom.
... the event interface represents an event which takes place in the dom.
... at which the event was created (in milliseconds).
GainNode - Web APIs
Web › API › GainNode
-processing module that causes a given gain to be applied to the input data before its propagation to the output.
... is an a-rate audioparam representing the amount of gain to apply.
... audio: true }, // success callback function(stream) { source = audioctx.createmediastreamsource(stream); }, // error callback function(err) { console.log('the following gum error occured: ' + err); } ); } else { console.log('getusermedia not supported on your browser!'); } source.connect(gainnode); gainnode.connect(audioctx.destination); ...
GlobalEventHandlers.oncontextmenu - Web APIs
the oncontextmenu property of the globaleventhandlers mixin is an eventhandler that processes contextmenu events.
...function expression.
...nts context menus from opening in the window.
GlobalEventHandlers.ontransitioncancel - Web APIs
t the value of elapsedtime, which is zero until the delay period ends and the animation begins.
...px; -webkit-transform: rotate(180deg); transform: rotate(180deg); } javascript next, we need to establish our event handlers to change the text content of the box when the transition begins and ends.
...2000); function appear() { box.style.display = 'block'; } } box.ontransitioncancel = function(event) { console.log('transitioncancel fired after ' + event.elapsedtime + ' seconds.'); } result the resulting content looks like this: notice what happens when you hover your mouse cursor over the box, then move it away.
HTMLDialogElement.close() - Web APIs
logelement interface closes the dialog.
... updating the returnvalue of the the dialog.
...elbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on github as htmldialogelement-basic (see it live also).
HTMLDialogElement.open - Web APIs
openvalue = dialoginstance.open; value a boolean representing the state of the open html attribute.
...attribute.
...elbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on github as htmldialogelement-basic (see it live also).
HTMLDialogElement.show() - Web APIs
the show() method of the htmldialogelement interface displays the dialog modelessly, i.e.
... the show() method of the htmldialogelement interface displays the dialog modelessly, i.e.
...elbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> specifications specification status comment html living standardthe definition ...
HTMLDialogElement.showModal() - Web APIs
backdrop pseudo-element.
...it is rendered inert.
...elbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on github as htmldialogelement-basic (see it live also).
HTMLDialogElement - Web APIs
essly, i.e.
...lays the dialog as a modal, over the top of any other dialogs that might be present.
...elbutton = document.getelementbyid('cancel'); var dialog = document.getelementbyid('favdialog'); dialog.returnvalue = 'favanimal'; function opencheck(dialog) { if(dialog.open) { console.log('dialog open'); } else { console.log('dialog closed'); } } // update button opens a modal dialog updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); }); // form cancel button closes the dialog box cancelbutton.addeventlistener('click', function() { dialog.close('animalnotchosen'); opencheck(dialog); }); })(); </script> note: you can find this example on github as htmldialogelement-basic (see it live also).
HTMLElement: change event - Web APIs
event, the change event is not necessarily fired for each alteration to an element's value.
...rty onchange depending on the kind of element being changed and the way the user interacts with the element, the change event fires at a different moment: when the element is :checked (by clicking or using the keyboard) for <input type="radio"> and <input type="checkbox">; when the user commits the change explicitly (e.g., by selecting a value from a <select>'s dropdown with a mouse click, by selecting a date from a date picker for <input type="date">, by selecting a file in the file picker for <input type="file">, etc.); when the element loses focus after its value was changed, but not commited (e.g., after editing the value of <textarea> or <input type="text">).
...ment.queryselector('.ice-cream'); selectelement.addeventlistener('change', (event) => { const result = document.queryselector('.result'); result.textcontent = `you like ${event.target.value}`; }); result text input element for some elements, including <input type="text">, the change event doesn't fire until the control loses focus.
HTMLImageElement.sizes - Web APIs
; border-radius: 7em; padding: 1.5em; font: 16px "open sans", verdana, arial, helvetica, sans-serif; } article img { display: block; max-width: 100%; border: 1px solid #888; box-shadow: 0 0.5em 0.3em #888; margin-bottom: 1.25em; } javascript the javascript code handles the two buttons that let you toggle the third width option between 40em and 50em; this is done by handling the click event, using the javascript string object method replace() to replace the relevant portion of the sizes string.
...buttons that let you toggle the third width option between 40em and 50em; this is done by handling the click event, using the javascript string object method replace() to replace the relevant portion of the sizes string.
... click event, using the javascript string object method replace() to replace the relevant portion of the sizes string.
HTMLInputElement.setSelectionRange() - Web APIs
the htmlinputelement.setselectionrange() method sets the start and end positions of the current text selection in an <input> or <textarea> element.
...character after the last selected character.
...ction in which the selection is considered to have been performed.
HTMLMediaElement.play() - Web APIs
ection handler is called with an exception name passed in as its sole input parameter (as opposed to a traditional exception being thrown).
... even more in-depth information about autoplay and autoplay blocking, see our article autoplay guide for media and web audio apis.
...ment's class is cleared, restoring its default appearance.
HTMLSelectElement.selectedOptions - Web APIs
fetching the htmlcollection of selected elements using the selected property.
...tion[i].label; if (i === (collection.length - 2) && (collection.length < 3)) { output += " and "; } else if (i < (collection.length - 2)) { output += ", "; } else if (i === (collection.length - 2)) { output += ", and "; } } if (output === "") { output = "you didn't order anything!"; } outputbox.innerhtml = output; }, false); this script sets up a click event listener on the "order now" button.
... && (collection.length < 3)) { output += " and "; } else if (i < (collection.length - 2)) { output += ", "; } else if (i === (collection.length - 2)) { output += ", and "; } } if (output === "") { output = "you didn't order anything!"; } outputbox.innerhtml = output; }, false); this script sets up a click event listener on the "order now" button.
HTMLTextAreaElement - Web APIs
nselend); omsginput.setselectionrange(bdouble || nselstart === nselend ?
...(bdouble ?
...nternal span to behave like a link: .intlink { cursor: pointer; text-decoration: underline; color: #0000ff; } html: <form name="myform"> <p>[&nbsp;<span class="intlink" onclick="insertmetachars('&lt;strong&gt;','&lt;\/strong&gt;');"><strong>bold</strong></span> | <span class="intlink" onclick="insertmetachars('&lt;em&gt;','&lt;\/em&gt;');"><em>italic</em></span> | <span class="intlink" onclick="var newurl=prompt('enter the full url for the link');if(newurl){insertmetachars('&lt;a href=\u0022'+newurl+'\u0022&gt;','&lt;\/a&gt;');}else{document.myform.mytxtarea.focus();}">url</span> | <span class="intlink" onclick="insertmetachars('\n&lt;code&gt;\n','\n&lt;\/code&gt;\n');">code</span> | <span class="intlink" onclick="insertmetachars(' :-)');">smile</span> | etc.
ImageCapture - Web APIs
example below starts with a device's media device (in other words a camera).
... these calls to a canvas object.
... const track = mediastream.getvideotracks()[0]; imagecapture = new imagecapture(track); }) .catch(error => console.log(error)); } function ongrabframebuttonclick() { imagecapture.grabframe() .then(imagebitmap => { const canvas = document.queryselector('#grabframecanvas'); drawcanvas(canvas, imagebitmap); }) .catch(error => console.log(error)); } function ontakephotobuttonclick() { imagecapture.takephoto() .then(blob => createimagebitmap(blob)) .then(imagebitmap => { const canvas = document.queryselector('#takephotocanvas'); drawcanvas(canvas, imagebitmap); }) .catch(error => console.log(error)); } /* utils */ function drawcanvas(canvas, img) { canvas.width = getcomputedstyle(canvas).width.split('px')[0]; canvas.height = getcomputedstyle(canvas).
MediaRecorder - Web APIs
wed or was attempted using an unsupported codec.
...ks = []; navigator.mediadevices.getusermedia(constraints) .then(function(stream) { var mediarecorder = new mediarecorder(stream); visualize(stream); record.onclick = function() { mediarecorder.start(); console.log(mediarecorder.state); console.log("recorder started"); record.style.background = "red"; record.style.color = "black"; } stop.onclick = function() { mediarecorder.stop(); console.log(mediarecorder.state); console.log("recorder stopped"); record.style.background = ""; record.style.color = ""; } mediarecorder.onstop = function(e) { console.log("data available after mediarecorder.stop() called."); var clipname = prompt('enter a name for your sound clip'); var clipcontainer...
...o); clipcontainer.appendchild(cliplabel); clipcontainer.appendchild(deletebutton); soundclips.appendchild(clipcontainer); audio.controls = true; var blob = new blob(chunks, { 'type' : 'audio/ogg; codecs=opus' }); chunks = []; var audiourl = url.createobjecturl(blob); audio.src = audiourl; console.log("recorder stopped"); deletebutton.onclick = function(e) { evttgt = e.target; evttgt.parentnode.parentnode.removechild(evttgt.parentnode); } } mediarecorder.ondataavailable = function(e) { chunks.push(e.data); } }) .catch(function(err) { console.log('the following error occurred: ' + err); }) } this code sample is inspired by the web dictaphone demo.
MouseEvent.button - Web APIs
Web › API › MouseEvent › button
g one or multiple buttons.
...o the standard "left to right" layout.
...d="button" oncontextmenu="event.preventdefault();">click here with your mouse...</button> <p id="log"></p> javascript let button = document.queryselector('#button'); let log = document.queryselector('#log'); button.addeventlistener('mouseup', logmousebutton); function logmousebutton(e) { if (typeof e === 'object') { switch (e.button) { case 0: log.textcontent = 'left button clicked.'; break; case 1: log.textcontent = 'middle button clicked.'; break; case 2: log.textcontent = 'right button clicked.'; break; default: log.textcontent = `unknown button code: ${e.button}`; } } } result specifications specification status comment document object model (dom) level 3 events specif...
MouseEvent.ctrlKey - Web APIs
that indicates whether the ctrl key was pressed or not when a given mouse event occurs.
... the ctrl key was pressed or not when a given mouse event occurs.
...tanceofmouseevent.ctrlkey return value a boolean, where true indicates that the key is pressed, and false indicates that the key is not pressed.
MouseEvent.metaKey - Web APIs
may open the start menu.
...u.
...tanceofmouseevent.metakey return value a boolean, where true indicates that the key is pressed, and false indicates that the key is not pressed.
MouseEvent.pageX - Web APIs
Web › API › MouseEvent › pageX
the pagex read-only property of the mouseevent interface returns the x (horizontal) coordinate (in pixels) at which the mouse was clicked, relative to the left edge of the entire document.
...which the mouse was clicked, relative to the left edge of the entire document.
..., this property was defined as a long integer.
MouseEvent.shiftKey - Web APIs
the mouseevent.shiftkey read-only property is a boolean that indicates whether the shift key was pressed or not when a given mouse event occurs.
...key read-only property is a boolean that indicates whether the shift key was pressed or not when a given mouse event occurs.
...ceofmouseevent.shiftkey return value a boolean, where true indicates that the key is pressed, and false indicates that the key is not pressed.
NotificationEvent.action - Web APIs
returns the string id of the notification button the user clicked.
... returns the string id of the notification button the user clicked.
...utton, or the notification does not have a button.
ParentNode.replaceChildren() - Web APIs
splay: block; } .buttons { display: flex; flex-flow: column; justify-content: center; } select { width: 200px; } what we want to do is transfer any selected options in the "no" list over to the "yes" list when the "yes" button is pressed, and transfer any selected options in the "yes" list over to the "no" list when the "no" button is pressed.
...o in another constant.
...st nobtn = document.getelementbyid('to-no'); const yesbtn = document.getelementbyid('to-yes'); yesbtn.addeventlistener('click', () => { const selectedtransferoptions = document.queryselectorall('#no option:checked'); const existingyesoptions = document.queryselectorall('#yes option'); yesselect.replacechildren(...selectedtransferoptions, ...existingyesoptions); }); nobtn.addeventlistener('click', () => { const selectedtransferoptions = document.queryselectorall('#yes option:checked'); const existingnooptions = document.queryselectorall('#no option'); noselect.replacechildren(...selectedtransferoptions, ...existingnooptions); }); the end result looks like this: specification specification status comment domthe definition of 'parentnode.replacechildren()...
PerformanceEventTiming - Web APIs
the performanceeventtiming interface of the event timing api provides timing information for the event types listed below.
... the performanceeventtiming interface of the event timing api provides timing information for the event types listed below.
... the performanceeventtiming interface of the event timing api provides timing information for the event types listed below.
Using the Permissions API - Web APIs
revoke existing permissions, using the permissions.revoke() method.
...is doesn't offer much more than what we had already.
...y permission), then we can't get back to the permission prompt without using the browser menu options: firefox: tools > page info > permissions > access your location.
SVGTransformList - Web APIs
re immediately reflected in the list.
... xmlns="http://www.w3.org/2000/svg" version="1.1"> <desc>example showing how to transform svg elements that using svgtransform objects</desc> <script type="application/ecmascript"> <![cdata[ function transformme(evt) { // svg root element to access the createsvgtransform() function var svgroot = evt.target.parentnode; // svgtransformlist of the element that has been clicked on var tfmlist = evt.target.transform.baseval; // create a seperate transform object for each transform var translate = svgroot.createsvgtransform(); translate.settranslate(50,5); var rotate = svgroot.createsvgtransform(); rotate.setrotate(10,0,0); var scale = svgroot.createsvgtransform(); scale.setscale(0.8,0.8); // apply the transforma...
... // apply the transformations by appending the svgtranform objects to the svgtransformlist associated with the element tfmlist.appenditem(translate); tfmlist.appenditem(rotate); tfmlist.appenditem(scale); } ]]> </script> <polygon fill="orange" stroke="black" stroke-width="5" points="100,225 100,115 130,115 70,15 70,15 10,115 40,115 40,225" onclick="transformme(evt)"/> <rect x="200" y="100" width="100" height="100" fill="yellow" stroke="black" stroke-width="5" onclick="transformme(evt)"/> <text x="40" y="250" font-family="verdana" font-size="16" fill="green" > click on a shape to transform it </text> </svg> live preview: specifications specification status comment scalable vecto...
ServiceWorkerGlobalScope - Web APIs
ope.oninstall property.
...essage occurs when incoming messages are received.
...ssage() method to send messages to service workers.
ServiceWorkerRegistration.showNotification() - Web APIs
the array should be an object literal.
... be a valid bcp 47 language tag.
...ion) { registration.shownotification('vibration sample', { body: 'buzz!
UIEvent.initUIEvent() - Web APIs
bbles will give its value.
... set, the read-only property event.cancelable will give its value.
...ong specifying some detail information about the event, depending on the type of event.
Starting up and shutting down a WebXR session - Web APIs
mber of security measures in place revolving around webxr.
...r of the device's availability, begin to monitor it for inputs, offer configuration options, or whatever you need to do with it.
...d event to be sent to the xrsession.
Using the Web Animations API - Web APIs
var nommingcake = document.getelementbyid('eat-me_sprite').animate( [ { transform: 'translatey(0)' }, { transform: 'translatey(-80%)' } ], { fill: 'forwards', easing: 'steps(4, end)', duration: alicechange.effect.timing.duration / 2 }); the element.animate() method will immediately run after it is called.
... by setting a decay on her animation’s playbackrate.
...e playback rate never falls below .4 if (redqueen_alice.playbackrate > .4) { redqueen_alice.updateplaybackrate(redqueen_alice.playbackrate * .9); } }, 3000); but urging them on by clicking or tapping causes them to speed up by multiplying their playbackrate: var gofaster = function() { redqueen_alice.updateplaybackrate(redqueen_alice.playbackrate * 1.1); } document.addeventlistener("click", gofaster); document.addeventlistener("touchstart", gofaster); the background elements also have playbackrates that are impacted when you click or tap.
Window.find() - Web APIs
Web › API › Window › find
rue, specifies a whole word search.
...earchinframes boolean.
...f the string is found; otherwise, false.
Window.onbeforeinstallprompt - Web APIs
d to "install" a web application.
...window.onbeforeinstallprompt = function(event) { ...}; example the following example uses the beforeinstallprompt event to make an install button operable, by using the event inside a click handler.
...le the following example uses the beforeinstallprompt event to make an install button operable, by using the event inside a click handler.
Window.prompt() - Web APIs
Web › API › Window › prompt
are many ways to use the prompt feature sign = window.prompt(); // open the blank prompt window sign = prompt(); // open the blank prompt window sign = window.prompt('are you feeling lucky'); // open the window with text "are you feeling lucky" sign = window.prompt('are you feeling lucky', 'sure'); // open the window with text "are you feeling lucky" and default value "sure" when the user clicks the ok button, text entered in the input field is returned.
...nk prompt window sign = prompt(); // open the blank prompt window sign = window.prompt('are you feeling lucky'); // open the window with text "are you feeling lucky" sign = window.prompt('are you feeling lucky', 'sure'); // open the window with text "are you feeling lucky" and default value "sure" when the user clicks the ok button, text entered in the input field is returned.
...= window.prompt('are you feeling lucky'); // open the window with text "are you feeling lucky" sign = window.prompt('are you feeling lucky', 'sure'); // open the window with text "are you feeling lucky" and default value "sure" when the user clicks the ok button, text entered in the input field is returned.
WindowOrWorkerGlobalScope.clearTimeout() - Web APIs
ntifier of the timeout you want to cancel.
...sponding call to settimeout().
...r alarm = { remind: function(amessage) { alert(amessage); this.timeoutid = undefined; }, setup: function() { if (typeof this.timeoutid === 'number') { this.cancel(); } this.timeoutid = window.settimeout(function(msg) { this.remind(msg); }.bind(this), 1000, 'wake up!'); }, cancel: function() { window.cleartimeout(this.timeoutid); } }; window.onclick = function() { alarm.setup(); }; notes passing an invalid id to cleartimeout() silently does nothing; no exception is thrown.
Using the link role - Accessibility
en magnifiers may enlarge links.
...abindex="0" id="link1" role="link" class="link"> fake accessible link created using a span </span> <p><a href="https://mozilla.org" target="_blank">actual real link</a></p> css span[role="link"] { color: blue; text-decoration: underline; cursor: pointer; } span[role="link"]:focus { outline: 1px dotted black; } javascript const spanelem = document.queryselector('span'); //handles clicks and keydowns on the link function navigatelink(e) { if (e.type === 'click' || e.key === 'enter') { let ref = e.target != null ?
...line: 1px dotted black; } javascript const spanelem = document.queryselector('span'); //handles clicks and keydowns on the link function navigatelink(e) { if (e.type === 'click' || e.key === 'enter') { let ref = e.target != null ?
ARIA: tab role - Accessibility
: 0 0.5em 0.5em 0.7em; border: 1px solid grey; border-radius: 0 0 5px 5px; background: white; z-index: 2; } [role="tabpanel"]:focus { border-color: orange; outline: 1px solid orange; } there are two things we need to do with javascript: we need to change focus and tab index of our tab elements with the right and left arrows, and we need to change the active tab and tabpanel when we click on a tab.
...nd all tabpanel elements in the grandparent element, make them all hidden, and finally select the element whose id is equal to the triggering tab's aria-controls and removes the hidden attribute, making it visible.
...ally select the element whose id is equal to the triggering tab's aria-controls and removes the hidden attribute, making it visible.
ARIA: listbox role - Accessibility
lected.
...> element with descendant <option> elements handles all the needed interactions natively.
...ant <option> elements handles all the needed interactions natively.
Accessibility Information for Web Authors - Accessibility
heck" for accessibility, privacy, searchability, metadata and even alt text attribute quality.
...firefox 2.x and firefox 3.x.
...delines (section 508, wcag priorities 1, 2 or 3).
:active - CSS: Cascading Style Sheets
Web › CSS › :active
d rules, as defined by the lvha-order: :link — :visited — :hover — :active.
......
...k { color: blue; } /* unvisited links */ a:visited { color: purple; } /* visited links */ a:hover { background: yellow; } /* hovered links */ a:active { color: red; } /* active links */ p:active { background: #eee; } /* active paragraphs */ result active form elements html <form> <label for="my-button">my button: </label> <button id="my-button" type="button">try clicking me or my label!</button> </form> css form :active { color: red; } form button { background: white; } result specifications specification status comment html living standardthe definition of ':active' in that specification.
user-select - CSS: Cascading Style Sheets
otherwise, if the used value of user-select on the parent of this element is none, the used value is none otherwise, the used value is text text the text can be selected by the user.
...e used value of user-select on the parent of this element is none, the used value is none otherwise, the used value is text text the text can be selected by the user.
...ed only in internet explorer.
Audio and Video Delivery - Developer guides
ss, then use javascript to link your controls to the audio/video api.
...'my-audio'); var mycontrol = document.getelementbyid('my-control'); function switchstate() { if (myaudio.paused == true) { myaudio.play(); mycontrol.innerhtml = "pause"; } else { myaudio.pause(); mycontrol.innerhtml = "play"; } } function checkkey(e) { if (e.keycode == 32 ) { //spacebar switchstate(); } } mycontrol.addeventlistener('click', function() { switchstate(); }, false); window.addeventlistener( "keypress", checkkey, false ); } you can try this example out here.
...lback content of a video, when none of the sources could be decoded in the current browser, is to add an error handler on the last source element.
Creating and triggering events - Developer guides
function() { // create and dispatch/trigger an event on the fly // note: optionally, we've also leveraged the "function expression" (instead of the "arrow function expression") so "this" will represent the element this.dispatchevent(new customevent('awesome', { bubbles: true, detail: { text: () => textarea.value } })) }); triggering built-in events this example demonstrates simulating a click (that is programmatically generating a click event) on a checkbox using dom methods.
...(instead of the "arrow function expression") so "this" will represent the element this.dispatchevent(new customevent('awesome', { bubbles: true, detail: { text: () => textarea.value } })) }); triggering built-in events this example demonstrates simulating a click (that is programmatically generating a click event) on a checkbox using dom methods.
...") so "this" will represent the element this.dispatchevent(new customevent('awesome', { bubbles: true, detail: { text: () => textarea.value } })) }); triggering built-in events this example demonstrates simulating a click (that is programmatically generating a click event) on a checkbox using dom methods.
<area> - HTML: Hypertext Markup Language
Web › HTML › Element › area
xt that is an ancestor of the current one and has no parent).
...specifying the position of the defined area in the browser tabbing order.
...bute is global in html5.
<dialog>: The Dialog element - HTML: Hypertext Markup Language
Web › HTML › Element › dialog
p css pseudo-element can be used to style behind a <dialog> element when the dialog is displayed with htmldialogelement.showmodal().
... aria-live="polite"></output> javascript var updatebutton = document.getelementbyid('updatedetails'); var favdialog = document.getelementbyid('favdialog'); var outputbox = document.queryselector('output'); var selectel = document.queryselector('select'); var confirmbtn = document.getelementbyid('confirmbtn'); // "update details" button opens the <dialog> modally updatebutton.addeventlistener('click', function onopen() { if (typeof favdialog.showmodal === "function") { favdialog.showmodal(); } else { alert("the <dialog> api is not supported by this browser"); } }); // "favorite animal" input sets the value of the submit button selectel.addeventlistener('change', function onselect(e) { confirmbtn.value = selectel.value; }); // "confirm" button of form triggers "close" on dialo...
...s not supported by this browser"); } }); // "favorite animal" input sets the value of the submit button selectel.addeventlistener('change', function onselect(e) { confirmbtn.value = selectel.value; }); // "confirm" button of form triggers "close" on dialog because of [method="dialog"] favdialog.addeventlistener('close', function onclose() { outputbox.value = favdialog.returnvalue + " button clicked - " + (new date()).tostring(); }); result specifications specification status comment html living standardthe definition of '<dialog>' in that specification.
<input type="datetime-local"> - HTML: Hypertext Markup Language
rted than datetime-local.
...well, but you shouldn't rely on this behavior since you can't easily predict it.
...ng() method can be used for this purpose.
<input type="number"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › number
nstrain the minimum and maximum number of valid digits using the min and max attributes (as explained above).
...y, the javascript: let metersinputgroup = document.queryselector('.metersinputgroup'); let feetinputgroup = document.queryselector('.feetinputgroup'); let metersinput = document.queryselector('#meters'); let feetinput = document.queryselector('#feet'); let inchesinput = document.queryselector('#inches'); let switchbtn = document.queryselector('input[type="button"]'); switchbtn.addeventlistener('click', function() { if(switchbtn.getattribute('class') === 'meters') { switchbtn.setattribute('class', 'feet'); switchbtn.value = 'enter height in meters'; metersinputgroup.style.display = 'none'; feetinputgroup.style.display = 'block'; feetinput.setattribute('required', ''); inchesinput.setattribute('required', ''); metersinput.removeattribute('required'); metersi...
...istener is added to the button to control the switching mechanism.
<input type="submit"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › submit
<input> elements of type submit are rendered as buttons.
... <input> elements of type submit are rendered as buttons.
... <input> elements of type submit are rendered as buttons.
<menuitem> - HTML: Hypertext Markup Language
Web › HTML › Element › menuitem
three values.
...t-click to see the adjusted context menu </div> <menu type="context" id="popup-menu"> <menuitem type="checkbox" checked>checkbox</menuitem> <hr> <menuitem type="command" label="this command does nothing" icon="https://developer.cdn.mozilla.net/static/img/favicon144.png"> commands don't render their contents.
...usted context menu </div> <menu type="context" id="popup-menu"> <menuitem type="checkbox" checked>checkbox</menuitem> <hr> <menuitem type="command" label="this command does nothing" icon="https://developer.cdn.mozilla.net/static/img/favicon144.png"> commands don't render their contents.
HTML elements reference - HTML: Hypertext Markup Language
Web › HTML › Element
.
... (data cell) and <th> (header cell) elements.
...nt represents a dialog box or other interactive component, such as a dismissable alert, inspector, or subwindow.
CSP: script-src - HTTP
the http content-security-policy (csp) script-src directive specifies valid sources for javascript.
...mple' requires a sample of the violating code to be included in the violation report.
...csp header: content-security-policy: script-src https://example.com/ the following script is blocked and won't be loaded or executed: <script src="https://not-example.com/js/library.js"></script> note that inline event handlers are blocked as well: <button id="btn" onclick="dosomething()"> you should replace them with addeventlistener calls: document.getelementbyid("btn").addeventlistener('click', dosomething); unsafe inline script note: disallowing inline styles and inline scripts is one of the biggest security wins csp provides.
Concurrency model and the event loop - JavaScript
will run entirely before any other code runs (and can modify data the function manipulates).
... like click or scroll.
...browser mitigates this with the "a script is taking too long to run" dialog.
Introduction - JavaScript
f you are new to javascript, start with the articles in the learning area and the javascript guide.
...res, and statements.
...u can use the multi-line line input mode.
Promise - JavaScript
) { console.error("had previously handled error"); } else { console.error(`trouble with promisegetword(): ${reason}`); } }) .finally((info) => console.log("all done")); advanced example <button id="btn">make a promise!</button> <div id="log"></div> this small example shows the mechanism of a promise.
...beforeend', val + ') promise fulfilled (async code terminated)'); }).catch((reason) => { // log the rejection reason console.log(`handle rejected promise (${reason}) here.`); }); // end log.insertadjacenthtml('beforeend', thispromisecount + ') promise made (sync code terminated)'); } if ("promise" in window) { let btn = document.getelementbyid("btn"); btn.addeventlistener("click",testpromise); } else { log = document.getelementbyid('log'); log.innerhtml = "live example not available as your browser doesn't support the <code>promise<code> interface."; } this example is started by clicking the button.
...minated)'); } if ("promise" in window) { let btn = document.getelementbyid("btn"); btn.addeventlistener("click",testpromise); } else { log = document.getelementbyid('log'); log.innerhtml = "live example not available as your browser doesn't support the <code>promise<code> interface."; } this example is started by clicking the button.
this - JavaScript
.
...e related element blue function bluify(e) { // always true console.log(this === e.currenttarget); // true when currenttarget and target are the same object console.log(this === e.target); this.style.backgroundcolor = '#a5d9f3'; } // get a list of every element in the document var elements = document.getelementsbytagname('*'); // add bluify as a click listener so when the // element is clicked on, it turns blue for (var i = 0; i < elements.length; i++) { elements[i].addeventlistener('click', bluify, false); } in an inline event handler when the code is called from an inline on-event handler, its this is set to the dom element on which the listener is placed: <button onclick="alert(this.tagname.tolowercase());"> show this </button> the above alert shows button.
... { elements[i].addeventlistener('click', bluify, false); } in an inline event handler when the code is called from an inline on-event handler, its this is set to the dom element on which the listener is placed: <button onclick="alert(this.tagname.tolowercase());"> show this </button> the above alert shows button.
void operator - JavaScript
ed!" executing the above function without the void keyword will result in an uncaught syntaxerror.
...script uris when a browser follows a javascript: uri, it evaluates the code in the uri and then replaces the contents of the page with the returned value, unless the returned value is undefined.
...troduce a short-hand braceless syntax that returns an expression.
<maction> - MathML
ment provides a possibility to bind actions to (sub-) expressions.
... can make use of the selection attribute.
...s for this element.
CSS and JavaScript animation performance - Web Performance
d before the next repaint.
...rmance test, using firefox, to see what animation method seems better overall.
...raw-fps preference.
Populating the page: how browsers work - Web Performance
ns.
... class="heading">my page</h1> <p>a paragraph with a <a href="https://example.com/about">link</a></p> <div> <img src="myimage.jpg" alt="image description"/> </div> <script src="anotherscript.js"></script> </body> </html> this response for this initial request contains the first byte of data received.
...the user would see the page super quickly, but wouldn't be able to scroll without jank until the script was downloaded, parsed and executed.
Structural overview of progressive web apps - Progressive web apps (PWAs)
like a native app with instant interaction and solid performance while keeping all the benefits of the web.
...website/g,games[i].website) .replace(/github/g,games[i].github); entry = entry.replace('<a href=\'http:///\'></a>','-'); content += entry; }; document.getelementbyid('content').innerhtml = content; then it registers a service worker: if ("serviceworker" in navigator) { navigator.serviceworker.register("/pwa-examples/js13kpwa/sw.js"); } after that, the app adds a handler for clicks on a button whose id is notifications; this handler requests permission to send notifications to the user, then generates and sends a random notification.
... worker: if ("serviceworker" in navigator) { navigator.serviceworker.register("/pwa-examples/js13kpwa/sw.js"); } after that, the app adds a handler for clicks on a button whose id is notifications; this handler requests permission to send notifications to the user, then generates and sends a random notification.
pointer-events - SVG: Scalable Vector Graphics
esentation attribute that allows defining whether or when an element may be the target of a mouse event.
...e circle will always intercept the mouse event.
...="15" cy="5" r="4" fill="white" pointer-events="none" /> </svg> window.addeventlistener('mouseup', (e) => { // let's pick a random color between #000000 and #ffffff const color = math.round(math.random() * 0xffffff) // let's format the color to fit css requirements const fill = '#' + color.tostring(16).padstart(6,'0') // let's apply our color in the // element we actually clicked on e.target.style.fill = fill }) as a presentation attribute, it can be applied to any element but it is mostly relevant only on the following twenty-three elements: <a>, <circle>, <clippath>, <defs>, <ellipse>, <foreignobject>, <g>, <image>, <line>, <marker>, <mask>, <path>, <pattern>, <polygon>, <polyline>, <rect>, <svg>, <switch>, <symbol>, <text>, <textpath>, <tspan>, <use> usage not...
SVG documentation index - SVG: Scalable Vector Graphics
Web › SVG › Index
ibute defines the blending mode on the <feblend> filter primitive.
...filter primitive.
...tribute the name attribute specifies either the name of a color profile or a font face.
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
.
...ct the "open with" radio button and choose any .exe except firefox.exe/mozilla.exe.
...se any .exe except firefox.exe/mozilla.exe.
Cross-domain Content Scripts - Archive of obsolete content
uest the following add-on creates a panel whose content is the summary weather forecast for shetland.
...var data = require("sdk/self").data; var forecast_panel = require("sdk/panel").panel({ height: 50, contenturl: data.url("panel.html"), contentscriptfile: data.url("panel-script.js") }); forecast_panel.on("show", function(){ forecast_panel.port.emit("show"); }); require("sdk/ui/button/action").actionbutton({ id: "get-forecast", label: "get the forecast", icon: "./icon-16.png", onclick: function() { forecast_panel.show(); } }); the "panel.html" just includes a <div> block for the forecast: <!doctype html> <!-- panel.html --> <html> <head></head> <body> <div id="forecast_summary"></div> </body> </html> the "panel-script.js" uses xmlhttprequest to fetch the latest forecast: // panel-script.js var url = "http://datapoint.metoffice.gov.uk/public/data/txt/wxf...
simple-prefs - Archive of obsolete content
lignment", "type": "radio", "title": "alignment", "value": "n", "options": [ { "value": "l", "label": "lawful" }, { "value": "n", "label": "neutral" }, { "value": "c", "label": "chaotic" } ] } control displays a button.
... "label": "chaotic" } ] } control displays a button.
lang/functional - Archive of obsolete content
oop.
...unction () { ...
Adding a Button to the Toolbar - Archive of obsolete content
icon-64.png then open the file called "index.js" in the root of your addon directory and add the following code to it: var buttons = require('sdk/ui/button/action'); var tabs = require("sdk/tabs"); var button = buttons.actionbutton({ id: "mozilla-link", label: "visit mozilla", icon: { "16": "./icon-16.png", "32": "./icon-32.png", "64": "./icon-64.png" }, onclick: handleclick }); function handleclick(state) { tabs.open("https://www.mozilla.org/"); } now run the add-on with jpm run.
...ps://www.mozilla.org/"); } now run the add-on with jpm run.
Unit Testing - Archive of obsolete content
dules/services.jsm"); exports.atob = a => atob(a); exports.btoa = b => btoa(b); this code exports two functions, which just call the platform's btoa() and atob() functions.
...unction() { encoded = base64.btoa("hello"); console.log(encoded); decoded = base64.atob(encoded); console.log(decoded); } }); to run this example you'll also have to have an icon file named "icon-16.png" saved in your add-ons "data" directory.
Localization - Archive of obsolete content
to the html tag where you want the localized string to appear, and assign the identifier to it: <html> <body> <h1 data-l10n-id="hello_id"></h1> </body> </html> then you can use this html file to build your interface, for example inside a panel: var button = require("sdk/ui/button/action").actionbutton({ id: "localized-hello", label: "localized hello", icon: "./icon-16.png", onclick: function() { hello.show(); } }); var hello = require("sdk/panel").panel({ height: 75, width: 150, contenturl: require("sdk/self").data.url("my-panel.html") }); given locale files for "en-us" and "fr" which provide translations of hello_id, the panel will now display "hello!" or "bonjour !", according to the current locale: the translation is inserted into the node which has the ...
...eys to look up your translations.
Windows - Archive of obsolete content
w-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); var newwindow = wm.getmostrecentwindow("navigator:browser"); var b = newwindow.gbrowser; the code generate a typeerror from firefox console.
...ator:browser"); var b = newwindow.gbrowser; the code generate a typeerror from firefox console.
Extension Versioning, Update and Compatibility - Archive of obsolete content
//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html lang="en-us" dir="ltr" xmlns="http://www.w3.org/1999/xhtml"> <h2>my extension</h2> <ul> <li>this update fixes some stability related issues.</li> </ul> </html> what end-user sees the content of updateinfourl will be displayed to user in the add-ons page, in a list of all available updates.
...dows users should consider hashtab for interactive (non-build-script) use.
Adding windows and dialogs - Archive of obsolete content
gs in an extension.
.../keymaster/gatekeeper/there.is.only.xul"> carefully read the specification of the dialog element.
Creating reusable content with CSS and XBL - Archive of obsolete content
bindings, see the xbl page in this wiki.
... settimeout(this.cleardemo, 2000, this) ]]></body> </method> <method name="cleardemo"> <parameter name="me"/> <body><![cdata[ me.square.style.backgroundcolor = "transparent" me.square.style.marginleft = "0" me.button.removeattribute("disabled") ]]></body> </method> </implementation> <handlers> <handler event="click" button="0"><![cdata[ if (event.originaltarget == this.button) this.dodemo() ]]></handler> </handlers> </binding> </bindings> make a new css file, bind6.css.
Creating a Web based tone generator - Archive of obsolete content
have samples to play, a buffer of 500 ms is created.
...created.
Working with BFCache - Archive of obsolete content
q: what is the bfcache exactly?
... q: what is the bfcache exactly?
Bookmark Keywords - Archive of obsolete content
ark</tt> <tt>google bookmark site:developer.netscape.com</tt> <tt>google netscape xml support -site:netscape.com</tt> a few examples in the course of writing this article, a number of potentially useful bookmarks were considered as possible examples.
...etscape.com</tt> <tt>google netscape xml support -site:netscape.com</tt> a few examples in the course of writing this article, a number of potentially useful bookmarks were considered as possible examples.
Creating a Skin for Mozilla - Archive of obsolete content
n in order to create a skin for mozilla, you will need to know three things.
...ow three things.
Drag and Drop JavaScript Wrapper - Archive of obsolete content
be called when a drag starts on the button.
... here, an observer has been declared and stored in the variable textobserver.
Repackaging Firefox - Archive of obsolete content
me of the default search engine.
... to be different from the default to prevent the migration wizard from overwriting it.
Remotely debugging Firefox for Metro - Archive of obsolete content
ort (to change the tcp port number where firefox will listen for connections) devtools.debugger.prompt-connection = false (allow connections without displaying a confirmation prompt.
...e desktop via the desktop tile and check if windows firewall has thrown up an incoming connection permissions prompt.
Frequently Asked Questions - Archive of obsolete content
for svg content authors to make mozilla use a plugin when people view the svg files on their website.
...ly, occasional fixes are provided by other mozilla hackers.
InstallTrigger.installChrome - Archive of obsolete content
installtrigger.installchrome trigger scripts are typically invoked by javascript event handlers on hyperlinks.
... installtrigger.installchrome trigger scripts are typically invoked by javascript event handlers on hyperlinks.
button.type - Archive of obsolete content
« xul reference home type type: one of the values below the type of button.
... created.
href - Archive of obsolete content
Archive › Mozilla › XUL › Attribute › href
« xul reference home href type: string defines a url to open when this element is clicked.
... « xul reference home href type: string defines a url to open when this element is clicked.
id - Archive of obsolete content
Archive › Mozilla › XUL › Attribute › id
« xul reference home id type: unique id a unique identifier so that you can identify the element with.
...er to getelementbyid() and other dom functions and to reference the element in style sheets.
oncommand - Archive of obsolete content
« xul reference home oncommand type: script code this event handler is called when the command is activated.
... « xul reference home oncommand type: script code this event handler is called when the command is activated.
Attribute (XUL) - Archive of obsolete content
llaftermatch autoscroll beforeselected buttonaccesskeyaccept buttonaccesskeycancel buttonaccesskeydisclosure buttonaccesskeyextra1 buttonaccesskeyextra2 buttonaccesskeyhelp buttonalign buttondir buttondisabledaccept buttonlabelaccept buttonlabelcancel buttonlabeldisclosure buttonlabelextra1 buttonlabelextra2 buttonlabelhelp buttonorient buttonpack buttons checked checkstate clicktoscroll class closebutton closemenu coalesceduplicatearcs collapse collapsed color cols command commandupdater completedefaultindex container containment contentcontextmenu contenttooltip context contextmenu control crop curpos current currentset customindex customizable cycler datasources decimalplaces default defaultbutton defaultset description dir disableautoc...
... ignorekeys image inactivetitlebarcolor increment index inputtooltiptext insertafter insertbefore instantapply inverted iscontainer isempty key keycode keytext label lastpage lastselected last-tab left linkedpanel max maxheight maxlength maxpos maxrows maxwidth member menu menuactive min minheight minresultsforpopup minwidth mode modifiers mousethrough movetoclick multiline multiple name negate newlines next noautofocus noautohide noinitialfocus nomatch norestorefocus object observes onbeforeaccept onbookmarkgroup onchange onclick onclosetab oncommand oncommandupdate ondialogaccept ondialogcancel ondialogclosure ondialogextra1 ondialogextra2 ondialoghelp onerror onerrorcommand onextra1 onextra2 oninput onload onnewtab onp...
command - Archive of obsolete content
Archive › Mozilla › XUL › Events › command
the command event is executed when an element is activated.
... cases, there are several ways to activate an element.
openPopup - Archive of obsolete content
s open, menus opened earlier do not highlight or execute their items.
...d earlier do not highlight or execute their items.
Floating Panels - Archive of obsolete content
reen.
...cation is made active, and become visible again when the xul application is made active.
Popup Guide - Archive of obsolete content
e list of commands.
...appears again.
currentIndex - Archive of obsolete content
cannot rely on this property to change or determine a tree selection, except for trees with seltype="single".
...election.
textbox (Toolkit autocomplete) - Archive of obsolete content
the value of the maxrows attribute.
... type type: string set to the value autocomplete to have an autocomplete textbox.
Textbox (XPFE autocomplete) - Archive of obsolete content
e minresultsforpopup (or minresultsforpopup) attribute.
...te.
The Joy of XUL - Archive of obsolete content
operating system.
...one release builds.
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
xt section in this tutorial contains examples of code that you can use to make your button do something useful.
...created.
Tree Widget Changes - Archive of obsolete content
problems with the css) treechildren::-moz-tree-checkbox(checked) { /* css for checked cells */ list-style-image: url("chrome://global/skin/checkbox/cbox-check.gif"); } in addition, checkmark columns support editing: <tree editable="true"> <treecols> <treecol type="checkbox" editable="true"> ...
... { /* css for checked cells */ list-style-image: url("chrome://global/skin/checkbox/cbox-check.gif"); } in addition, checkmark columns support editing: <tree editable="true"> <treecols> <treecol type="checkbox" editable="true"> ...
Broadcasters and Observers - Archive of obsolete content
caster id="colorchanger" style="color: black"/> </broadcasterset> <button label="test"> <observes element="colorchanger" attribute="style" onbroadcast="alert('color changed');"/> </button> <button label="observer" oncommand="document.getelementbyid('colorchanger').setattribute('style','color: red');" /> two buttons have been created, one labeled test and the other labeled observer.
...<button label="test"> <observes element="colorchanger" attribute="style" onbroadcast="alert('color changed');"/> </button> <button label="observer" oncommand="document.getelementbyid('colorchanger').setattribute('style','color: red');" /> two buttons have been created, one labeled test and the other labeled observer.
Content Panels - Archive of obsolete content
in this section, we'll look at how to add panels that can display html pages or other xul files.
... file.
More Tree Features - Archive of obsolete content
rows which are declared with the treerow element or a set of rows which are declared with the treechildren element.
... <treerow> <treecell label="jerry" /> <treecell label="hodge" /> </treerow> </treeitem> </treechildren> </treeitem> </treechildren> </tree> this has created a hierarchical tree.
Simple Menu Bars - Archive of obsolete content
f menus.
...bel="redo"/> </menupopup> </menu> </menubar> </toolbox> here, a simple menu bar is created using the menubar element.
Skinning XUL Files by Hand - Archive of obsolete content
efinition, the selector "toolbar.nav-bar" is used to define style information for all xul toolbars of the class "nav-bar." unlike an id -- which is also often used as a selector but must be unique -- a class attribute can be used on multiple xul elements you want to pick up the specified style information.
...s used to define style information for all xul toolbars of the class "nav-bar." unlike an id -- which is also often used as a selector but must be unique -- a class attribute can be used on multiple xul elements you want to pick up the specified style information.
Tree Box Objects - Archive of obsolete content
notice the label change between 'text' and 'cell'.
...e 'cell' indicates the area around the text, for example, the margin on the left side where the open and close twisties are normally drawn.
Trees - Archive of obsolete content
Archive › Mozilla › XUL › Tutorial › Trees
the next section.
...g the label attribute.
Trees and Templates - Archive of obsolete content
ee.
...u can write a script to sort the data.
XPCOM Examples - Archive of obsolete content
scape.com/nc-rdf#name"/> </rule> </template> </menupopup> </menu> </menubar> </toolbox> a window menu will be created with a list of all the open windows.
...ource, which can be used to get the window given a resource.
browser - Archive of obsolete content
lable directly on the element itself, such as goback and goforward.
...oad a url into the document, with the specified load flags, the given referrer, character set, and post data.
menu - Archive of obsolete content
Archive › Mozilla › XUL › menu
« xul reference home [ examples | attributes | properties | methods | related ] an element, much like a button, that is placed on a menubar.
... only.
menulist - Archive of obsolete content
ty which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state.
...tabindex type: integer gets and sets the value of the tabindex attribute.
popupset - Archive of obsolete content
thods | related ] a container for menupopup, panel and tooltip elements.
... , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
richlistbox - Archive of obsolete content
election, scrolltoindex, selectall, selectitem, selectitemrange, timedselect, toggleitemselection examples <richlistbox> <richlistitem> <description>a xul description!</description> </richlistitem> <richlistitem> <button label="a xul button"/> </richlistitem> </richlistbox> the richlistbox element contains multiple richlistitem elements, which can contain any content.
...abindex type: integer gets and sets the value of the tabindex attribute.
tab - Archive of obsolete content
Archive › Mozilla › XUL › tab
« xul reference home [ examples | attributes | properties | methods | related ] a single tab which should be placed inside a tabs element.
...abindex type: integer gets and sets the value of the tabindex attribute.
tabbox - Archive of obsolete content
, selectedtab, tabs, tabpanels examples <tabbox id="mytablist" selectedindex="2"> <tabs> <tab label="a first tab"/> <tab label="second tab"/> <tab label="another tab"/> <tab label="last tab"/> </tabs> <tabpanels> <tabpanel><!-- tabpanel first elements go here --></tabpanel> <tabpanel><!-- tabpanel second elements go here --></tabpanel> <tabpanel><button label="click me"/></tabpanel> <tabpanel><!-- tabpanel fourth elements go here --></tabpanel> </tabpanels> </tabbox> attributes eventnode type: one of the values below indicates where keyboard navigation events are listened to.
...rently selected tab, which will always be one of the tab elements in the tabs element.
toolbarbutton - Archive of obsolete content
string the type of button.
... gets and sets the value of the open attribute.
toolbox - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a container for toolbars.
...ay of external toolbars; that is, toolbar elements that should be considered to be members of this toolbox, even if they are not actually children of the toolbox.
tree - Archive of obsolete content
Archive › Mozilla › XUL › tree
set to false, a drop-down will appear in the upper right corner of the tree, which the user may use to show and hide columns.
...plements nsitreeview to this property.
treecell - Archive of obsolete content
r the cell using the label attribute.
... , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
treeitem - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] a treeitem should be placed inside a treechildren element and should contain treerow elements.
... , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
XUL Explorer - Archive of obsolete content
e both available to help debug problems.
...toggled with the editor.
nsIContentPolicy - Archive of obsolete content
be loaded (the actual load triggered by the refresh will go through shouldload() as expected).
...nline}} the location of the resource that initiated this load request; can be null if inapplicable.
Extentsions FAQ - Archive of obsolete content
equest for a thunderbird extension that can automatically detect the default domain when composing e-mails via autodetect.
...imic the functionality of ie in this respect?
NPEvent - Archive of obsolete content
window being activate or deactivated.
...er clicks the instance or presses the tab key to focus the instance.
NPP_URLNotify - Archive of obsolete content
void* notifydata); parameters the function has the following parameters: instance pointer to the current plug-in instance.
...() after the completion of a npn_geturlnotify() or npn_posturlnotify() request to inform the plug-in that the request was completed and supply a reason code for the completion.
Plugins - Archive of obsolete content
ferent from extensions, which modify or enhance the functionality of the browser itself.
...ins, which plug additional search engines in the search bar.
Vulnerabilities - Archive of obsolete content
g the possibility of someone violating the trust assumptions to compromise security.
...ders html content in email messages.
Creating a Skin for Firefox - Archive of obsolete content
r firefox, there are three things you need to know: how to edit images, how to extract zip files, and how to modify css.
...it images, how to extract zip files, and how to modify css.
Using Firebug and jQuery (Screencast) - Archive of obsolete content
note: this screencast is originally from: http://ejohn.org/blog/hacking-digg-w...ug-and-jquery/ this is an adaptation of a presentation that i gave while at mashup camp boston.
...ve while at mashup camp boston.
-ms-filter - Archive of obsolete content
getransform.microsoft.motionblur(strength=50) progid:dximagetransform.microsoft.basicimage(mirror=1)" src="/workshop/samples/author/dhtml/graphics/cone.jpg" height="80px" width="80px" alt="cone"> the following example shows how to use scripting to set the filter on an image.
...="sphere"> <div id="filterto" style="position: absolute; width: 200px; height: 250px; top: 20px; left: 20px; background: white; visibility: hidden;"> </div> </div> <script type="text/javascript"> let filterimg = document.queryselector('#filterfrom'); filterimg.addeventlistener('click', dofilter); function dofilter () { filterfrom.filters.item(0).apply(); // 12 is the dissolve filter.
Troubleshooting XForms Forms - Archive of obsolete content
atest release of the extension.
...submit to a different domain than the form is loaded from, make sure that you have allowed cross-domain submission for that specific "form domain".
XForms Input Element - Archive of obsolete content
ted will 'drop down' a calender widget that the user can also interact with (xhtml/xul).
...e: xsd:integer xsd:nonpositiveinteger xsd:negativeinteger xsd:long xsd:int xsd:short xsd:byte xsd:nonnegativeinteger xsd:unsignedlong xsd:unsignedint xsd:unsignedshort xsd:unsignedbyte xsd:positiveinteger analogous widget is <xul:textbox type="number"/> (will be available in fx 3.0) specific handling of attributes incremental - if "true", the bound instance node will be updated when the user clicks on the up or down spin buttons or directly edits the field and then sets focus elsewhere.
XForms Trigger Element - Archive of obsolete content
r element doesn't interact with the data in the bound node.
...he xforms trigger element can be represented by the following widgets for the specified appearance attribute values: button - default representation (xhtml/xul) link/clickable text - used when appearance = 'minimal' (xhtml only) button displaying a button is the default presentation (xhtml/xul).
Mozilla XForms User Interface - Archive of obsolete content
with the mediatype element to display the image.
... user to initiate actions (see the spec).
The Business Benefits of Web Standards - Archive of obsolete content
sults, web standards pages index and rank properly (where they deserve to) across all search engines.
... coding gymnastics to cope with the vendors of browsers and other user agents.
Windows Media in Netscape - Archive of obsolete content
us, in order to deploy cross-platform code, avoiding syntax that makes use of global namespace is important.
... global namespace is important.
Visual-js game engine - Game development
ownloads http://www.textures4photoshop.com/ female body v3.blend this file has been released by andrescuccaro under the following license: creative commons attribution 3.0 about gui for windows (canvas2d part only) : windows gui application version 1.0 (using visual-js 0.9 lib) important : you will need net 4.5.2 minimum also redistribution pack for c++ how to start project ?
....9 lib) important : you will need net 4.5.2 minimum also redistribution pack for c++ how to start project ?
Index - MDN Web Docs Glossary: Definitions of Web-related terms
rowser renders the first bit of content from the dom, providing the first feedback to the user that the page is actually loading.
...pplication, telephony over ip like skype and conference technologies.
SQL Injection - MDN Web Docs Glossary: Definitions of Web-related terms
base or to retrieve information directly from the database.
...follows: "select count(*) from users where username=' admin ' and password=' passwd123 ' "; if the credentials are correct, then the user is allowed to log in, so it's a very simple (and therefore insecure) mechanism.
Getting started with CSS - Learn web development
d on state the final type of styling we shall take a look at in this tutorial is the ability to style things based on their state.
...hat to a better color?
Web fonts - Learn web development
g the font file(s) and licensing information).
... the required code (and font formats).
The HTML5 input types - Learn web development
eate search boxes on pages and apps.
...javascript plugins and libraries for some suggestions).
Example 4 - Learn web development
); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); selectlist.foreach(function (select) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (option) { option.addeventlistener('mouseover', function () { highlightoption(select, option); }); }); select.addeventlistener('click', function (event) { toggleoptlist(select); }); select.addeventlistener('focus', function (event) { activeselect(select, selectlist); }); select.addeventlistener('blur', function (event) { deactivateselect(select); }); }); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); selectlist.foreach(func...
...) { var selectlist = document.queryselectorall('.select'); selectlist.foreach(function (select) { var optionlist = select.queryselectorall('.option'), selectedindex = getindex(select); select.tabindex = 0; select.previouselementsibling.tabindex = -1; updatevalue(select, selectedindex); optionlist.foreach(function (option, index) { option.addeventlistener('click', function (event) { updatevalue(select, index); }); }); select.addeventlistener('keyup', function (event) { var length = optionlist.length, index = getindex(select); if (event.keycode === 27) { deactivateselect(select); } if (event.keycode === 40 && index < length - 1) { index++; } if (event.keycode === 38 && index > 0) { index--; } ...
UI pseudo-classes - Learn web development
hat pseudo-classes do we have available?
...ge then pops up in place of "required".
Publishing your website - Learn web development
o easily publish your site via github pages.
... address.
Images in HTML - Learn web development
98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solut...
... 98%; } body { margin: 10px; background: #f5f9fa; } var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var solution = document.getelementbyid('solution'); var output = document.queryselector('.output'); var code = textarea.value; var userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solut...
Making decisions in your code — conditionals - Learn web development
: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = jssolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solutio...
...: 0; text-align: right; font-size: 0.7rem; width: 98%; } body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); let code = textarea.value; let userentry = textarea.value; function updatecode() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = jssolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solutio...
Drawing graphics - Learn web development
with user input (like mouse movement, in this case).
...vent) ?
Silly story generator - Learn web development
ore the second set of three strings inside an array called inserty.
...et of three strings inside an array called insertz.
Client-Server Overview - Learn web development
ecause we haven't yet chosen a web framework to use to write our code!
...owser.
Introduction to the server side - Learn web development
sers of the site, sending notifications and updates via email or through other channels.
...o fully control their own data but only allow their friends to view or comment on it.
Starting our Svelte Todo list app - Learn web development
r can display this warning even before calling the compiler: you can tell svelte to ignore this warning for the next block of markup with a comment beginning with svelte-ignore, like this: <!-- svelte-ignore a11y-missing-attribute --> <img height="32" width="88" src="https://udn.realityripple.com/samples/b0/98dase3c7d.png"> note: with vscode you can automatically add this ignore comment by clicking on the quick fix...
...base.
Introducing a complete toolchain - Learn web development
oftware to a home on the web.
...lets us deploy multiple times a day and freely hosts static sites of all kinds.
Accessibility API cross-reference
in mozilla) grouping panel panel group <fieldset>, <div> a heading for a section of the page.
...nel panel group <fieldset>, <div> a heading for a section of the page.
Accessibility Features in Firefox
to move through web content one letter a time.
...large number of configuration options not available in the preferences window.
Mozilla’s UAAG evaluation report
rd access.
...(p1) vg we have some remaining bugs, and some keyboard usability issues, but in general mozilla now has keyboard equivalents for almost everything.
A bird's-eye view of the Mozilla framework
author: susan d.
... objects, and the nsifactory interface, provides api facilities clients can use to dynamically create xpcom components, and specifies the mechanism clients use to query an xpcom component for one of its interfaces, and to release the interface when it’s no longer needed.
Continuous Integration
ework, and denoted by the letter t.
...me as the correctness jobs.
HTTP logging
r bug occurs.
...t the list of modules that you want to log: this list has the exact same format as the moz_log environment variable (see below).
Firefox Operational Information Database: SQLite
a large amount of operational information about websites visited and browser configuration is stored in relational databases in sqlite used by firefox.
... a large amount of operational information about websites visited and browser configuration is stored in relational databases in sqlite used by firefox.
Overview of Mozilla embedding APIs
.
...rol tabbing order...
Internationalized Domain Names (IDN) Support in Mozilla Browsers
version to punycode is completed for these top domains: using netscape 7.1 or mozilla 1.4: type about:config into the location/url bar.
...hese preferences can be modified or new ones can be created without quitting the browser using the steps described below.
Mozilla Content Localized in Your Language
what are other widely used currency and symbols used in your country/language for paid apps.
...ding articles will help ensure that your translations will be accommodated within the user interface.
L10n testing with xcode
calization is a breeze.
...trings into the project by adding them to the project folder and replacing the existing strings.
MathML In Action
( ...
... </mfrac> </mrow> </mstyle> </math> </p> javascript content function zoomtoggle() { if (this.hasattribute("mathsize")) { this.removeattribute("mathsize"); } else { this.setattribute("mathsize", "200%"); } } function load() { document.getelementbyid("zoomablemath").
Various MathML Tests
x .
... try to explain what this means to those who care to read.
BloatView
vascript so you can sort the data by column).
...e bloats name file date blank blank.txt tue aug 29 14:17:40 2000 mozilla mozilla.txt tue aug 29 14:18:42 2000 yahoo yahoo.txt tue aug 29 14:19:32 2000 netscape netscape.txt tue aug 29 14:20:14 2000 the numbers do not include malloc 'd data such as string contents.
GC and CC logs
worker ccs.
...ll, which will log all ccs.
L20n HTML Bindings
in addition to the pre-defined whitelists, any element found in the original source html is allowed in the translation as well.
..."> the result will be: <p data-l10n-id="back"> <input value="save" type="submit"> or <a href="/main" class="btn-cancel" title="back to the homepage">cancel</a>.
Setting up CDT to work on SpiderMonkey
ownloads page.
...at cdt does not pick up yet: for everything to be indexed, cdt has to be aware of the project's build details.
WebReplayRoadmap
es intermittently.
...ented) it would be nice to be able to bookmark points in the recording so that they show up on the timeline and can be seeked to later.
Setting up an update server
ins the sha512 for that file as well as for all the other win64 files that are part of that nightly release).
...s.json: { "policies": { "appupdateurl": "http://127.0.0.1:8000/update.xml" } } now you are ready to update!
Gecko object attributes
d.
...tainer exposed in aria: aria-sort image related attributes src src attribute is placed on html image element.
History Service Design
visit properties.
...ocationbar queries.
Packaging WebLock
performinstall(); else cancelinstall(err); the weblock trigger script the trigger script is the script placed on a web page that actually initiates an xpinstall installation and calls the installation script that appears in the xpi.
...s called when the user clicks the hyperlink.
Using XPCOM Components
enumerator enumerate through the cookie list.
...e a given site from the whitelist.
nsIAccessibleHyperLink
or has to specify that the link is invalid via the aria-invalid='true' attribute.
... via javascript.
nsICookieService
cookiestring() will query the documenturi property off of nsihttpchannelinternal if supported, so getcookiestring() can be used in place of this method.
... also query the date header from the channel if achannel supports nsihttpchannel.
nsIDOMEvent
at_target 2 the event is currently being evaluated at the target eventtarget.
... is currently being evaluated at the target eventtarget.
nsIMsgWindowCommands
nsisupports last changed in gecko 1.9 (firefox 3) the javascript implementation of this used by thunderbird is given here.
...9 (firefox 3) the javascript implementation of this used by thunderbird is given here.
nsINavHistoryService
yped the url to get to the page.
... starts loading.
nsITaskbarPreviewButton
irefox 3.6 / thunderbird 3.1 / fennec 1.0) you can't directly instantiate this interface.
...rface.
nsITaskbarWindowPreview
ict with other internal gecko state management.
... window preview toolbars window previews may have a toolbar with up to seven buttons.
nsIXULBrowserWindow
void setjsstatus(in astring status); void setoverlink(in astring link, in nsidomelement element); methods onbeforelinktraversal() called before traversing a link to determine the appropriate target into which to load the link.
... is clicked in an app tab).
Creating a Custom Column
contain something similar to this: <?xml version="1.0"?> <overlay id="sample" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <tree id="threadtree"> <treecols id="threadcols"> <splitter class="tree-splitter" /> <treecol id="colreplyto" persist="hidden ordinal width" currentview="unthreaded" flex="2" label="reply-to" tooltiptext="click to sort by the reply-to header" /> </treecols> </tree> <!-- include our javascript file --> <script type="text/javascript" src="chrome://replyto_col/content/replyto_col.js"/> </overlay> that's it!
...flex="2" label="reply-to" tooltiptext="click to sort by the reply-to header" /> </treecols> </tree> <!-- include our javascript file --> <script type="text/javascript" src="chrome://replyto_col/content/replyto_col.js"/> </overlay> that's it!
Demo Addon
f it may no longer be relevant.
...emo add-on has been created by jonathan protzenko for his presentation at mozcamp 2011.
Using the Mozilla source server
mozillabuild has problems, use this one instead) note: do not use the cvs from mozillabuild, it will not work!
...follow the instructions for using the mozilla symbol server.
Mozilla
n firefox, and other topics.
...perational information about websites visited and browser configuration is stored in relational databases in sqlite used by firefox.
Plugin Roadmap for Firefox - Plugins
the last remaining npapi plugin, adobe flash, has announced an end-of-life plan.
...saying goodbye to our old friend npapi may 2014 - update on npapi deprecation november 2014 - the final countdown for npapi august 2016 - flash and chrome december 2016 - roll-out plan for html5 by default july 2017 - saying goodbye to flash in chrome microsoft edge and internet explorer april 2016 - putting users in control of flash december 2016 - extending user control of flash with click-to-run july 2017 - flash on windows timeline august 2019 - update on removing flash from microsoft edge and internet explorer apple safari june 2016 - next steps for legacy plug-ins july 2017 - adobe announces flash distribution and updates to end ...
Disable breakpoints - Firefox Developer Tools
to disable a single breakpoint, uncheck the checkbox next to it in the breakpoints list.
... to disable a single breakpoint, uncheck the checkbox next to it in the breakpoints list.
Highlight and inspect DOM nodes - Firefox Developer Tools
if you hover over a dom node in the watch expresions, it will be highlighted in the page.
...view it in the page inspector.
Ignore a source - Firefox Developer Tools
’t care about the internal implementation of these libraries.
...ng sessions when you are forced to step through its stack frames in order to reach your own code.
Search - Firefox Developer Tools
he debugger will display the number of matches in the code and highlight each result: using the outline tab if you are searching for a specific function within the current javascript file, you can use the outline tab in the debugger to find it quickly.
...ctions, it comes in handy.
Set watch expressions - Firefox Developer Tools
when debugging code, sometimes it's useful to watch expressions as executions are paused.
...ssion you'd like to watch into the text field.
Set a logpoint - Firefox Developer Tools
le console.log() statements throughout your code, you can use a special type of breakpoint, the logpoint.
...ather than the blue of an unconditional breakpoint or the orange of a conditional breakpoint.
Edit fonts - Firefox Developer Tools
nt hosted on your system.
...file by clicking on the icon to the right of the url.
Paint Flashing Tool - Firefox Developer Tools
ing it to trigger more repaints, and for more of the screen, than necessary.
...t, the above page looks like this: in this example, there are two main sources of repaints: moving the mouse over links makes the browser repaint them, because they have a style applied using the :hover pseudo-class scrolling makes the browser repaint the new part of the page coming into view at the bottom of the screen, and also the scrollbar at the top-right to deactivate paint flashing, click the "highlight painted area" icon in the toolbox again.
Call Tree - Firefox Developer Tools
y are called very often.
...ails, check "show gecko platform data" in the settings.
Flame Chart - Firefox Developer Tools
to navigate it.
...e chart: zoom: increase/decrease the selected portion of the complete profile that's displayed in the flame chart 1) mouse wheel up/down in the flame chart.
UI Tour - Firefox Developer Tools
re displayed in the waterfall view switch the active tool in the details pane.
...details pane.
Local Storage / Session Storage - Firefox Developer Tools
when an origin corresponding to local storage or session storage is selected within the storage inspector, the names and values of all the items corresponding to local storage or session storage will be listed in a table.
...isted in a table.
Firefox Developer Tools
r tools from the menu by selecting tools > web developer > toggle tools or use the keyboard shortcut ctrl + shift + i or f12 on windows and linux, or cmd + opt + i on macos.
...12 on windows and linux, or cmd + opt + i on macos.
AbortController.AbortController() - Web APIs
e {signal}, below).
...d controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener.
AbortController.abort() - Web APIs
e {signal}, below).
...d controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener.
AbortController.signal - Web APIs
e {signal}, below).
...d controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener.
AbortController - Web APIs
e {signal}, below).
...d controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener.
AbortSignal - Web APIs
e {signal}, below).
...d controller with the fetch request and allows us to abort it by calling abortcontroller.abort(), as seen below in the second event listener.
Animation.play() - Web APIs
Web › API › Animation › play
the play() method of the web animations api's animation interface starts or resumes playing of an animation.
...s its own animation: var nommingcake = document.getelementbyid('eat-me_sprite').animate( [ { transform: 'translatey(0)' }, { transform: 'translatey(-80%)' } ], { fill: 'forwards', easing: 'steps(4, end)', duration: alicechange.effect.timing.duration / 2 }); // pause the cake's animation so it doesn't play immediately.
Attr.localName - Web APIs
Web › API › Attr › localName
.localname read-only property returns the local part of the qualified name of an attribute.
...cations this api was defined within the node interface.
AudioContext.close() - Web APIs
ing resources have been released.
...ocontext.
AudioContext.resume() - Web APIs
_err exception to be thrown if called on an offlineaudiocontext.
...context has already been closed.
AudioContext.suspend() - Web APIs
tate_err exception to be thrown if called on an offlineaudiocontext.
...context has already been closed.
AudioTrackList: change event - Web APIs
y onchange examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.audiotracks.addeventlistener('change', (event) => { console.log(`'${event.type}' event fired`); }); // changing the value of `enabled` will trigger the `change` event const toggletrackbutton = document.queryselector('.toggle-track'); toggletrackbutton.addeventlistener('click', () => { const track = videoelement.audiotracks[0]; track.enabled = !track.enabled; }); using the onchange event handler property: const videoelement = document.queryselector('video'); videoelement.audiotracks.onchange = (event) => { console.log(`'${event.type}' event fired`); }; // changing the value of `enabled` will trigger the `change` event const toggletrackbutton = document.que...
...nabled = !track.enabled; }); using the onchange event handler property: const videoelement = document.queryselector('video'); videoelement.audiotracks.onchange = (event) => { console.log(`'${event.type}' event fired`); }; // changing the value of `enabled` will trigger the `change` event const toggletrackbutton = document.queryselector('.toggle-track'); toggletrackbutton.addeventlistener('click', () => { const track = videoelement.audiotracks[0]; track.enabled = !track.enabled; }); specifications specification status html living standardthe definition of 'change' in that specification.
Background Tasks API - Web APIs
you wish to perform during idle time.
...ff() { totaltaskcount = 0; currenttasknumber = 0; updatedisplay(); let n = getrandomintinclusive(100, 200); for (i=0; i<n; i++) { let taskdata = { count: getrandomintinclusive(75, 150), text: "this text is from task number " + (i+1).tostring() + " of " + n }; enqueuetask(logtaskhandler, taskdata); } } document.getelementbyid("startbutton").addeventlistener("click", decodetechnostuff, false); decodetechnostuff() starts by zeroing the values of totaltaskcount (the number of tasks added to the queue so far) and currenttasknumber (the task currently being run), and then calls updatedisplay() to reset the display to its "nothing's happened yet" state.
BaseAudioContext.createDelay() - Web APIs
buttons, the loops will start immediately; if you slide the sliders up to the right, then press the play buttons, a delay will be introduced, so the looping sounds don't start playing for a short amount of time.
...ar audioctx = new audiocontext(); var synthdelay = audioctx.createdelay(5.0); ...
BaseAudioContext.createGain() - Web APIs
ode = audiocontext.creategain(); return value a gainnode which takes as input one or more audio sources and outputs audio whose volume has been adjusted in gain (volume) to a level specified by the node's gainnode.gain a-rate parameter.
... audio: true }, // success callback function(stream) { source = audioctx.createmediastreamsource(stream); }, // error callback function(err) { console.log('the following gum error occured: ' + err); } ); } else { console.log('getusermedia not supported on your browser!'); } source.connect(gainnode); gainnode.connect(audioctx.destination); ...
Blob - Web APIs
Web › API › Blob
f a typed array the following code creates a javascript typed array and creates a new blob containing the typed array's data.
...pedarraytourl(typedarray, mimetype) { return url.createobjecturl(new blob([typedarray.buffer], {type: mimetype})) } const bytes = new uint8array(59); for(let i = 0; i < 59; i++) { bytes[i] = 32 + i; } const url = typedarraytourl(bytes, 'text/plain'); const link = document.createelement('a'); link.href = url; link.innertext = 'open the array url'; document.body.appendchild(link); result click the link in the example to see the browser decode the object url.
Body.arrayBuffer() - Web APIs
Web › API › Body › arrayBuffer
successful, we read an arraybuffer out of the response using arraybuffer(), decode the audio data using audiocontext.decodeaudiodata, set the decoded data as the audio buffer source's buffer (source.buffer), then connect the source up to the audiocontext.destination.
...rce = audioctx.createbuffersource(); var myrequest = new request('viper.ogg'); fetch(myrequest).then(function(response) { return response.arraybuffer(); }).then(function(buffer) { audioctx.decodeaudiodata(buffer, function(decodeddata) { source.buffer = decodeddata; source.connect(audioctx.destination); }); }); }; // wire up buttons to stop and play audio play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); } reading files the response() constructor accepts files and blobs, so it may be used to read a file into other formats.
BroadcastChannel: message event - Web APIs
the message event is fired on a broadcastchannel object when a message arrives on that channel.
...s-serif; margin-bottom: 1rem; } textarea { padding: .2rem; } label, br { margin: .5rem 0; } button { vertical-align: top; height: 1.5rem; } const channel = new broadcastchannel('example-channel'); const messagecontrol = document.queryselector('#message'); const broadcastmessagebutton = document.queryselector('#broadcast-message'); broadcastmessagebutton.addeventlistener('click', () => { channel.postmessage(messagecontrol.value); }) receiver 1 <h1>receiver 1</h1> <div id="received"></div> body { border: 1px solid black; padding: .5rem; height: 100px; font-family: "fira sans", sans-serif; } h1 { font: 1.6em "fira sans", sans-serif; margin-bottom: 1rem; } const channel = new broadcastchannel('example-channel'); channel.addeventlistener...
CanvasRenderingContext2D.drawFocusIfNeeded() - Web APIs
on1">continue</button> <button id="button2">quit</button> </canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); const button1 = document.getelementbyid('button1'); const button2 = document.getelementbyid('button2'); document.addeventlistener('focus', redraw, true); document.addeventlistener('blur', redraw, true); canvas.addeventlistener('click', handleclick, false); redraw(); function redraw() { ctx.clearrect(0, 0, canvas.width, canvas.height); drawbutton(button1, 20, 20); drawbutton(button2, 20, 80); } function handleclick(e) { // calculate click coordinates const x = e.clientx - canvas.offsetleft; const y = e.clienty - canvas.offsettop; // focus button1, if appropriate drawbutton(button1, 20, 20); if (ctx.ispoint...
...veelement === el; const width = 150; const height = 40; // button background ctx.fillstyle = active ?
Advanced animations - Web APIs
ll.vx; } raf = window.requestanimationframe(draw); } canvas.addeventlistener('mouseover', function(e) { raf = window.requestanimationframe(draw); }); canvas.addeventlistener('mouseout', function(e) { window.cancelanimationframe(raf); }); ball.draw(); adding mouse control to get some control over the ball, we can make it follow our mouse using the mousemove event, for example.
...all.vy > canvas.height || ball.y + ball.vy < 0) { ball.vy = -ball.vy; } if (ball.x + ball.vx > canvas.width || ball.x + ball.vx < 0) { ball.vx = -ball.vx; } raf = window.requestanimationframe(draw); } canvas.addeventlistener('mousemove', function(e) { if (!running) { clear(); ball.x = e.clientx; ball.y = e.clienty; ball.draw(); } }); canvas.addeventlistener('click', function(e) { if (!running) { raf = window.requestanimationframe(draw); running = true; } }); canvas.addeventlistener('mouseout', function(e) { window.cancelanimationframe(raf); running = false; }); ball.draw(); move the ball using your mouse and release it with a click.
Basic animations - Web APIs
/canvas> </body> </html> output snake game <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>nokia 1100:snake..member berries</title> </head> <body> <div class="keypress hide"> <div class="up" onclick="emit(38)">&#8593;</div> <div class="right" onclick="emit(39)">&#8594;</div> <div class="left" onclick="emit(37)">&#8592;</div> <div class="down" onclick="emit(40)">&#8595;</div> </div> <div class="banner" id="selector"> <div> time :<span id="time">0</span> </div> <div>lousygames ©</div> <div> score :<span id...
...(39)">&#8594;</div> <div class="left" onclick="emit(37)">&#8592;</div> <div class="down" onclick="emit(40)">&#8595;</div> </div> <div class="banner" id="selector"> <div> time :<span id="time">0</span> </div> <div>lousygames ©</div> <div> score :<span id="score">0</span> </div> <div class="touch off" onclick="touch(this)">touch</div> </div> <canvas id="main"></canvas> </body> <style> body { margin: 0; overflow: hidden; background: #000 } .banner { text-align: center; color: #fff; background: #3f51b5; line-height: 29px; position: fixed; left: 0; top: 0; right: 0; font-family: monospace;...
Client.url - Web APIs
Web › API › Client › url
the url read-only property of the client interface returns the url of the current service worker client.
... the url read-only property of the client interface returns the url of the current service worker client.
Clients - Web APIs
Web › API › Clients
ptions argument allows you to control the types of clients returned.
...ents returned.
console - Web APIs
Web › API › Console
o("my first car was a", car, ".
...uration of a specific operation.
ConstantSourceNode.offset - Web APIs
); constantsource.connect(gainnode2.gain); constantsource.connect(gainnode3.gain); first, the gain nodes are created and configured, and a slider control's value is set to match the gain on the two nodes.
...two nodes.
DelayNode.delayTime - Web APIs
buttons, the loops will start immediately; if you slide the sliders up to the right, then press the play buttons, a delay will be introduced, so the looping sounds don't start playing for a short amount of time.
...ar audioctx = new audiocontext(); var synthdelay = audioctx.createdelay(5.0); ...
DelayNode - Web APIs
Web › API › DelayNode
buttons, the loops will start immediately; if you slide the sliders up to the right, then press the play buttons, a delay will be introduced, so the looping sounds don't start playing for a short amount of time.
...ar audioctx = new audiocontext(); var synthdelay = audioctx.createdelay(5.0); ...
DeprecationReportBody - Web APIs
senting the column in the source file in which the deprecated feature was used, if known, or null otherwise.
... reportbtn.onclick = () => displayreports(reports); }, options); we then tell it to start observing reports using reportingobserver.observe(); this tells the observer to start collecting reports in its report queue, and runs the callback function specified inside the constructor: observer.observe(); because of the event handler we set up inside the reportingobserver() constructor, we can now click the button to display the report details.
Document.caretRangeFromPoint() - Web APIs
he document fragment under the specified coordinates.
...ner; offset = range.startoffset; } // only split text_nodes if (textnode && textnode.nodetype == 3) { let replacement = textnode.splittext(offset); let br = document.createelement('br'); textnode.parentnode.insertbefore(br, replacement); } } let paragraphs = document.getelementsbytagname("p"); for (let i = 0; i < paragraphs.length; i++) { paragraphs[i].addeventlistener('click', insertbreakatpoint, false); } result ...
Document.exitFullscreen() - Web APIs
tpromise = document.exitfullscreen(); parameters none.
...een(); parameters none.
Document.getElementById() - Web APIs
ocate.
...within the document; only one element may have any given id.
Document.getElementsByTagName() - Web APIs
sbytagname() starts from a particular parent element and searches top-down recursively through the dom from that parent element, building a collection of all descendant elements which match the tag name parameter.
...yle="border: solid green 3px"> <p>some outer text</p> <p>some outer text</p> <div id="div1" style="border: solid blue 3px"> <p>some div1 text</p> <p>some div1 text</p> <p>some div1 text</p> <div id="div2" style="border: solid red 3px"> <p>some div2 text</p> <p>some div2 text</p> </div> </div> <p>some outer text</p> <p>some outer text</p> <button onclick="getallparaelems();"> show all p elements in document</button><br /> <button onclick="div1paraelems();"> show all p elements in div1 element</button><br /> <button onclick="div2paraelems();"> show all p elements in div2 element</button> </body> </html> notes when called on an html document, getelementsbytagname() lower-cases its argument before proceeding.
Document.hasFocus() - Web APIs
Web › API › Document › hasFocus
.
...focus(); return value false if the active element in the document has no focus; true if the active element in the document has focus.
DocumentOrShadowRoot.caretPositionFromPoint() - Web APIs
terface returns a caretposition object, containing the dom node, along with the caret and caret's character offset within that node.
...ange.startoffset; } // only split text_nodes if (textnode.nodetype == 3) { var replacement = textnode.splittext(offset); var br = document.createelement('br'); textnode.parentnode.insertbefore(br, replacement); } } window.onload = function (){ var paragraphs = document.getelementsbytagname("p"); for (i=0 ; i < paragraphs.length; i++) { paragraphs[i].addeventlistener("click", insertbreakatpoint, false); } }; specifications specification status comment css object model (cssom) view modulethe definition of 'caretpositionfrompoint()' in that specification.
DocumentOrShadowRoot.elementFromPoint() - Web APIs
ated under the coordinates (2, 2).
...ion changecolor(newcolor) { elem = document.elementfrompoint(2, 2); elem.style.color = newcolor; } the changecolor() method simply obtains the element located at the specified point, then sets that element's current foreground color property to the color specified by the newcolor parameter.
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
ersions of firefox and ie 5+.
...mple: setting the background color of a paragraph getelementsbytagname(tagnamevalue) is a method available in any dom element or the root document element.
Element: MSGestureTap event - Web APIs
the msgesturetap event is fired when the user "taps" the pointing device (e.g., touches the touch surface with their finger, taps the touch surface with a pen device, clicks with a mouse).
... the msgesturetap event is fired when the user "taps" the pointing device (e.g., touches the touch surface with their finger, taps the touch surface with a pen device, clicks with a mouse).
Element: compositionend event - Web APIs
bles yes cancelable yes interface compositionevent event handler property none examples const inputelement = document.queryselector('input[type="text"]'); inputelement.addeventlistener('compositionend', (event) => { console.log(`generated characters were: ${event.data}`); }); live example html <div class="control"> <label for="name">on macos, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label> <input type="text" id="example" name="example"> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="25"></textarea> <button class="clear-log">clear</button> </div> css body { padding: .2rem; display: grid; grid-templat...
...nts { resize: none; } label, button { display: block; } input[type="text"] { margin: .5rem 0; } kbd { border-radius: 3px; padding: 1px 2px 0; border: 1px solid black; } js const inputelement = document.queryselector('input[type="text"]'); const log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textcontent = ''; }); function handleevent(event) { log.textcontent = log.textcontent + `${event.type}: ${event.data}\n`; } inputelement.addeventlistener('compositionstart', handleevent); inputelement.addeventlistener('compositionupdate', handleevent); inputelement.addeventlistener('compositionend', handleevent); result specifications specification status...
Element: compositionstart event - Web APIs
es yes cancelable yes interface compositionevent event handler property none examples const inputelement = document.queryselector('input[type="text"]'); inputelement.addeventlistener('compositionstart', (event) => { console.log(`generated characters were: ${event.data}`); }); live example html <div class="control"> <label for="name">on macos, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label> <input type="text" id="example" name="example"> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="25"></textarea> <button class="clear-log">clear</button> </div> css body { padding: .2rem; display: grid; grid-templat...
...nts { resize: none; } label, button { display: block; } input[type="text"] { margin: .5rem 0; } kbd { border-radius: 3px; padding: 1px 2px 0; border: 1px solid black; } js const inputelement = document.queryselector('input[type="text"]'); const log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textcontent = ''; }); function handleevent(event) { log.textcontent = log.textcontent + `${event.type}: ${event.data}\n`; } inputelement.addeventlistener('compositionstart', handleevent); inputelement.addeventlistener('compositionupdate', handleevent); inputelement.addeventlistener('compositionend', handleevent); result specifications specification status...
Element: compositionupdate event - Web APIs
s yes cancelable yes interface compositionevent event handler property none examples const inputelement = document.queryselector('input[type="text"]'); inputelement.addeventlistener('compositionupdate', (event) => { console.log(`generated characters were: ${event.data}`); }); live example html <div class="control"> <label for="name">on macos, click in the textbox below,<br> then type <kbd>option</kbd> + <kbd>`</kbd>, then <kbd>a</kbd>:</label> <input type="text" id="example" name="example"> </div> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents" rows="8" cols="25"></textarea> <button class="clear-log">clear</button> </div> css body { padding: .2rem; display: grid; grid-templat...
...nts { resize: none; } label, button { display: block; } input[type="text"] { margin: .5rem 0; } kbd { border-radius: 3px; padding: 1px 2px 0; border: 1px solid black; } js const inputelement = document.queryselector('input[type="text"]'); const log = document.queryselector('.event-log-contents'); const clearlog = document.queryselector('.clear-log'); clearlog.addeventlistener('click', () => { log.textcontent = ''; }); function handleevent(event) { log.textcontent = log.textcontent + `${event.type}: ${event.data}\n`; } inputelement.addeventlistener('compositionstart', handleevent); inputelement.addeventlistener('compositionupdate', handleevent); inputelement.addeventlistener('compositionend', handleevent); result specifications specification status...
Element.insertAdjacentText() - Web APIs
ons exception explanation syntaxerror the position specified is not a recognised value.
...value.
Element.part - Web APIs
Web › API › Element › part
list.
...part attribute is used to find the shadow parts, and the part property is then used to change the part identifiers of each tab so the correct styling is applied to the active tab when tabs are clicked.
Element.scrollLeft - Web APIs
s any integer value.
...e maximum.
Element: show event - Web APIs
the show event is fired when a contextmenu event was fired on/bubbled to an element that has a contextmenu attribute.
... the show event is fired when a contextmenu event was fired on/bubbled to an element that has a contextmenu attribute.
Comparison of Event Targets - Web APIs
targetting of the event for some reason <small> event.originaltarget</small> contains the target before retargetting (may contain anonymous targets)</td> </tr> </thead> <tr> <td id="target"></td> <td id="currenttarget"></td> <td id="relatedtarget"></td> <td id="explicitoriginaltarget"></td> <td id="originaltarget"></td> </tr> </table> <p>clicking on the text will show the difference between explicitoriginaltarget, originaltarget, and target</p> <script> function handleclicks(e) { document.getelementbyid('target').innerhtml = e.target; document.getelementbyid('currenttarget').innerhtml = e.currenttarget; document.getelementbyid('relatedtarget').innerhtml = e.relatedtarget; document.getelementbyid('exp...
...t; document.getelementbyid('explicitoriginaltarget').innerhtml = e.explicitoriginaltarget; document.getelementbyid('originaltarget').innerhtml = e.originaltarget; } function handlemouseover(e) { document.getelementbyid('target').innerhtml = e.target; document.getelementbyid('relatedtarget').innerhtml = e.relatedtarget; } document.addeventlistener('click', handleclicks, false); document.addeventlistener('mouseover', handlemouseover, false); </script> </body> </html> use of target and relatedtarget the relatedtarget property for the mouseover event holds the node that the mouse was previously over.
Event.cancelable - Web APIs
Web › API › Event › cancelable
ed.
...ill be false and the event listener cannot stop the event from occurring.
Event.composedPath() - Web APIs
er(); let pelem = document.createelement('p'); pelem.textcontent = this.getattribute('text'); let shadowroot = this.attachshadow({mode: 'open'}) .appendchild(pelem); } }); we then insert one of each element into our page: <open-shadow text="i have an open shadow root"></open-shadow> <closed-shadow text="i have a closed shadow root"></closed-shadow> then include a click event listener on the <html> element: document.queryselector('html').addeventlistener('click',function(e) { console.log(e.composed); console.log(e.composedpath()); }); when you click on the <open-shadow> element and then the <closed-shadow> element, you'll notice two things.
...ave a closed shadow root"></closed-shadow> then include a click event listener on the <html> element: document.queryselector('html').addeventlistener('click',function(e) { console.log(e.composed); console.log(e.composedpath()); }); when you click on the <open-shadow> element and then the <closed-shadow> element, you'll notice two things.
Event.defaultPrevented - Web APIs
and false indicates that it was not.
...ventdefault(); } function logclick(event) { const log = document.getelementbyid('log'); if (event.target.tagname === 'a') { if (event.defaultprevented) { log.innertext = 'sorry, but you cannot visit this link!\n' + log.innertext; } else { log.innertext = 'visiting link...\n' + log.innertext; } } } const a = document.getelementbyid('link2'); a.addeventlistener('click', stoplink); document.addeventlistener('click', logclick); result specifications specification status comment domthe definition of 'event.defaultprevented()' in that specification.
Event.target - Web APIs
Web › API › Event › target
target = someevent.target; value eventtarget example the event.target property can be used in order to implement event delegation.
... = document.createelement('li'); const li2 = document.createelement('li'); ul.appendchild(li1); ul.appendchild(li2); function hide(evt) { // e.target refers to the clicked <li> element // this is different than e.currenttarget, which would refer to the parent <ul> in this context evt.target.style.visibility = 'hidden'; } // attach the listener to the list // it will fire when each <li> is clicked ul.addeventlistener('click', hide, false); specifications specification status comment domthe definition of 'event.target' in that specification.
GainNode.gain - Web APIs
Web › API › GainNode › gain
of gain to apply.
... audio: true }, // success callback function(stream) { source = audioctx.createmediastreamsource(stream); }, // error callback function(err) { console.log('the following gum error occured: ' + err); } ); } else { console.log('getusermedia not supported on your browser!'); } source.connect(gainnode); gainnode.connect(audioctx.destination); ...
GlobalEventHandlers.onanimationcancel - Web APIs
ncel event, as set up in the html above.
...t find other use cases, such as starting a new animation or effect, or terminating some dependent operation.
GlobalEventHandlers.onblur - Web APIs
indow.
...rgument.
GlobalEventHandlers.onchange - Web APIs
the onchange property of the globaleventhandlers mixin is an eventhandler for processing change events.
...tion to an element's value.
GlobalEventHandlers.onfocus - Web APIs
e building keyboard accessibility back in for more details).
...rgument.
HTMLButtonElement - Web APIs
ement.autofocus is a boolean indicating whether or not the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control.
...e response that is received after submitting the form.
HTMLCanvasElement.mozGetAsFile() - Web APIs
lue a file object representing the image contained in the canvas.
...dataurl() method.
HTMLDialogElement: cancel event - Web APIs
the cancel event fires on a <dialog> when the user instructs the browser that they wish to dismiss the current open dialog.
...alog">open dialog</button> <div class="result"></div> css button, div { margin: .5rem; } js const result = document.queryselector('.result'); const dialog = document.queryselector('.example-dialog'); dialog.addeventlistener('cancel', (event) => { result.textcontent = 'dialog was canceled'; }); const opendialog = document.queryselector('.open-dialog'); opendialog.addeventlistener('click', () => { if (typeof dialog.showmodal === 'function') { dialog.showmodal(); result.textcontent = ''; } else { result.textcontent = 'the dialog api is not supported by this browser'; } }); const closebutton = document.queryselector('.close'); closebutton.addeventlistener('click', () => { dialog.close(); }); result specifications specification status ...
accessKeyLabel - Web APIs
nt.accesskeylabel read-only property returns a string that represents the element's assigned access key (if any); otherwise it returns an empty string.
...t's assigned access key (if any); otherwise it returns an empty string.
HTMLElement - Web APIs
methods inherits methods from its parent, element, and implements those from documentandelementeventhandlers, elementcssinlinestyle, globaleventhandlers, htmlorforeignelement and toucheventhandlers.
...ods from its parent, element, and implements those from documentandelementeventhandlers, elementcssinlinestyle, globaleventhandlers, htmlorforeignelement and toucheventhandlers.
HTMLImageElement.isMap - Web APIs
ly avoid using server-side image maps, as they require the use of a mouse.
... syntax htmlimageelement.ismap = true|false; let ismap = htmlimageelement.ismap; value a boolean value which is true if the image is being used for a server-side image map; otherwise, the value is false.
HTMLImageElement - Web APIs
ger value that reflects the height html attribute, indicating the rendered height of the image in css pixels.
... the srcset page for specifics on the format of the size substring.
HTMLInputElement.setRangeText() - Web APIs
s current selection).
...d text.
HTMLInputElement.stepDown() - Web APIs
in.
..." min="0" max="400"> </label> </p> <p> <label>enter how many values of step you would like to increment by or leave it blank: <input type="number" step="1" id="decrementer" min="-2" max="15"> </label> </p> <input type="button" value="decrement" id="thebutton"> javascript /* make the button call the function */ let button = document.getelementbyid('thebutton'); button.addeventlistener('click', function() { stepondown();} ); function stepondown() { let input = document.getelementbyid('thenumber'); let val = document.getelementbyid('decrementer').value; if (val) { /* increment with a parameter */ input.stepdown(val); } else { /* or without a parameter.
HTMLInputElement.stepUp() - Web APIs
erefore does not support the step attribute (see the list of supported input types in the the table above), or if the step value is set to any, an invalidstateerror exception is thrown.
...er" min="0" max="400"> </label> </p> <p> <label>enter how many values of step you would like to increment by or leave it blank: <input type="number" step="1" id="incrementer" min="0" max="25"> </label> </p> <input type="button" value="increment" id="thebutton"> javascript /* make the button call the function */ let button = document.getelementbyid('thebutton') button.addeventlistener('click', function() { steponup() }) function steponup() { let input = document.getelementbyid('thenumber') let val = document.getelementbyid('incrementer').value if (val) { /* increment with a parameter */ input.stepup(val) } else { /* or without a parameter.
HTMLMediaElement.captureStream() - Web APIs
ndered in the media element.
...mple in this example, an event handler is established so that clicking a button starts capturing the contents of a media element with the id "playback" into a mediastream.
HTMLSelectElement.disabled - Web APIs
the htmlselectelement.disabled is a boolean that reflects the disabled html attribute, which indicates whether the control is disabled.
... the htmlselectelement.disabled is a boolean that reflects the disabled html attribute, which indicates whether the control is disabled.
The HTML DOM API - Web APIs
ment, as well as from node and, finally, eventtarget.
... document interface's getelementbyid() method to get the dom object representing the <input> elements whose ids are username and sendbutton.
Drag Operations - Web APIs
draggable attribute in a web page, there are certain cases where a default drag behavior is used.
...tead the text would be selected.
History.replaceState() - Web APIs
working with the history api article.
...ipt: history.replacestate(stateobj, '', 'bar2.html'); this will cause the url bar to display https://www.mozilla.org/bar2.html, but won't cause the browser to load bar2.html or even check that bar2.html exists.
History - Web APIs
Web › API › History
n.
...asynchronous method goes to the previous page in session history, the same action as when the user clicks the browser's back button.
Ajax navigation example - Web APIs
ocesslink () { if (this.classname === sajaxclass) { requestpage(this.href); return false; } return true; } function init () { opageinfo.title = document.title; history.replacestate(opageinfo, opageinfo.title, opageinfo.url); for (var olink, nidx = 0, nlen = document.links.length; nidx < nlen; document.links[nidx++].onclick = processlink); } const /* customizable constants */ stargetid = "ajax-content", sviewkey = "view_as", sajaxclass = "ajax-nav", /* not customizable constants */ rsearch = /\?.*$/, rhost = /^[^\?]*\?*&*/, rview = new regexp("&" + sviewkey + "\\=[^&]*|&*$", "i"), rendqstmark = /\?$/, oloadingbox = document.createelement("div"), ocover = document.cr...
...p version not supported", 506: "variant also negotiates (experimental)", 507: "insufficient storage", 508: "loop detected", 509: "unassigned", 510: "not extended", 511: "network authentication required" }; var oreq, bisloading = false, bupdateurl = false; oloadingbox.id = "ajax-loader"; ocover.onclick = abortreq; oloadingimg.src = "data:image/gif;base64,r0lgodlheaaqapiaap///waaamlcwkjcqgaaagjiyokcgpkskih/c05fvfndqvbfmi4waweaaaah/hpdcmvhdgvkihdpdgggywphegxvywquaw5mbwah+qqjcgaaacwaaaaaeaaqaaadmwi63p4wyklre2mioggznadomgyjrbexwroumcg2lmdewnhqlvsyod2mbzkydadka+diaaah+qqjcgaaacwaaaaaeaaqaaadnai63p5ojcegg4qmu7dmikrxqlfuydezigbmrvsaqhwctxxf7weyb4ag1xjihkmzsiukkhiaifkecqoaaaasaaaaabaaeaaaazyiujijk8...
History API - Web APIs
s useful methods and properties that let you navigate back and forth through the user's history, and manipulate the contents of the history stack.
...anipulate the contents of the history stack.
KeyboardEvent.code - Web APIs
a, sans-serif; border: 1px solid black; } javascript window.addeventlistener("keydown", function(event) { let str = "keyboardevent: key='" + event.key + "' | code='" + event.code + "'"; let el = document.createelement("span"); el.innerhtml = str + "<br/>"; document.getelementbyid("output").appendchild(el); }, true); try it out to ensure that keystrokes go to the sample, click in the output box below before pressing keys.
...); break; case "keya": case "arrowleft": // handle "turn left" angle -= turnrate; break; case "keyd": case "arrowright": // handle "turn right" angle += turnrate; break; } refresh(); // consume the event so it doesn't get handled twice event.preventdefault(); }, true); try it out to ensure that keystrokes go to the sample code, click inside the black game play field below before pressing keys.
KeyboardEvent.metaKey - Web APIs
e ⌘ command key.
...dows keyboards, this is the windows key (⊞ windows).
MediaDevices.ondevicechange - Web APIs
time the device list changes.
... javascript content other code below is other code which, while needed to make this example work, isn'tt related directly to ondevicechange, so we won't go into any detail.
MediaSession.setActionHandler() - Web APIs
or may be disabled due to subscription level or other circumstances.
...ting up the seekforward and seekbackward action handlers.
Media Session action types - Web APIs
wser itself to media control keys on the user's keyboard to buttons on the user's headset or earbuds.
...ting up the seekforward and seekbackward action handlers.
MediaSessionActionDetails - Web APIs
wser itself to media control keys on the user's keyboard to buttons on the user's headset or earbuds.
...ting up the seekforward and seekbackward action handlers.
MediaStreamTrack.enabled - Web APIs
notes if the mediastreamtrack represents the video input from a camera, disabling the track by setting enabled to false also updates device activity indicators to show that the camera is not currently recording or streaming.
...put from a camera, disabling the track by setting enabled to false also updates device activity indicators to show that the camera is not currently recording or streaming.
Navigator.share() - Web APIs
Web › API › Navigator › share
ting the array of file to be shared.
...tton which, when clicked, invokes the web share api to share mdn's url.
Notification.requestPermission() - Web APIs
ssion(callback); parameters callback optional deprecated since gecko 46 an optional callback function that is called with the permission value.
...s no need to bother them any more.
Multi-touch interaction - Web APIs
wser's default touch behavior from overriding this application's pointer handling, the touch-action property is applied to the <body> element.
...e touch-action property is applied to the <body> element.
Pinch zoom gestures - Web APIs
ndling, the touch-action property is applied to the <body> element.
...it();" style="touch-action:none"> <div id="target">touch and hold with 2 pointers, then pinch in or out.<br/> the background color will change to pink if the pinch is opening (zoom in) or changes to lightblue if the pinch is closing (zoom out).</div> <!-- ui for logging/debugging --> <button id="log" onclick="enablelog(event);">start/stop event logging</button> <button id="clearlog" onclick="clearlog(event);">clear the log</button> <p></p> <output></output> </body> miscellaneous functions these functions support the application but aren't directly involved in the event flow.
PushManager.subscribe() - Web APIs
}, function(error) { // during development it often helps to log errors to the // console.
...ften helps to log errors to the // console.
RTCPeerConnection.removeTrack() - Web APIs
local end know this negotiation must occur.
...ple this example adds a video track to a connection and sets up a listener on a close button which removes the track when the user clicks the button.
Range.extractContents() - Web APIs
.
...item(s)</button> <p id="list2">abcdef</p> css body { pointer-events: none; } p { border: 1px solid; font-size: 2em; padding: .3em; } button { font-size: 1.2em; padding: .5em; pointer-events: auto; } javascript const list1 = document.getelementbyid('list1'); const list2 = document.getelementbyid('list2'); const button = document.getelementbyid('swap'); button.addeventlistener('click', e => { selection = window.getselection(); for (let i = 0; i < selection.rangecount; i++) { const range = selection.getrangeat(i); if (range.commonancestorcontainer === list1 || range.commonancestorcontainer.parentnode === list1) { const documentfragment = range.extractcontents(); list2.appendchild(documentfragment); } else if (range.commonancestorcontainer ...
Report - Web APIs
Web › API › Report
methods this interface has no methods defined on it.
... reportbtn.onclick = () => displayreports(reports); }, options); we then tell it to start observing reports using reportingobserver.observe(); this tells the observer to start collecting reports in its report queue, and runs the callback function specified inside the constructor: observer.observe(); because of the event handler we set up inside the reportingobserver() constructor, we can now click the button to display the report details.
ReportingObserver - Web APIs
n the observer's report queue, and empties the queue.
...berately use the deprecated version of mediadevices.getusermedia(): if(navigator.mozgetusermedia) { navigator.mozgetusermedia( constraints, success, failure); } else { navigator.getusermedia( constraints, success, failure); } this causes a deprecation report to be generated; because of the event handler we set up inside the reportingobserver() constructor, we can now click the button to display the report details.
Reporting API - Web APIs
ped running due to a browser crash.
...berately use the deprecated version of mediadevices.getusermedia(): if(navigator.mozgetusermedia) { navigator.mozgetusermedia( constraints, success, failure); } else { navigator.getusermedia( constraints, success, failure); } this causes a deprecation report to be generated; because of the event handler we set up inside the reportingobserver() constructor, we can now click the button to display the report details.
SVGAElement - Web APIs
t.text is a domstring being a synonym for the node.textcontent property.
...icating the mime type of the linked resource.
Selection - Web APIs
Web › API › Selection
ouse button.
...he anchornode.
Service Worker API - Web APIs
during installation.
...anaging the preloading of resources with a service worker.
SpeechRecognition - Web APIs
imple speech color changer example, we create a new speechrecognition object instance using the speechrecognition() constructor, create a new speechgrammarlist, and set it to be the grammar that will be recognised by the speechrecognition instance using the speechrecognition.grammars property.
...ognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; recognition.continuous = false; recognition.lang = 'en-us'; recognition.interimresults = false; recognition.maxalternatives = 1; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.'); } recognition.onresult = function(event) { var color = event.results[0][0].transcript; diagnostic.textcontent = 'result received: ' + color; bg.style.backgroundcolor = color; } specifications specification status comment web speech apithe definition of 'speechrecognition' in ...
Using the Storage Access API - Web APIs
e access!
...ie localstorage.setitem("username", "john"); // access a localstorage entry }).catch(_ => { // error obtaining storage access.
Storage Access API - Web APIs
ctivation allow-scripts allow-same-origin"> ...
...dicating whether the document has access to its first-party storage.
SubtleCrypto.deriveBits() - Web APIs
t generatebobskeypair = window.crypto.subtle.generatekey( { name: "ecdh", namedcurve: "p-384" }, false, ["derivebits"] ); promise.all([generatealiceskeypair, generatebobskeypair]).then(values => { const aliceskeypair = values[0]; const bobskeypair = values[1]; const derivebitsbutton = document.queryselector(".ecdh .derive-bits-button"); derivebitsbutton.addeventlistener("click", () => { // alice then generates a secret using her private key and bob's public key.
...(".pbkdf2 .derived-bits-value"); derivedbitsvalue.classlist.add("fade-in"); derivedbitsvalue.addeventlistener("animationend", () => { derivedbitsvalue.classlist.remove("fade-in"); }); derivedbitsvalue.textcontent = `${buffer}...[${derivedbits.bytelength} bytes total]`; } const derivebitsbutton = document.queryselector(".pbkdf2 .derive-bits-button"); derivebitsbutton.addeventlistener("click", () => { getderivedbits(); }); specifications specification status comment web cryptography apithe definition of 'subtlecrypto.derivebits()' in that specification.
SubtleCrypto.deriveKey() - Web APIs
ivatekey, bobskeypair.publickey); // bob generates the same secret key using his private key and alice's public key.
...key); // alice can then use her copy of the secret key to encrypt a message to bob.
Multi-touch interaction - Web APIs
id black"; } } application ui the application uses <div> elements for the touch areas and provides buttons to enable logging and clear the log.
... areas and provides buttons to enable logging and clear the log.
Supporting both TouchEvent and MouseEvent - Web APIs
plicitly address mouse input.
..._touchmove(ev) { // call preventdefault() to prevent any further handling ev.preventdefault(); } event order although the specific ordering of touch and mouse events is implementation-defined, the standard indicates the following order is typical: for single input: touchstart zero or more touchmove events, depending on movement of the finger(s) touchend mousemove mousedown mouseup click if the touchstart, touchmove or touchend event is canceled during an interaction, no mouse or click events will be fired, and the resulting sequence of events would just be: touchstart zero or more touchmove events, depending on movement of the finger(s) touchend community touch events community group mail list w3c #touchevents irc channel related topics and resources touch eve...
UIEvent.layerX - Web APIs
Web › API › UIEvent › layerX
1 { border: solid blue 1px; padding: 20px; } #d2 { position: absolute; top: 180px; left: 80%; right:auto; width: 40%; border: solid blue 1px; padding: 20px; } #d3 { position: absolute; top: 240px; left: 20%; width: 50%; border: solid blue 1px; padding: 10px; } </style> </head> <body onmousedown="showcoords(event)"> <p>to display the mouse coordinates please click anywhere on the page.</p> <div id="d1"> <span>this is an un-positioned div so clicking it will return layerx/layery values almost the same as pagex/pagey values.</span> </div> <div id="d2"> <span>this is a positioned div so clicking it will return layerx/layery values that are relative to the top-left corner of this positioned element.
...ues almost the same as pagex/pagey values.</span> </div> <div id="d2"> <span>this is a positioned div so clicking it will return layerx/layery values that are relative to the top-left corner of this positioned element.
UIEvent.layerY - Web APIs
Web › API › UIEvent › layerY
1 { border: solid blue 1px; padding: 20px; } #d2 { position: absolute; top: 180px; left: 80%; right:auto; width: 40%; border: solid blue 1px; padding: 20px; } #d3 { position: absolute; top: 240px; left: 20%; width: 50%; border: solid blue 1px; padding: 10px; } </style> </head> <body onmousedown="showcoords(event)"> <p>to display the mouse coordinates please click anywhere on the page.</p> <div id="d1"> <span>this is an un-positioned div so clicking it will return layerx/layery values almost the same as pagex/pagey values.</span> </div> <div id="d2"> <span>this is a positioned div so clicking it will return layerx/layery values that are relative to the top-left corner of this positioned element.
...ues almost the same as pagex/pagey values.</span> </div> <div id="d2"> <span>this is a positioned div so clicking it will return layerx/layery values that are relative to the top-left corner of this positioned element.
UIEvent.pageY - Web APIs
Web › API › UIEvent › pageY
1 { border: solid blue 1px; padding: 20px; } #d2 { position: absolute; top: 180px; left: 80%; right:auto; width: 40%; border: solid blue 1px; padding: 20px; } #d3 { position: absolute; top: 240px; left: 20%; width: 50%; border: solid blue 1px; padding: 10px; } </style> </head> <body onmousedown="showcoords(event)"> <p>to display the mouse coordinates please click anywhere on the page.</p> <div id="d1"> <span>this is an un-positioned div so clicking it will return layerx/layery values almost the same as pagex/pagey values.</span> </div> <div id="d2"> <span>this is a positioned div so clicking it will return layerx/layery values that are relative to the top-left corner of this positioned element.
...lues almost the same as pagex/pagey values.</span> </div> <div id="d2"> <span>this is a positioned div so clicking it will return layerx/layery values that are relative to the top-left corner of this positioned element.
VideoTrackList: change event - Web APIs
onchange examples using addeventlistener(): const videoelement = document.queryselector('video'); videoelement.videotracks.addeventlistener('change', (event) => { console.log(`'${event.type}' event fired`); }); // changing the value of `selected` will trigger the `change` event const toggletrackbutton = document.queryselector('.toggle-track'); toggletrackbutton.addeventlistener('click', () => { const track = videoelement.videotracks[0]; track.selected = !track.selected; }); using the onchange event handler property: const videoelement = document.queryselector('video'); videoelement.videotracks.onchange = (event) => { console.log(`'${event.type}' event fired`); }; // changing the value of `selected` will trigger the `change` event const toggletrackbutton = document.
...cted = !track.selected; }); using the onchange event handler property: const videoelement = document.queryselector('video'); videoelement.videotracks.onchange = (event) => { console.log(`'${event.type}' event fired`); }; // changing the value of `selected` will trigger the `change` event const toggletrackbutton = document.queryselector('.toggle-track'); toggletrackbutton.addeventlistener('click', () => { const track = videoelement.videotracks[0]; track.selected = !track.selected; }); specifications specification status html living standardthe definition of 'change' in that specification.
WakeLockSentinel.release() - Web APIs
locksentinel, returning a promise that is resolved once the sentinel has been successfully released.
...lly released.
Color masking - Web APIs
green.
... may not support webgl."; return; } gl.viewport(0, 0, gl.drawingbufferwidth, gl.drawingbufferheight); var timer = setinterval(drawanimation, 1000); var mask = [true, true, true]; var redtoggle = document.queryselector("#red-toggle"), greentoggle = document.queryselector("#green-toggle"), bluetoggle = document.queryselector("#blue-toggle"); redtoggle.addeventlistener("click", setcolormask, false); greentoggle.addeventlistener("click", setcolormask, false); bluetoggle.addeventlistener("click", setcolormask, false); function setcolormask(evt) { var index = evt.target === greentoggle && 1 || evt.target === bluetoggle && 2 || 0; mask[index] = !mask[index]; if (mask[index] === true) evt.target.innerhtml="on"; else evt.
Detect WebGL - Web APIs
{ text-align : center; } button { display : block; font-size : inherit; margin : auto; padding : 0.6em; } // run everything inside window load event handler, to make sure // dom is fully loaded and styled before trying to manipulate it.
...ont-size : inherit; margin : auto; padding : 0.6em; } // run everything inside window load event handler, to make sure // dom is fully loaded and styled before trying to manipulate it.
Scissor animation - Web APIs
position in webgl is // measured from bottom to top.
...n startanimation(evt) { button.removeeventlistener(evt.type, startanimation, false); button.addeventlistener("click", stopanimation, false); document.queryselector("strong").innerhtml = "stop"; timer = setinterval(drawanimation, 17); drawanimation(); } function stopanimation(evt) { button.removeeventlistener(evt.type, stopanimation, false); button.addeventlistener("click", startanimation, false); document.queryselector("strong").innerhtml = "start"; clearinterval(timer); } stopanimation({type: "click"}); } // variables to hold the size and velocity of the square.
WebGL by example - Web APIs
code.
...ously explained.
Introduction to the Real-time Transport Protocol (RTP) - Web APIs
e mid being unique for each rtcpeerconnection.
...ransceiver.
Writing a WebSocket server in C# - Web APIs
send</button> <div id=output></div> <script> // http://www.websocket.org/echo.html var button = document.queryselector("button"), output = document.queryselector("#output"), textarea = document.queryselector("textarea"), // wsuri = "ws://echo.websocket.org/", wsuri = "ws://127.0.0.1/", websocket = new websocket(wsuri); button.addeventlistener("click", onclickbutton); websocket.onopen = function (e) { writetoscreen("connected"); dosend("websocket rocks"); }; websocket.onclose = function (e) { writetoscreen("disconnected"); }; websocket.onmessage = function (e) { writetoscreen("<span>response: " + e.data + "</span>"); }; websocket.onerror = function (e) { writetoscreen("<s...
...e: " + e.data + "</span>"); }; websocket.onerror = function (e) { writetoscreen("<span class=error>error:</span> " + e.data); }; function dosend(message) { writetoscreen("sent: " + message); websocket.send(message); } function writetoscreen(message) { output.insertadjacenthtml("afterbegin", "<p>" + message + "</p>"); } function onclickbutton() { var text = textarea.value; text && dosend(text); textarea.value = ""; textarea.focus(); } </script> related writing websocket servers ...
WebXR permissions and security - Web APIs
icit user consent) is granted when the user has specifically and expressly been asked for permission to perform an action.
...ically and expressly been asked for permission to perform an action.
Advanced techniques: Creating and sequencing audio - Web APIs
; }); lastnotedrawn = drawnote; } // set up to draw again requestanimationframe(draw); } putting it all together now all that's left to do is make sure we've loaded the sample before we are able to play the instrument.
... click event.
Using the Web Audio API - Web APIs
permission or a user engagement with the page before scripts can trigger audio to play.
...text.destination, which handles the situation for you: track.connect(audiocontext.destination); a good way to visualise these nodes is by drawing an audio graph so you can visualize it.
Window: blur event - Web APIs
Web › API › Window › blur event
ocus.
...s.
Window: focus event - Web APIs
the opposite of focus is blur.
...s.
Window.releaseEvents() - Web APIs
summary releases the window from trapping events of a specific type.
... summary releases the window from trapping events of a specific type.
Window.scroll() - Web APIs
Web › API › Window › scroll
, y-coord) window.scroll(options) parameters x-coord is the pixel along the horizontal axis of the document that you want displayed in the upper left.
...(options) parameters x-coord is the pixel along the horizontal axis of the document that you want displayed in the upper left.
Window.scrollByLines() - Web APIs
the window.scrollbylines() method scrolls the document by the specified number of lines.
...ls the document by the specified number of lines.
WindowClient.focus() - Web APIs
he windowclient interface gives user input focus to the current client and returns a promise that resolves to the existing windowclient.
...urrent client and returns a promise that resolves to the existing windowclient.
WindowClient.focused - Web APIs
the focused read-only property of the windowclient interface is a boolean that indicates whether the current client has focus.
... the focused read-only property of the windowclient interface is a boolean that indicates whether the current client has focus.
WindowClient - Web APIs
trolled client page.
...properties from its parent interface, client.
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
of ids.
...ooks them to the settimeout() and cleartimeout() routines.
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
or ar input devices.
...ncespace().
XRTargetRayMode - Web APIs
the webxr device api enumerated type xrtargetraymode describes the method by an input controller's targeting ray is being produced.
...very frame.
ARIA: timer role - Accessibility
the timer a more descriptive role text for screen readers to speak.
... stop watches and countdowns, such as ticketing websites, e-commerce sites, and event countdowns (see https://countingdownto.com/).
Web applications and ARIA FAQ - Accessibility
need to update the aria-valuenow attribute progressbar.setattribute("aria-valuenow", percentcomplete); } else { // html5 <progress> is supported, so update the value attribute instead.
...rogress> is supported, so update the value attribute instead.
Keyboard-navigable JavaScript widgets - Accessibility
events for non-alphanumeric keys.
...ing when users navigate using the arrow keys should also be used by mouse click handlers to produce the same changes.
:focus-visible - CSS: Cascading Style Sheets
ctor is useful to provide a different focus indicator based on the user’s input modality (mouse vs.
...us { outline: 2px solid black; } .focus-visible-only:focus-visible { outline: 4px dashed darkorange; } selectively showing the focus indicator a custom control, such as a custom element button, can use :focus-visible to selectively apply a focus indicator only on keyboard-focus.
Border-radius generator - CSS: Cascading Style Sheets
s-user-select: text; user-select: text; float: right; } javascript content 'use strict'; /** * ui-inputslidermanager */ var inputslidermanager = (function inputslidermanager() { var subscribers = {}; var sliders = []; var inputcomponent = function inputcomponent(obj) { var input = document.createelement('input'); input.setattribute('type', 'text'); input.addeventlistener('click', function(e) { this.select(); }); input.addeventlistener('change', function(e) { var value = parseint(e.target.value); if (isnan(value) === true) setvalue(obj.topic, obj.value); else setvalue(obj.topic, value); }); subscribe(obj.topic, function(value) { input.value = value + obj.unit; }); return input; } var slidercomponent = function slidercomponent(obj...
...e); if (isnan(value) === true) setvalue(obj.topic, obj.value); else setvalue(obj.topic, value); }); subscribe(obj.topic, function(value) { input.value = value + obj.unit; }); return input; } var slidercomponent = function slidercomponent(obj, sign) { var slider = document.createelement('div'); var startx = null; var start_value = 0; slider.addeventlistener("click", function(e) { setvalue(obj.topic, obj.value + obj.step * sign); }); slider.addeventlistener("mousedown", function(e) { startx = e.clientx; start_value = obj.value; document.body.style.cursor = "e-resize"; document.addeventlistener("mousemove", slidermotion); }); document.addeventlistener("mouseup", function(e) { document.removeeventlistener("mousemove", slidermotion)...
Flow Layout and Overflow - CSS: Cascading Style Sheets
at the time of writing the name is still up for discussion.
... the name is still up for discussion.
Using CSS transitions - CSS: Cascading Style Sheets
final state.
...t functionality smooth transitions are a great tool to make things look much smoother without having to do anything to your javascript functionality.
flex - CSS: Cascading Style Sheets
Web › CSS › flex
sis: as specified, but with relative lengths converted into absolute lengthsanimation typeas each of the properties of the shorthand:flex-grow: a numberflex-shrink: a numberflex-basis: a length, percentage or calc(); formal syntax none | [ <'flex-grow'> <'flex-shrink'>?
...v class="flex-item" id="flex">flex box (click to toggle raw box)</div> <div class="raw-item" id="raw">raw box</div> </div> css #flex-container { display: flex; flex-direction: row; } #flex-container > .flex-item { flex: auto; } #flex-container > .raw-item { width: 5rem; } var flex = document.getelementbyid("flex"); var raw = document.getelementbyid("raw"); flex.addeventlistener("click", function() { raw.style.display = raw.style.display == "none" ?
Adding captions and subtitles to HTML5 video - Developer guides
em = document.createelement('li'); var button = listitem.appendchild(document.createelement('button')); button.setattribute('id', id); button.classname = 'subtitles-button'; if (lang.length > 0) button.setattribute('lang', lang); button.value = label; button.setattribute('data-state', 'inactive'); button.appendchild(document.createtextnode(label)); button.addeventlistener('click', function(e) { // set all buttons to inactive subtitlemenubuttons.map(function(v, i, a) { subtitlemenubuttons[i].setattribute('data-state', 'inactive'); }); // find the language to activate var lang = this.getattribute('lang'); for (var i = 0; i < video.texttracks.length; i++) { // for the 'subtitles-off' button, the first condition will neve...
...le the relevant subtitle set on or off.
Audio and video manipulation - Developer guides
ue="reset" /> </div> <textarea id="code" class="playable-code"> var myvideo = document.getelementbyid('my-video'); myvideo.playbackrate = 2;</textarea> var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var edit = document.getelementbyid('edit'); var code = textarea.value; function setplaybackrate() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; setplaybackrate(); }); edit.addeventlistener('click', function() { textarea.focus(); }) textarea.addeventlistener('input', setplaybackrate); window.addeventlistener('load', setplaybackrate); note: try the playbackrate example live.
...source(document.getelementbyid("my-video")), filter = context.createbiquadfilter(); audiosource.connect(filter); filter.connect(context.destination); var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var edit = document.getelementbyid('edit'); var code = textarea.value; function setfilter() { eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; setfilter(); }); edit.addeventlistener('click', function() { textarea.focus(); }) textarea.addeventlistener('input', setfilter); window.addeventlistener('load', setfilter); note: unless you have cors enabled, to avoid security issues your video should be on the same domain as your code.
disabled - HTML: Hypertext Markup Language
akes the element not mutable, focusable, or even submitted with the form.
...pecified.
HTML attribute: multiple - HTML: Hypertext Markup Language
pecified, the value can be a list of properly-formed comma-separated e-mail addresses.
...ment this css to make the multiple the same height as the single */ /* select[multiple] { height: 1.5em; vertical-align: top; } select[multiple]:focus, select[multiple]:active { height: auto; } */ there are a few ways to select multiple options in a <select> element with a multiple attribute.
<details>: The Details disclosure element - HTML: Hypertext Markup Language
Web › HTML › Element › details
t is why these are sometimes called "twisties." a <details> widget can be in one of two states.
...ns", calibri, sans-serif; width: 620px; } details > summary { padding: 2px 6px; width: 15em; background-color: #ddd; border: none; box-shadow: 3px 3px 4px black; cursor: pointer; } details > p { border-radius: 0 0 10px 10px; background-color: #ddd; padding: 2px 6px; margin: 0; box-shadow: 3px 3px 4px black; } this css creates a look similar to a tabbed interface, where clicking the tab opens it to reveal its contents.
<input type="email"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › email
value="tony@starkindustries.com"> <option value="hulk@grrrrrrrr.arg"> </datalist> with the <datalist> element and its <option>s in place, the browser will offer the specified values as potential values for the e-mail address; this is typically presented as a popup or drop-down menu containing the suggestions.
... allowing multiple e-mail addresses.
<input type="file"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › file
the user's device or operating system, the file input provides a button that opens up a file picker dialog that allows the user to choose a file.
...ore — nothing special to comment on.
<input type="time"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › time
g input size <input type="time"> doesn't support form sizing attributes such as size, since times are always about the same number of characters long.
...alue is 60 seconds, or one minute.
<summary>: The Disclosure Summary element - HTML: Hypertext Markup Language
Web › HTML › Element › summary
the html disclosure summary element (<summary>) element specifies a summary, caption, or legend for a <details> element's disclosure box.
...role button permitted aria roles no role permitted dom interface htmlelement attributes this element only includes the global attributes.
Global attributes - HTML: Hypertext Markup Language
l global attributes, the following global attributes also exist: xml:lang and xml:base — these are inherited from the xhtml specifications and deprecated, but kept for compatibility purposes.
...tes also exist: xml:lang and xml:base — these are inherited from the xhtml specifications and deprecated, but kept for compatibility purposes.
Link types - HTML: Hypertext Markup Language
ent a canonical link element is an html element that helps webmasters prevent duplicate content issues by specifying the "canonical" or "preferred" version of a web page as part of search engine optimization.
...op, _self, and _parent are all treated like _blank in terms of deciding whether to open a new window/tab.
Index - HTTP
Web › HTTP › Headers › Index
ing popups, preventing the execution of plugins and scripts, and enforcing a same-origin policy.
...rotocol used between the client and the load balancer, the x-forwarded-proto request header can be used.
X-DNS-Prefetch-Control - HTTP
feature by which browsers proactively perform domain name resolution on both links that the user may choose to follow as well as urls for items referenced by the document, including images, css, javascript, and so forth.
... disables dns prefetching.
Link prefetching FAQ - HTTP
te idle time as the period between the last document stop and the next document start.
...xt document start.
Loops and iteration - JavaScript
in a scrolling list (a <select> element that allows multiple selections).
... </select> </p> <p><input id="btn" type="button" value="how many are selected?" /></p> </form> <script> function howmany(selectobject) { let numberselected = 0; for (let i = 0; i < selectobject.options.length; i++) { if (selectobject.options[i].selected) { numberselected++; } } return numberselected; } let btn = document.getelementbyid('btn'); btn.addeventlistener('click', function() { alert('number of options selected: ' + howmany(document.selectform.musictypes)); }); </script> do...while statement the do...while statement repeats until a specified condition evaluates to false.
Regular expressions - JavaScript
, followed by one dash, forward slash, or decimal point and when found, remember the character ([-\/\.]), followed by three digits \d{3}, followed by the remembered match of a dash, forward slash, or decimal point \1, followed by four digits \d{4}.
...digits \d{3}, followed by the remembered match of a dash, forward slash, or decimal point \1, followed by four digits \d{4}.
String.prototype.link() - JavaScript
the document via document.write() or element.innerhtml.
...nnerhtml.
eval() - JavaScript
ns instead of evaluating snippets of code javascript has first-class functions, which means you can pass functions as arguments to other apis, store them in variables and objects' properties, and so on.
... javascript has first-class functions, which means you can pass functions as arguments to other apis, store them in variables and objects' properties, and so on.
Function expression - JavaScript
typeof baz); // undefined console.log(bar === baz); // false (errors because baz == undefined) examples creating an unnamed function the following example defines an unnamed function and assigns it to x.
.../ false (errors because baz == undefined) examples creating an unnamed function the following example defines an unnamed function and assigns it to x.
import - JavaScript
} export function getusefulcontents(url, callback) { getjson(url, data => callback(json.parse(data))); } the main program: main.js import { getusefulcontents } from '/modules/file.js'; getusefulcontents('http://www.example.com', data => { dosomethinguseful(data); }); dynamic import this example shows how to load functionality on to a page based on a user action, in this case a button click, and then call a function within that module.
...amic import this example shows how to load functionality on to a page based on a user action, in this case a button click, and then call a function within that module.
Autoplay guide for media and Web Audio APIs - Web media technologies
ut warning can be jarring, inconvenient, or off-putting.
...o by default, like this: <video src="/videos/awesomevid.webm" controls autoplay muted> this video element is configured to include the user controls (typically play/pause, scrubbing through the video's timeline, volume control, and muting); also, since the muted attribute is included, the video will autoplay but with the audio muted.
Performance fundamentals - Web Performance
her if the hardware isn't going to actually draw anything.
...elopers we love click events since they also support keyboard input.
Progressive web app structure - Progressive web apps (PWAs)
s like a native app with instant interaction and solid performance while keeping all the benefits of the web.
...replace(/github/g,games[i].github); entry = entry.replace('<a href=\'http:///\'></a>','-'); content += entry; }; document.getelementbyid('content').innerhtml = content; next, it registers a service worker: if('serviceworker' in navigator) { navigator.serviceworker.register('/pwa-examples/js13kpwa/sw.js'); }; the next code block requests permission for notifications when a button is clicked: var button = document.getelementbyid("notifications"); button.addeventlistener('click', function(e) { notification.requestpermission().then(function(result) { if(result === 'granted') { randomnotification(); } }); }); the last block creates notifications that display a randomly-selected item from the games list: function randomnotification() { var ran...
Installing and uninstalling web apps - Progressive web apps (PWAs)
tallation?
...n: this calls up the sharing panel.
Applying SVG effects to HTML content - SVG: Scalable Vector Graphics
qua.
...t" style="background:lime;"> lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
SVG Event Attributes - SVG: Scalable Vector Graphics
Web › SVG › Attribute › Events
.
...able on a case by case basis for each elements.
visibility - SVG: Scalable Vector Graphics
es the css visibility of the svg image path.
...l6 6 6-6z" /> <path d="m12 8l-6 6 1.41 1.41l12 10.83l4.59 4.58l18 14z" class="invisible" /> <path d="m0 0h24v24h0z" fill="none" /> </svg> <span> click me </span> </button> css svg { display: inline !important; } span { vertical-align: 50%; } button { line-height: 1em; } .invisible { visibility: hidden; } javascript document.queryselector("button").addeventlistener("click", function (evt) { this.queryselector("svg > path:nth-of-type(1)").classlist.toggle("invisible"); this.queryselector("svg > path:nth-of-type(2)").classlist.toggle("invisible"); }); specifications specification status comment css level 2 (revision 1)the definition of 'visibility' in that specification.
Linking - SVG: Scalable Vector Graphics
Web › SVG › Linking
="50" type="image/svg+xml" data="button.svg"/> </body> </html> button.svg: <?xml version="1.1" encoding="utf-8"?> <svg xmlns="http://www.w3.org/2000/svg"> <a xlink:href="page2.html" target="_top"> <g> <!-- button graphical elements here --> </g> </a> </svg> the specification says that the browser should navigate to the html document page2.html when the button graphics are clicked.
...e fixed in firefox 2.0.) anyway, the resultant behavior in moz svg is that page2.html will be loaded into the frame where the svg button was (i.e.
Scripting - SVG: Scalable Vector Graphics
Web › SVG › Scripting
parameter to these methods.
...this.rect=document.createelementns("http://www.w3.org/2000/svg","rect") this.rect.setattributens(null,"x",x) this.rect.setattributens(null,"y",y) this.rect.setattributens(null,"width",w) this.rect.setattributens(null,"height",h) document.documentelement.appendchild(this.rect) this.rect.addeventlistener("click",this,false) this.handleevent= function(evt){ switch (evt.type){ case "click": alert(this.message) break; } } } inter-document scripting: referencing embedded svg when using svg within html, adobe's svg viewer 3.0 automatically includes a window property called svgdocument that points to the svg document.
indexed-db - Archive of obsolete content
uest.onsuccess = function(e) { var result = e.target.result; if(!!result == false) return; items.push(result.value.name); result.continue(); }; cursorrequest.onerror = database.onerror; }; function listitems(itemlist) { console.log(itemlist); } open("1"); var add = require("sdk/ui/button/action").actionbutton({ id: "add", label: "add", icon: "./add.png", onclick: function() { additem(require("sdk/tabs").activetab.title); } }); var list = require("sdk/ui/button/action").actionbutton({ id: "list", label: "list", icon: "./list.png", onclick: function() { getitems(listitems); } }); note that to run this add-on you'll need to provide icons named "add.png" and "list.png" in the add-on's "data" directory.
selection - Archive of obsolete content
ion when there is no current selection throws an exception.
windows - Archive of obsolete content
" event.
core/promise - Archive of obsolete content
logical black boxes: function blackbox(a, b) { var c = assemble(a); return combine(b, c); } we're forced into continuation passing style, involving lots of machinery: function sphagetti(a, b, callback) { assemble(a, function continuewith(error, c) { if (error) callback(error); else combine(b, c, callback); }); } this style also makes doing things in sequence hard: widget.on('click', function onclick() { promptuserfortwitterhandle(function continuewith(error, handle) { if (error) return ui.displayerror(error); twitter.gettweetsfor(handle, funtion continuewith(error, tweets) { if (error) return ui.displayerror(error); ui.showtweets(tweets); }); }); }); doing things in parallel is even harder: var tweets, answers, checkins; twitter.gettweetsfor(u...
jpm-mobile - Archive of obsolete content
jpm-mobile [command] [options] jpm supports the following global options: -h, --help - show a help message and exit -v, --version - print the jpm version number installation jpm-mobile is distributed using the node package manager npm, so to get jpm-mobile you need to have npm installed, if you haven't already.
Overview - Archive of obsolete content
he notifications module to notify the user when the add-on's storage quota is full.
Bootstrapped extensions - Archive of obsolete content
a, reason ); parameters data a bootstrap data structure.
Examples and demos from articles - Archive of obsolete content
:hover pseudoclass [zip] you can use the :hover pseudo-class in order to build an image gallery with full-size images shown only when mouse goes over previews.
Label and description - Archive of obsolete content
of the css style, but this creates a hard-break that does not change as parent elements resize.
Running applications - Archive of obsolete content
ere are two ways to run programs.
Inline options - Archive of obsolete content
ould be stored as a boolean) --> <setting pref="extensions.myaddon.options2" type="radio" title="options 2"> <radiogroup> <radio value="false" label="disabled"/> <radio value="true" label="enabled"/> </radiogroup> </setting> <!-- button example - not tied to a preference, but attached to a command --> <setting title="do something" type="control"> <button id="myaddon-button" label="click me" oncommand="alert('thank you!');"/> </setting> setting element changed notifications most of the setting elements (it might be all i havent really looked), support oninputchanged attribute.
Appendix: What you should know about open-source software licenses - Archive of obsolete content
ct some normally unrestricted uses.
Chapter 1: Introduction to Extensions - Archive of obsolete content
ely—there are now more than 7000 extensions and themes published at the firefox add-ons site (https://addons.mozilla.org).
Adding menus and submenus - Archive of obsolete content
now let's look at some specialized types of menu items.
Connecting to Remote Content - Archive of obsolete content
after installation, you can find a tamper data menu item in the menu bar: tools > tamper data or view > sidebar > tamper data once you open the tamper data view, all requests and responses will begin to appear in it.
Introduction - Archive of obsolete content
hem.
The Essentials of an Extension - Archive of obsolete content
chrome.browseroverlay.sayhello(event);" this attribute defines an event handler.
XPCOM Objects - Archive of obsolete content
chine, we see the preferences service component page.
Performance best practices in extensions - Archive of obsolete content
ndow opens.
No Proxy For configuration - Archive of obsolete content
t simple blacklist scenarios.
Creating a Firefox sidebar extension - Archive of obsolete content
tent/browser.xul chrome://emptysidebar/content/firefoxoverlay.xul finally, create the xpi file.
Adding the structure - Archive of obsolete content
ss="statusbarpanel-progress"> <progressmeter class="progressmeter-statusbar" id="statusbar-icon" mode="normal" value="0"/> </statusbarpanel> <statusbarpanel class="statusbarpanel-iconic" id="tinderbox-status" status="none"/> <statusbarpanel class="statusbarpanel-iconic" id="offline-status"/> <statusbarpanel class="statusbarpanel-iconic" id="security-button" onclick="browserpageinfo(null, 'securitytab')"/> </statusbar> the statusbar xul element defines a horizontal status bar where informative messages about an application's state can be displayed.
Conclusion - Archive of obsolete content
script to determine whether the tree is open or closed and css to style the icon accordingly?
Finding the code to modify - Archive of obsolete content
side of the inspector window displays a tree representation of the browser window's xul file.
Making it into a static overlay - Archive of obsolete content
el-progress"> <progressmeter class="progressmeter-statusbar" id="statusbar-icon" mode="normal" value="0"/> </statusbarpanel> <statusbarpanel class="statusbarpanel-iconic" id="tinderbox-status" status="none"/> <statusbarpanel class="statusbarpanel-iconic" id="offline-status"/> <statusbarpanel class="statusbarpanel-iconic" id="security-button" onclick="browserpageinfo(null, 'securitytab')"/> </statusbar> ...
Creating a Skin for Firefox/Getting Started - Archive of obsolete content
the new omni.jar file contains the skin, among other resources.
Drag and Drop Example - Archive of obsolete content
« previous gecko 1.9.1 (firefox 3.5) and later supports a newer and simpler api.
Layout FAQ - Archive of obsolete content
s used to contain everything on a single line: example how do you fix inconsistent float behavior in firefox involving a two column layout using display:table and floating div elements?
Code snippets - Archive of obsolete content
er = function(item) { item.collection = collection; item.decrypt(); if (item.deleted) { deleted++; } else { items[item.type] = 1 + (items[item.type] || 0); } }; coll.get(); console.log("deleted: " + deleted + ", " + json.stringify(items)); get a log from xul fennec view about:sync-log.
Introducing the Audio API extension - Archive of obsolete content
pt type="text/javascript"> function playtone() { var output = new audio(); output.mozsetup(1, 44100); var samples = new float32array(22050); for (var i = 0; i < samples.length ; i++) { samples[i] = math.sin( i / 20 ); } output.mozwriteaudio(samples); } </script> </head> <body> <p>this demo plays a one second tone when you click the button below.</p> <button onclick="playtone();">play</button> </body> </html> the mozcurrentsampleoffset() method gives the audible position of the audio stream, meaning the position of the last heard sample.
JavaScript crypto - Archive of obsolete content
ate will be erased for ssl sites with client authentication, and a client certificate prompt will appear again the next time the user connects to the site.
Java in Firefox Extensions - Archive of obsolete content
note: the global java object has been removed in gecko 16.0, so this page is out of date.
File access - Archive of obsolete content
note: this page documents the jetpack prototype, which is no longer under active development.
Simple Storage - Archive of obsolete content
mystorage.heimelfarbs.bar;jetpack.notifications.show(bar.baz); that's all there is to it!
Simple Storage - Archive of obsolete content
ystorage.heimelfarbs.bar; jetpack.notifications.show(bar.baz); that's all there is to it!
statusBar - Archive of obsolete content
he panel-item html (string) the html code which will be used inside the item onload (event) this event fires when the item was appended.
Makefile.mozextension.2 - Archive of obsolete content
that the original makefile.mozextention merely repeats the steps in getting started with extension development - mozillazine knowledge base (2008).
Overview of how downloads work - Archive of obsolete content
there are two ways of downloading files in mozilla.
Bundles - Archive of obsolete content
e user.
Extensions - Archive of obsolete content
ols, like 7zip, can edit and update a file in the archive without needing to manually extract it and add it back into the xpi.
Installer - Archive of obsolete content
the installer should configure the os to associate *.webapp files with prism.
New Skin Notes - Archive of obsolete content
r sites i visit regularily or manage...
Running Windows Debug Builds Downloaded From Tinderbox - Archive of obsolete content
ration is incorrect..." this is because the debug builds need the msvc80 crt debug dlls.
Example Sticky Notes - Archive of obsolete content
named arguments using <parameter name="argumentname"/> --> <parameter name="arg"/> <body><![cdata[ this.style.border = arg; ]]></body> </method> </implementation> <handlers> <!-- event handlers.
Creating XPI Installer Modules - Archive of obsolete content
he new resources and how to register them.
Install Wizards (aka: Stub Installers) - Archive of obsolete content
s at: <http://lxr.mozilla.org/seamonkey/sou...xpinstall/src/> what do we mean by stub installer?
Using XPInstall to Install Plugins - Archive of obsolete content
en obtaining plugins, without obliging the user to exit the browsing environment to launch a binary installer (the classic setup.exe experience on windows) or obliging the user to restart their browser.
InstallTrigger.startSoftwareUpdate - Archive of obsolete content
installtrigger.startsoftwareupdate this is a very simple example of the installtrigger object's principal method, startsoftwareupdate, which takes a string representing the path to the xpi and installs that xpi on the local machine.
confirm - Archive of obsolete content
nding abuttonxtitle parameter other constants button_pos_0_default: specifies button 0 as the default button.
Return Codes - Archive of obsolete content
tificate -206 extracted file was not signed by the certificate used to sign the installation script cant_read_archive -207 xpi package cannot be read invalid_arguments -208 bad parameters to a function illegal_relative_path -209 illegal relative path user_cancelled -210 user clicked cancel on install dialog install_not_started -211 a problem occurred with the parameters to initinstall, or initinstall was not called first silent_mode_denied -212 the silent installation privilege has not been granted.
Learn XPI Installer Scripting by Example - Archive of obsolete content
installation script in a xpi to be automatically triggered from a web page, you must use a "trigger script." the following installtrigger function, called from an event handler on a regular web page, will point to the remotely-hosted xpi (called here 'cdrip.xpi') and trigger its installation: function putit() { xpi={'cd_ripper':'cdrip.xpi'}; installtrigger.install(xpi); } ...
backdrag - Archive of obsolete content
« xul reference home backdrag type: boolean setting the backdrag attribute on a xul panel lets the user move the panel by clicking and dragging anywhere on its background area.
colorpicker.type - Archive of obsolete content
« xul reference home type type: string if this attribute is not present, the colorpicker is displayed inside the window.
control - Archive of obsolete content
« xul reference home control type: id this attribute specifies the id of the element with which the label is associated.
cycler - Archive of obsolete content
« xul reference home cycler type: boolean if true, then the column is a cycler column.
editable - Archive of obsolete content
« xul reference home editable type: boolean indicates that the value of the menulist can be modified by typing directly into the value field.
increment - Archive of obsolete content
« xul reference home increment type: integer the amount by which the curpos (for scroll bars) or value (for number boxes and scale) attribute changes when the arrows are clicked(or scales are dragged).
mousethrough - Archive of obsolete content
ype: one of the values below determines whether mouse events are passed to the element or not.
onclosetab - Archive of obsolete content
« xul reference home onclosetab type: script code this script will be called when the close tab button is clicked.
onnewtab - Archive of obsolete content
« xul reference home onnewtab not in firefox type: script code this script will be called when the new tab button is clicked.
pageincrement - Archive of obsolete content
« xul reference home pageincrement type: integer the amount by which the value of the curpos or value attribute changes when the tray of the scroll bar (the area in which the scroll bar thumb moves) is clicked, or when the page up or page down keys are pressed.
panel.noautohide - Archive of obsolete content
« xul reference home noautohide type: boolean if false, the default value, the panel will be hidden when the user clicks outside the panel or switches focus to another application.
panel.type - Archive of obsolete content
specify this for a panel that provides a richlistbox for an autocomplete element.
popup - Archive of obsolete content
« xul reference home popup type: id should be set to the value of the id of the popup element that should appear when the user clicks on the element.
popup.position - Archive of obsolete content
« xul reference home position type: string the position attribute determines where the popup appears relative to the element the user clicked to invoke the popup.
toolbarbutton.type - Archive of obsolete content
string the type of button.
tree.onselect - Archive of obsolete content
« xul reference home onselect type: script code this event is sent to a tree when a row is selected, or whenever the selection changes.
treecell.editable - Archive of obsolete content
« xul reference home editable type: boolean allows the contents of individual cells in the column to be changed, especially useful when <treecol type="checkbox">.
treecol.editable - Archive of obsolete content
« xul reference home editable type: boolean allows the contents of cells in the column to be changed, especially useful when type="checkbox".
Deprecated and defunct markup - Archive of obsolete content
ve themes on) <outliner> (former name for <tree>; <listbox> had been "<tree>") <popup> (use menupopup) <package> (no longer present but in older documentation) <scrollbarbutton> (button at end of scrollbar; had been only within larger <scrollbar>) so, not deprecated, but internal use only?
findbar - Archive of obsolete content
ext, style, ,, tooltip, tooltiptext, top, width browser type: browser element lets you set and get the browser in which the findbar is located.
extra1 - Archive of obsolete content
Archive › Mozilla › XUL › Method › extra1
« xul reference home extra1() return type: no return value call this method to simulate clicking the extra1 button.
extra2 - Archive of obsolete content
Archive › Mozilla › XUL › Method › extra2
« xul reference home extra2() return type: no return value call this method to simulate clicking the extra2 button.
loadURIWithFlags - Archive of obsolete content
oad a url into the document, with the specified load flags, the given referrer, character set, and post data.
Methods - Archive of obsolete content
« xul reference home acceptdialog additemtoselection addpane addprogresslistener addsession addtab addtabsprogresslistener advance advanceselectedtab appendcustomtoolbar appendgroup appenditem appendnotification blur cancel canceldialog centerwindowonscreen checkadjacentelement clearresults clearselection click close collapsetoolbar contains decrease decreasepage docommand ensureelementisvisible ensureindexisvisible ensureselectedelementisvisible expandtoolbar extra1 extra2 focus getbrowseratindex getbrowserfordocument getbrowserfortab getbrowserindexfordocument getbutton getdefaultsession geteditor getelementsbyattribute getelementsbyattributens getformattedstring gethtmleditor getindexoffirst...
MoveResize - Archive of obsolete content
arge enough to fit all of the items within the menu.
popup - Archive of obsolete content
Archive › Mozilla › XUL › Property › popup
« xul reference popup new in thunderbird 14 requires seamonkey 2.11 type: popup element should be set to the popup element that should appear when the user clicks on the textbox.
scrollIncrement - Archive of obsolete content
« xul reference scrollincrement type: integer a read only property that lets you retrieve the number of pixels by which scrolling will occur when the arrowscrollbox is clicked.
Property - Archive of obsolete content
« xul reference accessible accessibletype accesskey align allnotifications allowevents alwaysopenpopup amindicator applocale autocheck autofill autofillaftermatch boxobject browsers builder builderview buttons canadvance cangoback cangoforward canrewind checked checkstate child children classname clickselectsall clientheight clientwidth collapsed color columns command commandmanager completedefaultindex container contentdocument contentprincipal contenttitle contentview contentvieweredit contentviewerfile contentwindow contextmenu control controller controllers crop current currentindex currentitem currentnotification currentpage currentpane currentset currenturi customt...
Sorting and filtering a custom tree view - Archive of obsolete content
lter">filter</label> <textbox id="filter" oninput="inputfilter(event)" flex="1"/> <button id="clearfilter" oncommand="clearfilter()" label="clear" accesskey="c" disabled="true"/> </hbox> <tree id="tree" flex="1" persist="sortdirection sortresource" sortdirection="ascending" sortresource="description"> <treecols> <treecol id="name" label="name" flex="1" persist="width ordinal hidden" onclick="sort(this)" class="sortdirectionindicator" sortdirection="ascending"/> <splitter class="tree-splitter"/> <treecol id="description" label="description" flex="1" persist="width ordinal hidden" onclick="sort(this)" class="sortdirectionindicator"/> <splitter class="tree-splitter"/> <treecol id="weapon" label="weapon" flex="1" persist="width ordinal hidden" onclick="sort(this)" class="sor...
text-link - Archive of obsolete content
« xul reference home text-link labels with this class may be focused and the click handler run or the address in the href attribute opened on a mouse click or enter key press.
Building Hierarchical Trees - Archive of obsolete content
for an xml datasource, the tree might display a node's children as the children in the tree, making the tree display a hierarchy similar to that in the xml document.
Toolbar customization events - Archive of obsolete content
rs are customized, events are sent to their parent window.
Adding HTML Elements - Archive of obsolete content
e of one will not be displayed, unless the xul element the text is inside allows this (the description element, for example).
Adding Style Sheets - Archive of obsolete content
r > button.bigbuttons matches all button elements with a class of bigbuttons that are directly inside toolbar elements.
Box Objects - Archive of obsolete content
object position and size references, which include borders as part of the element.
Commands - Archive of obsolete content
m here, since you will often use a single controller for multiple related commands.
Creating a Window - Archive of obsolete content
he next set of sections.
Creating a Wizard - Archive of obsolete content
element to accomplish this.
Document Object Model - Archive of obsolete content
d for.
Introduction to XBL - Archive of obsolete content
ents will have their behavior described by the binding 'binding1'.
Property Files - Archive of obsolete content
t, if, for example, you do not know the exact text to be displayed.
RDF Datasources - Archive of obsolete content
ome-fictitious-zoo.com/reptiles.
Stack Positioning - Archive of obsolete content
rder that they appear in the stack.
Stacks and Decks - Archive of obsolete content
for creating the disabled appearance of buttons: example 2 : source view <stack style="background-color: #c0c0c0"> <description value="disabled" style="color: white; padding-left: 1px; padding-top: 1px;"/> <description value="disabled" style="color: grey;"/> </stack> this arrangement of text and shadow colors creates the disabled look under some platforms.
Tree View Details - Archive of obsolete content
ay have a folder icon beside it.
XUL Structure - Archive of obsolete content
/vnd.mozilla.xul+xml (eg with php header('content-type: application/vnd.mozilla.xul+xml');).
XUL Accesskey FAQ and Policies - Archive of obsolete content
what is an accesskey?
XUL Reference - Archive of obsolete content
« xul reference « alphabetical list of all xul elements action arrowscrollbox assign bbox binding bindings box broadcaster broadcasterset button browser checkbox caption clicktoscroll colorpicker column columns commandset command conditions content datepicker deck description dialog dialogheader dropmarker editor grid grippy groupbox hbox iframe image key keyset label listbox listcell listcol listcols listhead listheader listitem member menu menubar menuitem menulist menupopup menuseparator notification notificationbox observes overlay page panel param popupset preference preferences prefpane prefwindow progressmeter query queryset radio radiogroup resizer richlistbox richlistitem row rows rule scale scrip...
XUL accessibility tool - Archive of obsolete content
rd to read, not recommended) (aaronandy) list of things to check manually, such as a list oftrees in the document (make sure they have accessible column picker equivs) or a list of toolbarbuttons (make sure they have accessible alternatives).
XML - Archive of obsolete content
s, xul offers no flexibility to you as acoder.
action - Archive of obsolete content
, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
assign - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
bbox - Archive of obsolete content
Archive › Mozilla › XUL › bbox
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
binding - Archive of obsolete content
r, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
bindings - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
box - Archive of obsolete content
Archive › Mozilla › XUL › box
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
broadcaster - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
broadcasterset - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
caption - Archive of obsolete content
s and sets the value of the crop attribute.
checkbox - Archive of obsolete content
: boolean gets and sets the value of the disabled attribute.
column - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
columns - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
command - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
commandset - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
conditions - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
content - Archive of obsolete content
used to specify the variable name for the content.
datepicker - Archive of obsolete content
nge the selected date.
deck - Archive of obsolete content
Archive › Mozilla › XUL › deck
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
description - Archive of obsolete content
abindex type: integer gets and sets the value of the tabindex attribute.
dialog - Archive of obsolete content
defaultbutton type: string normally this attribute should not be set, but if it is, it specifies the default button in the dialog.
dialogheader - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
dropmarker - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
editor - Archive of obsolete content
type: nsihtmleditor returns the html editing interface for the editor which contains methods for manipulating an html document.
grid - Archive of obsolete content
Archive › Mozilla › XUL › grid
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
grippy - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
groupbox - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
hbox - Archive of obsolete content
Archive › Mozilla › XUL › hbox
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
iframe - Archive of obsolete content
document.
image - Archive of obsolete content
Archive › Mozilla › XUL › image
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
key - Archive of obsolete content
Archive › Mozilla › XUL › key
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
keyset - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
listbox - Archive of obsolete content
tabindex type: integer gets and sets the value of the tabindex attribute.
listcell - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
listcol - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
listcols - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
listhead - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
listheader - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
listitem - Archive of obsolete content
tabindex type: integer gets and sets the value of the tabindex attribute.
member - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
menubar - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
menuitem - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
menuseparator - Archive of obsolete content
abindex type: integer gets and sets the value of the tabindex attribute.
notification - Archive of obsolete content
type type: string gets and sets the value of the type attribute.
notificationbox - Archive of obsolete content
delist nodelist of all notifications.
observes - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
page - Archive of obsolete content
Archive › Mozilla › XUL › page
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
param - Archive of obsolete content
Archive › Mozilla › XUL › param
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
preference - Archive of obsolete content
nteditable(in domelement element) returns true, if the given element is "editable" (see below).
preferences - Archive of obsolete content
fied preference element.
prefpane - Archive of obsolete content
ence's value to change.
prefwindow - Archive of obsolete content
type: string set this to the id of the last selected pane.
progressmeter - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
query - Archive of obsolete content
Archive › Mozilla › XUL › query
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
queryset - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
radio - Archive of obsolete content
Archive › Mozilla › XUL › radio
abindex type: integer gets and sets the value of the tabindex attribute.
radiogroup - Archive of obsolete content
abindex type: integer gets and sets the value of the tabindex attribute.
resizer - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
richlistitem - Archive of obsolete content
abindex type: integer gets and sets the value of the tabindex attribute.
row - Archive of obsolete content
Archive › Mozilla › XUL › row
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
rows - Archive of obsolete content
Archive › Mozilla › XUL › rows
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
rule - Archive of obsolete content
Archive › Mozilla › XUL › rule
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
script - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
scrollbox - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
scrollcorner - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
separator - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
spacer - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
spinbuttons - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
stack - Archive of obsolete content
Archive › Mozilla › XUL › stack
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
statusbar - Archive of obsolete content
r, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
<statusbarpanel> - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
stringbundle - Archive of obsolete content
indices of the format %n$s (e.g.
stringbundleset - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
tabpanel - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
template - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
textnode - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
timepicker - Archive of obsolete content
indicating whether a leading zero should be displayed before the second when it is less than 10.
toolbar - Archive of obsolete content
e dialog.
toolbargrippy - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
toolbaritem - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
toolbarpalette - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
toolbarseparator - Archive of obsolete content
r, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
toolbarset - Archive of obsolete content
r, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
toolbarspacer - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
toolbarspring - Archive of obsolete content
r, , , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
treechildren - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
treecols - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
treerow - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
treeseparator - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
triple - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
vbox - Archive of obsolete content
Archive › Mozilla › XUL › vbox
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
where - Archive of obsolete content
Archive › Mozilla › XUL › where
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
window - Archive of obsolete content
, , , classname, , , , , collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
wizard - Archive of obsolete content
t necessarily navigated in order.
wizardpage - Archive of obsolete content
collapsed, contextmenu, controllers, database, datasources, dir, , , flex, height, hidden, id, , , left, , maxheight, maxwidth, menu, minheight, minwidth, , , , , , , observes, ordinal, orient, , pack, , persist, , , , ref, resource, , , , , statustext, style, ,, tooltip, tooltiptext, top, width methods inherited methods addeventlistener(), appendchild(), blur, click, clonenode(), comparedocumentposition, dispatchevent(), docommand, focus, getattribute(), getattributenode(), getattributenodens(), getattributens(), getboundingclientrect(), getclientrects(), getelementsbyattribute, getelementsbyattributens, getelementsbyclassname(), getelementsbytagname(), getelementsbytagnamens(), getfeature, getuserdata, hasattribute(), hasattributens(), hasattributes(), hasc...
Debugging a XULRunner Application - Archive of obsolete content
) pref("devtools.debugger.remote-enabled", true); in firefox, go to tools > web developer > connect...
Getting started with XULRunner - Archive of obsolete content
thought that?
How to enable locale switching in a XULRunner application - Archive of obsolete content
titem); } // highlight current locale localelistbox.selecteditem = selecteditem; } catch (err) { alert (err); } 4.
XULRunner tips - Archive of obsolete content
r chrome manifest add a "skin" line: skin communicator classic/1.0 skin/communicator/ add a skin folder named "communicator" and add a single css file named "communicator.css" with this content: @import url("chrome://global/skin"); dom inspector to add dom inspector 2.0.* to your xulrunner 1.9.0.* application follow these steps: download the dom inspector (instead of clicking the "add to..." button, right-click and select "save link as...").
Windows and menus in XULRunner - Archive of obsolete content
up> </menu> </menubar> <toolbar id="main-toolbar"> <toolbarbutton id="open" label="&file.open;" oncommand="dofileopen();"/> <toolbarbutton id="save" label="&file.save;" oncommand="dofilesave();"/> </toolbar> </toolbox> ...
Mozilla.dev.apps.firefox-2006-09-29 - Archive of obsolete content
ect - looking for help for how to tap the http requests.
2006-09-29 - Archive of obsolete content
ect - looking for help for how to tap the http requests.
2006-10-13 - Archive of obsolete content
atible and versioning heads up robert strong describes the compatibility between windows vista and firefox, also about the versioning change.
2006-10-27 - Archive of obsolete content
tconfig october 27: alex replied to masaki posting, stating that he was going to use the work around that he provided and would provide feedback if it was successful or not.
2006-11-10 - Archive of obsolete content
of creating buttons using a small program, that allows you to create shortcuts to a particular address.
2006-10-13 - Archive of obsolete content
summary: mozilla.dev.l10n - october 13, 2006 announcements seamonkey 1.0.5 he-il seamonkey 1.0.5 in hebrew was released a while ago firefox 2 rc2 is out firefox 2 rc2 is out, to download click here sunbird_0_3_release tag being created sunbird_0_3_release tag being created seamonkey 1.1 localization freeze and beta upcoming there are no open blockers left.
NPN_Status - Archive of obsolete content
ction has the following parameters: instance pointer to the current plug-in instance.
NPP_DestroyStream - Archive of obsolete content
pstream* stream, npreason reason); parameters the function has the following parameters: instance pointer to current plug-in instance.
Writing a plugin for Mac OS X - Archive of obsolete content
efore you go on reading this article, you may wish to grab the sample code located here, as it will be referenced during this tutorial.
Create Your Own Firefox Background Theme - Archive of obsolete content
sure they are under 300 kb in size and jpg or png format!
Scratchpad - Archive of obsolete content
copied from the source and pasted into the "about:blank" page (a new empty tab) with the use page inspector's edit as html context menu command.
Developing cross-browser and cross-platform pages - Archive of obsolete content
the visiting browser.
-ms-touch-select - Archive of obsolete content
the -ms-touch-select css property is a microsoft extension that toggles the gripper visual elements that enable touch text selection.
Expression closures - Archive of obsolete content
typical lambda notation.
Object.prototype.watch() - Archive of obsolete content
tch method is inherited by every object descended from object.
LiveConnect Overview - Archive of obsolete content
to access the liveconnect classes, place the .jar or .zip file in the classpath of the jdk compiler in either of the following ways: create a classpath environment variable to specify the path and name of .jar or .zip file.
Implementation Status - Archive of obsolete content
from 1.1 we do not yet support @mode, @indent, @replace='text', @separator, @serialize, @target, header or method child elements 11.2 xforms-submit partial we currently limit (for security reasons) submission only back to the server that served the document.
Requests For Enhancement - Archive of obsolete content
Archive › Web › XForms › RFE
m about your request.
XForms Label Element - Archive of obsolete content
ng attributes, linking attributes, inline text.
Popup Window Controls - Archive of obsolete content
sed?
Anatomy of a video game - Game development
ome end condition occurs (such as winning, losing, or exiting to go to bed).
Game distribution - Game development
ve your game's code updated.
Game monetization - Game development
our games and split the earnings with you.
Implementing controls using the Gamepad API - Game development
to the one from the demo — the only difference is that the full version uses the turbo variable to decide whether or not the game will be launched using super turbo mode.
Track the score and win - Game development
clearinterval(interval); // needed for chrome to end game } } } } } } thanks to this, your users can actually win the game when they destroy all the bricks, which is quite important when it comes to games.
Game over - Game development
isses it.
Breadcrumb - MDN Web Docs Glossary: Definitions of Web-related terms
e order visited.
Control flow - MDN Web Docs Glossary: Definitions of Web-related terms
depending on whether the form is complete or not: if (field==empty) { promptuser(); } else { submitform(); } a typical script in javascript or php (and the like) includes many control structures, including conditionals, loops and functions.
First input delay - MDN Web Docs Glossary: Definitions of Web-related terms
first input delay (fid) measures the time from when a user first interacts with your site (i.e.
RTSP: Real-time streaming protocol - MDN Web Docs Glossary: Definitions of Web-related terms
real-time streaming protocol (rtsp) is a network protocol that controls how the streaming of a media should occur between a server and a client.
XLink - MDN Web Docs Glossary: Definitions of Web-related terms
xlink is a w3c standard which is used to describe links between xml and xml or other documents.
Test your skills: CSS and JavaScript accessibility - Learn web development
ed.
Test your skills: WAI-ARIA - Learn web development
adding a visible text label to the dom?
Pseudo-classes and pseudo-elements - Learn web development
section there are a large number of pseudo-classes and pseudo-elements, and it is useful to have a list to refer to.
The box model - Learn web development
e added display: inline-block to our <span> element.
Fundamental text and font styling - Learn web development
elementbyid("reset"); let htmlcode = htmlinput.value; let csscode = cssinput.value; const output = document.queryselector(".output"); const styleelem = document.createelement('style'); const headelem = document.queryselector('head'); headelem.appendchild(styleelem); function drawoutput() { output.innerhtml = htmlinput.value; styleelem.textcontent = cssinput.value; } reset.addeventlistener("click", function() { htmlinput.value = htmlcode; cssinput.value = csscode; drawoutput(); }); htmlinput.addeventlistener("input", drawoutput); cssinput.addeventlistener("input", drawoutput); window.addeventlistener("load", drawoutput); test your skills!
Styling lists - Learn web development
.value; var csscode = cssinput.value; var output = document.queryselector(".output"); var solution = document.getelementbyid("solution"); var styleelem = document.createelement('style'); var headelem = document.queryselector('head'); headelem.appendchild(styleelem); function drawoutput() { output.innerhtml = htmlinput.value; styleelem.textcontent = cssinput.value; } reset.addeventlistener("click", function() { htmlinput.value = htmlcode; cssinput.value = csscode; drawoutput(); }); solution.addeventlistener("click", function() { htmlinput.value = htmlcode; cssinput.value = 'ul {\n list-style-type: square;\n}\n\nul li, ol li {\n line-height: 1.5;\n}\n\nol {\n list-style-type: lower-alpha\n}'; drawoutput(); }); htmlinput.addeventlistener("input", drawoutput); cssinput.addev...
What text editors are available? - Learn web development
scenario, compile your editor from source.
What HTML features promote accessibility? - Learn web development
would jump from “here” to “anywhere” to “there”.
How do you host your website on Google App Engine? - Learn web development
ress the create button.
What is the difference between webpage, website, web server, and search engine? - Learn web development
wise, we only use the term document.
How do you upload your files to a web server? - Learn web development
e html basics for an example), you will probably want to put it online, on a web server.
What are hyperlinks? - Learn web development
being human-readable, urls already made things easier, but it's hard to type a long url whenever you want to access a document.
What is a Domain Name? - Learn web development
hand, let's see if i could register afunkydomainname.org: $ whois afunkydomainname.org not found as you can see, the domain does not exist in the whois database (at the time of writing), so we could ask to register it.
Example 3 - Learn web development
); }); window.addeventlistener('load', function () { var selectlist = document.queryselectorall('.select'); selectlist.foreach(function (select) { var optionlist = select.queryselectorall('.option'); optionlist.foreach(function (option) { option.addeventlistener('mouseover', function () { highlightoption(select, option); }); }); select.addeventlistener('click', function (event) { toggleoptlist(select); }, false); select.addeventlistener('focus', function (event) { activeselect(select, selectlist); }); select.addeventlistener('blur', function (event) { deactivateselect(select); }); select.addeventlistener('keyup', function (event) { if (event.keycode === 27) { deactivateselect(select); ...
Example 5 - Learn web development
r optionlist = select.queryselectorall('.option'), selectedindex = getindex(select); select.tabindex = 0; select.previouselementsibling.tabindex = -1; updatevalue(select, selectedindex); optionlist.foreach(function (option, index) { option.addeventlistener('mouseover', function () { highlightoption(select, option); }); option.addeventlistener('click', function (event) { updatevalue(select, index); }); }); select.addeventlistener('click', function (event) { toggleoptlist(select); }); select.addeventlistener('focus', function (event) { activeselect(select, selectlist); }); select.addeventlistener('blur', function (event) { deactivateselect(select); }); select.addeventlistener(...
Other form controls - Learn web development
size attribute provides control over how many options are visible when the select does not have focus.
HTML basics - Learn web development
t an href attribute, as shown below: <a href="">mozilla manifesto</a> fill in the value of this attribute with the web address that you want the link to link to: <a href="https://www.mozilla.org/about/manifesto/">mozilla manifesto</a> you might get unexpected results if you omit the https:// or http:// part, called the protocol, at the beginning of the web address.
Installing basic software - Learn web development
tedit.
Adding vector graphics to the Web - Learn web development
body { margin: 10px; background: #f5f9fa; } const textarea = document.getelementbyid('code'); const reset = document.getelementbyid('reset'); const solution = document.getelementbyid('solution'); const output = document.queryselector('.output'); let code = textarea.value; let userentry = textarea.value; function updatecode() { output.innerhtml = textarea.value; } reset.addeventlistener('click', function() { textarea.value = code; userentry = textarea.value; solutionentry = htmlsolution; solution.value = 'show solution'; updatecode(); }); solution.addeventlistener('click', function() { if(solution.value === 'show solution') { textarea.value = solutionentry; solution.value = 'hide solution'; } else { textarea.value = userentry; solution.value = 'show solut...
Mozilla splash page - Learn web development
nd embedding images and video in web pages, frames, and html responsive image techniques.
Index - Learn web development
anics, troubleshooting so you've published your website online?
Graceful asynchronous programming with Promises - Learn web development
too long!), and more interested in being able to respond to it being returned, whenever that is.
JavaScript building blocks - Learn web development
ter completion, but others do.
Fetching data from the server - Learn web development
can basically be used to represent large file-like objects, such as images or video files).
Introduction to web APIs - Learn web development
ent.queryselector('button'); const volumeslider = document.queryselector('.volume'); const audiosource = audioctx.createmediaelementsource(audioelement); next up we include a couple of event handlers that serve to toggle between play and pause when the button is pressed and reset the display back to the beginning when the song has finished playing: // play/pause audio playbtn.addeventlistener('click', function() { // check if context is in suspended state (autoplay policy) if (audioctx.state === 'suspended') { audioctx.resume(); } // if track is stopped, play it if (this.getattribute('class') === 'paused') { audioelement.play(); this.setattribute('class', 'playing'); this.textcontent = 'pause' // if track is playing, stop it } else if (t...
Basic math in JavaScript — numbers and operators - Learn web development
t holiday season it is zoom a map in or out depending on what zoom level is selected we'll look at how to code such logic when we look at conditional statements in a future article.
Handling text — strings in JavaScript - Learn web development
et response = one + 'i am fine — ' + two; response; note: when you enter an actual string in your code, enclosed in single or double quotes, it is called a string literal.
Storing the information you need — Variables - Learn web development
or more information on how to access this tool).
What went wrong? Troubleshooting JavaScript - Learn web development
s through to the debugger tab of the developer tools.
What is web performance? - Learn web development
und while the user gets on with primary tasks, and sometimes we only load assets when they are actually needed (this is called lazy loading).
Server-side web frameworks - Learn web development
g new users are your most valuable resources.
Routing in Ember - Learn web development
sult in the navigations appearing to fail / not actually filter.
Deployment and next steps - Learn web development
paths" > git push counting objects: 5, done.
Handling common HTML and CSS problems - Learn web development
.
Introduction to cross browser testing - Learn web development
finally, you can get smarter with your testing using auditing or automation tools; this is a sensible choice as your projects get bigger, as doing all this testing by hand can start to take a really long time.
Command line crash course - Learn web development
u, provided it is present in the current directory.
Client-side tooling overview - Learn web development
er to manage your dependencies for example, it is a good idea to go to the npm homepage and search for the type of tool you are looking for, for example try searching for "date" if you want a date formating utility, or "formatter" if you are searching for a general code formatter.
CSUN Firefox Materials
share their tricks with everyone!
Gecko info for Windows accessibility vendors
ture of the document is exposed in the msaa tree of iaccessibles.
Index
tensions, landing, mozilla add-ons allow developers to extend and modify the functionality of firefox.
Lightweight themes
e types of creative common licenses.
Creating MozSearch plugins
on="pref" pref="yahoo-fr" /> </url> <searchform>http://search.yahoo.com/</searchform> </searchplugin> let's say the user chooses to use the yahoo!
Debugging OpenGL
essentially turning opengl into a synchronous api.
The Firefox codebase: CSS Guidelines
h bug is bug 1516767.
Inner and outer windows
, while the outer window can keep track of all the documents (inner windows) it contains.
Displaying Places information using views
tion in an element not covered by one of the built-in views.
Blocked: Custom cookie permission
message firefox: cookieblockedbypermission=request to access cookies or storage on “x” was blocked because of custom cookie permission.
Errors
this page lists the errors that can be raised due to firefox's anti-tracking functionality, governed by the storage access policy.
mozbrowseropentab
rds track.
mozbrowseropenwindow
on a standards track.
HTMLIFrameElement.sendTouchEvent()
ray of numbers representing the y radius of each touch point in css pixels.
Browser API
embedded in it.
Getting Started with Chat
at ● ○ ● key: ● — binary or executable program available ○ — only available by downloading and compiling source code ●* — binary or executable may be available.
How to get a process dump with Windows Task Manager
ozilla.org/pub/mozilla.o.../latest-trunk/.
How to get a stacktrace for a bug report
1.
Downloads.jsm
ls.
source-editor.jsm
o changes to undo.
Localization and Plurals
...
Localization quick start guide
the technical aspects of mozilla l10n only.
Creating localizable web applications
e strings might be hidden in libraries' code (e.g.
MathML Demo: <mspace> - space
mathml demo: <mspace> - space the background color of <mspace> elements has been set to yellow for easier viewing.
Mozilla Development Tools
e developers can report bugs in the mozilla source releases, and browse an online database of already-reported bugs.
DMD
line numbers.
TimerFirings logging
la.org/repair/:7:13669 118 801266240[7f7c1f248000]: [7163] fn timer (one_shot 100 ms): [content] http://a.visualrevenue.com/vrs.js:6:9423 103 801266240[7f7c1f248000]: [7163] fn timer (one_shot 50 ms): [content] http://static.dynamicyield.com/scripts/12086/dy-min.js?v=12086:3:3389 94 801266240[7f7c1f248000]: [7163] fn timer (one_shot 50 ms): [content] https://ad.doubleclick.net/ddm/adi/n7921.1283839cadreon.com.au/b9038144.122190976;sz=300x600;click=http://pixel.mathtag.com/click/img?mt_aid=2744535504761193354&mt_id=1895890&mt_adid=148611&mt_sid=973379&mt_exid=9&mt_inapp=0&mt_uuid=353d5460-19f6-4400-9bbd-d0fcc3bcf595&mt_3pck=http%3a//beacon-apac-hkg1.rubiconproject.com/beacon/t/d1f9921d-4e47-448f-b6ba-36cae1c31b65/&redirect=;ord=2744535504761193354?:83:0 94 8012...
Phishing: a short definition
so we see a mix of these deployed by various services.
Preference reference
accessibility.tabfocusthe preference accessibility.tabfocus controls what elements receive focus when the user presses the tab key.browser.altclicksavethe preference browser.altclicksave controls whether clicking a link while holding the alt key starts the download of that link.browser.dom.window.dump.enabledthis setting enables the dump function, which sends messages to the system console.
Patches and pushes
lt plugin (e.g., wikipedia), the xml filename should include the locale code (e.g., wikipedia-es).
Productization guide
eful and relevant content) is obvious: we want to improve our users’ experience on the web, so we provide a couple of well-thought suggestions for different services.
Debugging out-of-memory problems
a common bug to diagnose with emscripten is where a big game fails due to an out of memory error (oom) somewhere during load time.
Emscripten techniques
this page contains specific emscripten-related techniques.
Creating a Cookie Log
ows for other applications).
4.3.1 Release Notes
les.
4.3 Release Notes
run time behavior of jss can be affected by the nss environment variables.
sslerr.html
m not supported.
Getting SpiderMonkey source code
latest spidermonkey sources.
Index
led a fragment.
JSAPI User Guide
ke life easier when using spidermonkey and jsapi.
SpiderMonkey 52
these release notes are incomplete.
SpiderMonkey releases
e.
Gecko Roles
title bar of a window on most platforms or at the top of the screen on mac os x) from which menus are selected by the user.
AT APIs Support
o-based software.
XUL Accessibility
tion value="it's label for control" control="control" /> <hbox role="grouping" id="control" /> get tooltiptext attribute value if the aria role is used and it allows to have accessible value then aria-valuetext or aria-valuenow are used if the element is xlink then value is generated from link location actions if the element is xlink then jump action is exposed if the element has registered click event handler then click action is exposed xul elements notification used to display an informative message.
Feed content access API
his array contains nsifeedentry objects that describe each feed item.
Frecency algorithm
utoff) ..
Places Developer Guide
basic visit via the core places history service.
Querying Places
visit date for each node will be the last visit date for that url.
Using the Places history service
this into two tables (see history service design).
Creating the Component Code
ur component, you can use the uuidgen tool that comes with most unix distributions and with microsoft visual c++.
Setting up the Gecko SDK
d set its location.
nsIAboutModule
about uri.
nsIAccessibleRole
ned beneath the title bar of a window) from which menus are selected by the user.
nsIBrowserHistory
gecko 22.0 (firefox 22.0 / thunderbird 22.0 / seamonkey 2.19) note: this method was moved to another interface in gecko 22.0.
nsIChannel
ag can be set, for example, for redirects or for cases when a single channel has multiple parts to it (and thus can follow onstoprequest with another onstartrequest/onstoprequest pair, each pair for a different request).
nsIClipboard
boolean supportsselectionclipboard(); boolean supportsfindclipboard(); constants most clipboard operations in firefox use kglobalclipboard, which is the one also used by the typical control-c/control-v keyboard shortcuts.
nsIContentViewManager
ew.
nsIDocShell
optimizations such as image frame discarding.
nsIExternalProtocolService
he protocol.
nsIFocusManager
cused, do not switch focus to that window.
nsIMacDockSupport
y void activateapplication(in boolean aignoreotherapplications); attributes attribute type description badgetext astring text to display in a badge on the application's dock icon.
nsIMsgFolder
scope boolean readonly customidentity nsimsgidentity readonly: this allows a folder to have a special identity.
nsINavHistoryResultTreeViewer
in nsinavhistoryresultnode anode); attributes attribute type description collapseduplicates boolean controls whether duplicate adjacent elements are collapsed into a single item in the tree.
nsISHEntry
that this is a session history entry for.
nsITextInputProcessorNotification
ndled.
nsIWebNavigation
this flag specifies that the load should have the semantics of an html meta-refresh tag (that is, that the cache should be bypassed).
Using the clipboard
ional error checking: var copytext = "text to copy"; var trans = transferable(sourcewindow); trans.adddataflavor("text/unicode"); trans.settransferdata("text/unicode", supportsstring(copytext), copytext.length * 2); services.clipboard.setdata(trans, null, services.clipboard.kglobalclipboard); the complete function shown below copies some text to the clipboard as html, as well as making it a clickable hyperlink.
XUL Overlays
Mozilla › Tech › XUL › Overlays
fines the basic ui for the navigator package), these new plug-in elements would be defined as a collection of elements or subtrees: <menuitem name="super stream player"/> <menupopup name="ss favorites"> <menuitem name="wave" src="mavericks.ssp"/> <menuitem name="soccer" src="brazil_soccer.ssp"/> </menupopup> <titledbutton id="ssp" crop="right" flex="1" value="&ssbutton.label;" onclick="firessp()"/> overlays and id attributes bases and overlays are merged when they share the same id attribute.
Xray vision
in web pages can add extra properties to dom objects (also known as expando properties) and even redefine standard dom objects to do something unexpected.
Address Book examples
nd "addrbook" behaviours can be changed by passing an identity key (see nsimsgidentity.key) via an attribute autocompletesearchparam on the textbox element.
Thunderbird Binaries
areas of the code which are too risky to change when approaching a release.
Theme Packaging
g chrome/ browser/files communicator/files global/files mozapps/files ...
customDBHeaders Preference
rg/keymaster/gatekeeper/there.is.only.xul"> <script type='application/javascript' src='chrome://superfluous/content/superfluous.js'/> <tree id="threadtree"> <treecols id="threadcols"> <splitter class="tree-splitter" /> <treecol id="colsuperfluous" persist="hidden ordinal width" currentview="unthreaded" flex="1" label="superfluous" tooltiptext="click to sort by superfluous" /> </treecols> </tree> </overlay> you should insure that whatever id you use for the treecol you're adding matches the reference from your javascript code (i.e.
Using MAPI with Thunderbird's Windows 7 developer builds
and mapiproxy to mapiproxy_inuse.dll.
Using tab-modal prompts
l state of checkbox, however if no text is supplied the checkbox is not shown var input = {value: 'pre filled value'}; var ok = prompt.prompt.apply(null, ['title - but not shown in tab modal', 'text goes here', input, 'check text, if no text, checkbox is not shown', check]); //this here is just an alert, showing the values of the prompt prompt.alert.apply(null, ['title not shown in modal', 'user clicked ok: ' + ok + '\n' + 'checked: ' + check.value + '\ninput value: ' + input.value]); note: because the prompts are shown in a tab, if the tab is closed while the prompt is open it will throw an exception.
Zombie compartments
firefox’s own javascript code also gets one or more compartments and so do add-on scripts.
Using js-ctypes
foundation says...'), body: makecfstr('we just called the equivalent of the "standardalert carbon function" for 64bit osx from javascript!') }; var rez = cfusernotificationdisplaynotice(0, kcfusernotificationcautionalertlevel, null, null, null, mycfstrs.head, mycfstrs.body, null); console.info('rez:', rez, rez.tostring(), uneval(rez)); // cfusernotificationdisplaynotice does not block till user clicks dialog, it will return immediately if (rez.tostring() == '0') { console.log('notification was succesfully shown!!'); } else { console.error('failed to show notification...
Blocking By Domain - Plugins
plugins such as flash are a performance and security problem for firefox users.
Constants - Plugins
not_seekable 13 seekable stream expected.
Drawing and Event Handling - Plugins
cursor is, the browser does not show the drag highlight when the cursor is over an instance rectangle.
Streams - Plugins
instance, npstream *stream, nperror reason); the instance parameter is the current plug-in instance; the stream parameter specifies the stream to be deleted.
URLs - Plugins
ent is already at the top.
Plugins
plugins can no longer be loaded from any url scheme except for http:// and https:// (bug 1335475).
DOM Inspector internals - Firefox Developer Tools
nspect chrome document") popups from the file menu, and the "document viewer" and "object viewer" menus from the view menu.
Inspecting web app manifests - Firefox Developer Tools
rrect format.
DOM Property Viewer - Firefox Developer Tools
ed "dom" in the toolbox.
Break on DOM mutation - Firefox Developer Tools
), and element.classlist.add(), or setting element.id.
Debug eval sources - Firefox Developer Tools
that is evaluated dynamically, either as a string passed to eval() or as a string passed to the function constructor.
Set a conditional breakpoint - Firefox Developer Tools
hat occur the last time through a loop, for example.
Set event listener breakpoints - Firefox Developer Tools
done by finding jquery.js in the sources panel, and choosing the ignore source option from its context menu.
Deprecated tools - Firefox Developer Tools
d will be removed as of firefox 72 (bug 1519103).
Monster example - Firefox Developer Tools
; i &lt; monster_count; i++) { monsters.friendly.push(new monster()); } for (var i = 0; i &lt; monster_count; i++) { monsters.fierce.push(new monster()); } for (var i = 0; i &lt; monster_count; i++) { monsters.undecided.push(new monster()); } console.log(monsters); } var makemonstersbutton = document.getelementbyid("make-monsters"); makemonstersbutton.addeventlistener("click", makemonsters); the page contains a button: when you push the button, the code creates some monsters.
Network Monitor - Firefox Developer Tools
quests firefox makes (for example, when it loads a page, or due to xmlhttprequests), how long each request takes, and details of each request.
Examine Event Listeners - Firefox Developer Tools
the inspector shows the word "event" next to elements in the html pane, that have event listeners bound to them: click the icon, then you'll see a popup listing all the event listeners bound to this element: each line contains: a right-pointing arrowhead; click to expand the row and show the listener function source code a curved arrow pointing to a stack; click it to show the code for the handler in the debugger the name of the event for which a handler was attached to this element the name and line number for the listener; you can also click here to expand the row and view the listener function source code a label indicating whether the event bubbles a label indicating the system that defines the event.
Open the Inspector - Firefox Developer Tools
there are two main ways to open the inspector: choose tools > web developer > inspector from the menu bar or the equivalent keyboard shortcut.
Reposition elements in the page - Firefox Developer Tools
new in firefox 48 starting in firefox 48 you can move absolutely positioned elements by dragging them around the page.
Use the Inspector from the Web Console - Firefox Developer Tools
the element that's currently selected in the page inspector can be referenced in the web console using the variable $0.
View background images - Firefox Developer Tools
in the rules view, you can see a preview of images specified using background-image.
Animation inspector example: CSS transitions - Firefox Developer Tools
return; } if (e.target.classlist.contains("icon")) { var wasselected = (e.target.getattribute("id") == "selected"); clearselection(); if (!wasselected) { e.target.setattribute("id", "selected"); } } } function clearselection() { var selected = document.getelementbyid("selected"); if (selected) { selected.removeattribute("id"); } } document.addeventlistener("click", toggleselection); ...
Animation inspector example: Web Animations API - Firefox Developer Tools
eyframeoptions); iconanimation.pause(); noteanimation.pause(); var firsttime = true; function animatechannel(e) { if (e.button != 0) { return; } if (e.target.id != "icon") { return; } if (firsttime) { iconanimation.play(); noteanimation.play(); firsttime = false; } else { iconanimation.reverse(); noteanimation.reverse(); } } document.addeventlistener("click", animatechannel); ...
Frame rate - Firefox Developer Tools
lated with the waterfall summary directly above it, and there we can see that the first two drops in the frame rate are correlated with orange bars, which denote time spent executing javascript.
Intensive JavaScript - Firefox Developer Tools
the same as the original code.
Taking screenshots - Firefox Developer Tools
or of a single element in the page.
Toolbox - Firefox Developer Tools
the toolbox provides a single home for most of the developer tools that are built into firefox.
Web console keyboard shortcuts - Firefox Developer Tools
command windows macos linux open the web console ctrl + shift + k cmd + opt + k ctrl + shift + k search in the message display pane ctrl + f cmd + f ctrl + f open the object inspector pane ctrl + click ctrl + click ctrl + click clear the object inspector pane esc esc esc focus on the command line ctrl + shift + k cmd + opt + k ctrl + shift + k clear output ctrl + shift + l ctrl + l from firefox 67: cmd + k ctrl + shift + l command line interpreter these shortcuts apply when you're in the command line interpreter.
Working with iframes - Firefox Developer Tools
you can point the developer tools at a specific iframe within a document.
Animation.pause() - Web APIs
Web › API › Animation › pause
must be paused manually if you want to avoid that: // animation of the cupcake slowly getting eaten up var nommingcake = document.getelementbyid('eat-me_sprite').animate( [ { transform: 'translatey(0)' }, { transform: 'translatey(-80%)' } ], { fill: 'forwards', easing: 'steps(4, end)', duration: alicechange.effect.timing.duration / 2 }); // doesn't actually need to be eaten until a click event, so pause it initially: nommingcake.pause(); additionally, when resetting : // an all-purpose function to pause the animations on alice, the cupcake, and the bottle that reads "drink me." var stopplayingalice = function() { alicechange.pause(); nommingcake.pause(); drinking.pause(); }; // when the user releases the cupcake or the bottle, pause the animations.
Animation.reverse() - Web APIs
Web › API › Animation › reverse
erse() method of the animation interface reverses the playback direction, meaning the animation ends at its beginning.
Attr.prefix - Web APIs
Web › API › Attr › prefix
the attr.prefix read-only property returns the namespace prefix of the specified attribute, or null if no prefix is specified.
AudioBuffer.duration - Web APIs
he buffer.
AudioBuffer.getChannelData() - Web APIs
ueryselector('button'); var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; // stereo var channels = 2; // create an empty two second stereo buffer at the // sample rate of the audiocontext var framecount = audioctx.samplerate * 2.0; var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); button.onclick = function() { // fill the buffer with white noise; //just random values between -1.0 and 1.0 for (var channel = 0; channel < channels; channel++) { // this gives us the actual arraybuffer that contains the data var nowbuffering = myarraybuffer.getchanneldata(channel); for (var i = 0; i < framecount; i++) { // math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.
AudioBuffer.length - Web APIs
the buffer.
AudioBuffer.numberOfChannels - Web APIs
syntax var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); myarraybuffer.numberofchannels; value an integer.
AudioBuffer.sampleRate - Web APIs
ate); myarraybuffer.samplerate; value a floating-point value indicating the current sample rate of the buffers data, in samples per second.
AudioBufferSourceNode.buffer - Web APIs
rates a single channel containing silence (that is, every sample is 0).
AudioBufferSourceNode.loop - Web APIs
(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // wire up buttons to stop and play audio, and range slider control play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); playbackcontrol.removeattribute('disabled'); } specification specification status comment web audio apithe definition of 'loop' in that specification.
AudioBufferSourceNode.playbackRate - Web APIs
(audiodata, function(buffer) { mybuffer = buffer; source.buffer = mybuffer; source.playbackrate.value = playbackcontrol.value; source.connect(audioctx.destination); source.loop = true; }, function(e){"error with decoding audio data" + e.err}); } request.send(); } // wire up buttons to stop and play audio, and range slider control play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); playbackcontrol.removeattribute('disabled'); } stop.onclick = function() { source.stop(0); play.removeattribute('disabled'); playbackcontrol.setattribute('disabled', 'disabled'); } playbackcontrol.oninput = function() { source.playbackrate.value = playbackcontrol.value; playbackvalue.innerhtm...
AudioParam.exponentialRampToValueAtTime() - Web APIs
it var source = audioctx.createmediaelementsource(myaudio); // create a gain node and set its gain value to 0.5 var gainnode = audioctx.creategain(); // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination gainnode.gain.setvalueattime(0, audioctx.currenttime); source.connect(gainnode); gainnode.connect(audioctx.destination); // set buttons to do something onclick exprampplus.onclick = function() { gainnode.gain.exponentialramptovalueattime(1.0, audioctx.currenttime + 2); } exprampminus.onclick = function() { gainnode.gain.exponentialramptovalueattime(0.01, audioctx.currenttime + 2); } note: a value of 0.01 was used for the value to ramp down to in the last function rather than 0, as an invalid or illegal string error is thrown if 0 is used — the...
AudioParam.linearRampToValueAtTime() - Web APIs
it var source = audioctx.createmediaelementsource(myaudio); // create a gain node and set it's gain value to 0.5 var gainnode = audioctx.creategain(); // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination gainnode.gain.setvalueattime(0, audioctx.currenttime); source.connect(gainnode); gainnode.connect(audioctx.destination); // set buttons to do something onclick linearrampplus.onclick = function() { gainnode.gain.linearramptovalueattime(1.0, audioctx.currenttime + 2); } linearrampminus.onclick = function() { gainnode.gain.linearramptovalueattime(0, audioctx.currenttime + 2); } specifications specification status comment web audio apithe definition of 'linearramptovalueattime' in that specification.
AudioParam.setTargetAtTime() - Web APIs
ource = audioctx.createmediaelementsource(myaudio); // create a gain node and set it's gain value to 0.5 var gainnode = audioctx.creategain(); gainnode.gain.value = 0.5; var currgain = gainnode.gain.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination source.connect(gainnode); gainnode.connect(audioctx.destination); // set buttons to do something onclick attimeplus.onclick = function() { currgain = 1.0; gainnode.gain.settargetattime(1.0, audioctx.currenttime + 1, 0.5); } attimeminus.onclick = function() { currgain = 0; gainnode.gain.settargetattime(0, audioctx.currenttime + 1, 0.5); } specifications specification status comment web audio apithe definition of 'settargetattime' in that specification.
AudioParam.setValueAtTime() - Web APIs
ource = audioctx.createmediaelementsource(myaudio); // create a gain node and set it's gain value to 0.5 var gainnode = audioctx.creategain(); gainnode.gain.value = 0.5; var currgain = gainnode.gain.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination source.connect(gainnode); gainnode.connect(audioctx.destination); // set buttons to do something onclick targetattimeplus.onclick = function() { currgain += 0.25; gainnode.gain.setvalueattime(currgain, audioctx.currenttime + 1); } targetattimeminus.onclick = function() { currgain -= 0.25; gainnode.gain.setvalueattime(currgain, audioctx.currenttime + 1); } specifications specification status comment web audio apithe definition of 'setvalueattime' in that specificati...
AudioParam.setValueCurveAtTime() - Web APIs
source = audioctx.createmediaelementsource(myaudio); // create a gain node and set it's gain value to 0.5 var gainnode = audioctx.creategain(); gainnode.gain.value = 0.5; var currgain = gainnode.gain.value; // connect the audiobuffersourcenode to the gainnode // and the gainnode to the destination source.connect(gainnode); gainnode.connect(audioctx.destination); // set button to do something onclick var wavearray = new float32array(9); wavearray[0] = 0.5; wavearray[1] = 1; wavearray[2] = 0.5; wavearray[3] = 0; wavearray[4] = 0.5; wavearray[5] = 1; wavearray[6] = 0.5; wavearray[7] = 0; wavearray[8] = 0.5; valuecurve.onclick = function() { gainnode.gain.setvaluecurveattime(wavearray, audioctx.currenttime, 2); } specifications specification status comment web au...
AudioProcessingEvent - Web APIs
getchanneldata(channel); // loop through the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make output equal to the same as the input outputdata[sample] = inputdata[sample]; // add noise to each output sample outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } } getdata(); // wire up play button playbutton.onclick = function() { source.connect(scriptnode); scriptnode.connect(audioctx.destination); source.start(); } // when the buffer source stops playing, disconnect everything source.onended = function() { source.disconnect(scriptnode); scriptnode.disconnect(audioctx.destination); } ...
BaseAudioContext.createBufferSource() - Web APIs
ueryselector('button'); var pre = document.queryselector('pre'); var myscript = document.queryselector('script'); pre.innerhtml = myscript.innerhtml; // stereo var channels = 2; // create an empty two second stereo buffer at the // sample rate of the audiocontext var framecount = audioctx.samplerate * 2.0; var myarraybuffer = audioctx.createbuffer(2, framecount, audioctx.samplerate); button.onclick = function() { // fill the buffer with white noise; //just random values between -1.0 and 1.0 for (var channel = 0; channel < channels; channel++) { // this gives us the actual arraybuffer that contains the data var nowbuffering = myarraybuffer.getchanneldata(channel); for (var i = 0; i < framecount; i++) { // math.random() is in [0; 1.0] // audio needs to be in [-1.0; 1.
BaseAudioContext.createDynamicsCompressor() - Web APIs
or.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.destination); } else if(active == 'true') { button.setattribute('data-active', 'false'); butto...
BaseAudioContext.createScriptProcessor() - Web APIs
getchanneldata(channel); // loop through the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make output equal to the same as the input outputdata[sample] = inputdata[sample]; // add noise to each output sample outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } } getdata(); // wire up play button playbutton.onclick = function() { source.connect(scriptnode); scriptnode.connect(audioctx.destination); source.start(); } // when the buffer source stops playing, disconnect everything source.onended = function() { source.disconnect(scriptnode); scriptnode.disconnect(audioctx.destination); } specifications specification status comment web audio apithe definition of 'creat...
BaseAudioContext.decodeAudioData() - Web APIs
request.onload = function() { var audiodata = request.response; audioctx.decodeaudiodata(audiodata, function(buffer) { source.buffer = buffer; source.connect(audioctx.destination); source.loop = true; }, function(e){ console.log("error with decoding audio data" + e.err); }); } request.send(); } // wire up buttons to stop and play audio play.onclick = function() { getdata(); source.start(0); play.setattribute('disabled', 'disabled'); } stop.onclick = function() { source.stop(0); play.removeattribute('disabled'); } // dump script to pre element pre.innerhtml = myscript.innerhtml; new promise-based syntax ctx.decodeaudiodata(audiodata).then(function(decodeddata) { // use the decoded data here }); specifications spec...
CSSStyleDeclaration.setProperty() - Web APIs
const newborder = random(1, 50) + 'px solid ' + randomcolor(); boxpararule.style.setproperty('border', newborder); } function setrandombgcolor() { const newbgcolor = randomcolor(); boxpararule.style.setproperty('background-color', newbgcolor); } function setrandomcolor() { const newcolor = randomcolor(); boxpararule.style.setproperty('color', newcolor); } borderbtn.addeventlistener('click', setrandomborder); bgcolorbtn.addeventlistener('click', setrandombgcolor); colorbtn.addeventlistener('click', setrandomcolor); result specifications specification status comment css object model (cssom)the definition of 'cssstyledeclaration.setproperty()' in that specification.
Cache - Web APIs
Web › API › Cache
che to a specific, versioned cache name.
CanvasPattern.setTransform() - Web APIs
canvas.getcontext('2d'); var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var edit = document.getelementbyid('edit'); var code = textarea.value; var svg1 = document.getelementbyid('svg1'); var matrix = svg1.createsvgmatrix(); function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener('click', function() { textarea.focus(); }) textarea.addeventlistener('input', drawcanvas); window.addeventlistener('load', drawcanvas); specifications specification status comment html living standardthe definition of 'canvaspattern.settransform' in that specification.
CanvasRenderingContext2D.addHitRegion() - Web APIs
.stroke();</textarea> var canvas = document.getelementbyid("canvas"); var ctx = canvas.getcontext("2d"); var textarea = document.getelementbyid("code"); var reset = document.getelementbyid("reset"); var edit = document.getelementbyid("edit"); var code = textarea.value; function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener("click", function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener("click", function() { textarea.focus(); }); canvas.addeventlistener("mousemove", function(event){ if(event.region) { alert("ouch, my eye :("); } }); textarea.addeventlistener("input", drawcanvas); window.addeventlistener("load", drawcanvas); specifications canvas hit regions have been removed from...
CanvasRenderingContext2D.miterLimit - Web APIs
.stroke();</textarea> var canvas = document.getelementbyid("canvas"); var ctx = canvas.getcontext("2d"); var textarea = document.getelementbyid("code"); var reset = document.getelementbyid("reset"); var edit = document.getelementbyid("edit"); var code = textarea.value; function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener("click", function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener("click", function() { textarea.focus(); }) textarea.addeventlistener("input", drawcanvas); window.addeventlistener("load", drawcanvas); screenshotlive sample specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.miterlimit' in tha...
CanvasRenderingContext2D.scrollPathIntoView() - Web APIs
ntoview();</textarea> var canvas = document.getelementbyid("canvas"); var ctx = canvas.getcontext("2d"); var textarea = document.getelementbyid("code"); var reset = document.getelementbyid("reset"); var edit = document.getelementbyid("edit"); var code = textarea.value; function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener("click", function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener("click", function() { textarea.focus(); }) textarea.addeventlistener("input", drawcanvas); window.addeventlistener("load", drawcanvas); specifications specification status comment html living standardthe definition of 'canvasrenderingcontext2d.scrollpathintoview' in that specificati...
Applying styles and colors - Web APIs
be a positive number'); } // draw lines ctx.beginpath(); ctx.moveto(0, 100); for (i = 0; i < 24 ; i++) { var dy = i % 2 == 0 ?
Drawing text - Web APIs
, 0, 100);</textarea> var canvas = document.getelementbyid('canvas'); var ctx = canvas.getcontext('2d'); var textarea = document.getelementbyid('code'); var reset = document.getelementbyid('reset'); var edit = document.getelementbyid('edit'); var code = textarea.value; function drawcanvas() { ctx.clearrect(0, 0, canvas.width, canvas.height); eval(textarea.value); } reset.addeventlistener('click', function() { textarea.value = code; drawcanvas(); }); edit.addeventlistener('click', function() { textarea.focus(); }) textarea.addeventlistener('input', drawcanvas); window.addeventlistener('load', drawcanvas); advanced text measurements in the case you need to obtain more details about the text, the following method allows you to measure it.
Pixel manipulation with canvas - Web APIs
ta(imagedata, 0, 0); }; var grayscale = function() { for (var i = 0; i < data.length; i += 4) { var avg = (data[i] + data[i + 1] + data[i + 2]) / 3; data[i] = avg; // red data[i + 1] = avg; // green data[i + 2] = avg; // blue } ctx.putimagedata(imagedata, 0, 0); }; var invertbtn = document.getelementbyid('invertbtn'); invertbtn.addeventlistener('click', invert); var grayscalebtn = document.getelementbyid('grayscalebtn'); grayscalebtn.addeventlistener('click', grayscale); } zooming and anti-aliasing with the help of the drawimage() method, a second canvas and the imagesmoothingenabled property, we are able to zoom into our picture and see the details.
CloseEvent.initCloseEvent() - Web APIs
do not use this method anymore as it is deprecated.
Console.group() - Web APIs
Web › API › Console › group
e 59 tested) does not work with console.groupend().
Console.table() - Web APIs
Web › API › Console › table
display: // an array of objects, logging only firstname function person(firstname, lastname) { this.firstname = firstname; this.lastname = lastname; } var john = new person("john", "smith"); var jane = new person("jane", "doe"); var emily = new person("emily", "jones"); console.table([john, jane, emily], ["firstname"]); sorting columns you can sort the table by a particular column by clicking on that column's label.
Console.timeEnd() - Web APIs
Web › API › Console › timeEnd
ted by calling console.time().
Console.timeLog() - Web APIs
Web › API › Console › timeLog
he console.
CustomEvent - Web APIs
at which the event was created (in milliseconds).
DOMImplementation.createHTMLDocument() - Web APIs
.createhtmldocument() method creates a new html document.
DOMTokenList.toggle() - Web APIs
in the following example we retrieve the list of classes set on a <span> element as a domtokenlist using element.classlist.
DataTransfer.mozSourceNode - Web APIs
the datatransfer.mozsourcenode property is used to determine the node over which the mouse cursor was located when the the drag operation was initiated (for example, when a <button> was clicked).
Detecting device orientation - Web APIs
= 90}; if (x < -90) { x = -90}; // to make computation easier we shift the range of // x and y to [0,180] x += 90; y += 90; // 10 is half the size of the ball // it center the positioning point to the center of the ball ball.style.top = (maxy*y/180 - 10) + "px"; ball.style.left = (maxx*x/180 - 10) + "px"; } window.addeventlistener('deviceorientation', handleorientation); click here to open this example in a new window; because deviceorientation doesn't work in a cross-origin <iframe> in all browsers.
Document: DOMContentLoaded event - Web APIs
ol log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } #reload { height: 2rem; } js const log = document.queryselector('.event-log-contents'); const reload = document.queryselector('#reload'); reload.addeventlistener('click', () => { log.textcontent =''; window.settimeout(() => { window.location.reload(true); }, 200); }); window.addeventlistener('load', (event) => { log.textcontent = log.textcontent + 'load\n'; }); document.addeventlistener('readystatechange', (event) => { log.textcontent = log.textcontent + `readystate: ${document.readystate}\n`; }); document.addeventlistener('domcontentloade...
Document.characterSet - Web APIs
header or inline like <meta charset="utf-8">, such as with firefox's view → text encoding menu.
Document.getElementsByTagNameNS() - Web APIs
ead> <body style="border: solid green 3px"> <p>some outer text</p> <p>some outer text</p> <div id="div1" style="border: solid blue 3px"> <p>some div1 text</p> <p>some div1 text</p> <p>some div1 text</p> <div id="div2" style="border: solid red 3px"> <p>some div2 text</p> <p>some div2 text</p> </div> </div> <p>some outer text</p> <p>some outer text</p> <button onclick="getallparaelems();"> show all p elements in document</button><br /> <button onclick="div1paraelems();"> show all p elements in div1 element</button><br /> <button onclick="div2paraelems();"> show all p elements in div2 element</button> </body> </html> potential workaround for other browsers which do not support if the desired browser did not support xpath, another approach (such as trav...
Document: keydown event - Web APIs
229 is a special value set for a keycode relating to an event that has been processed by an ime): eventtarget.addeventlistener("keydown", event => { if (event.iscomposing || event.keycode === 229) { return; } // do something }); examples addeventlistener keydown example this example logs the keyboardevent.code value whenever you press down a key.
Document: keyup event - Web APIs
this (229 is a special value set for a keycode relating to an event that has been processed by an ime): eventtarget.addeventlistener("keyup", event => { if (event.iscomposing || event.keycode === 229) { return; } // do something }); examples this example logs the keyboardevent.code value whenever you release a key.
Document.onfullscreenchange - Web APIs
ther the transition is into or out of full-screen mode, so your event handler should look at the value of document.fullscreenelement.
Document.popupNode - Web APIs
note: starting with gecko 2.0, authors are encouraged to use the menupopup property triggernode instead.
Document.queryCommandState() - Web APIs
andstate() method will tell you if the current selection has a certain document.execcommand() command applied.
Document: readystatechange event - Web APIs
ol log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } #reload { height: 2rem; } js const log = document.queryselector('.event-log-contents'); const reload = document.queryselector('#reload'); reload.addeventlistener('click', () => { log.textcontent =''; window.settimeout(() => { window.location.reload(true); }, 200); }); window.addeventlistener('load', (event) => { log.textcontent = log.textcontent + 'load\n'; }); document.addeventlistener('readystatechange', (event) => { log.textcontent = log.textcontent + `readystate: ${document.readystate}\n`; }); document.addeventlistener('domcontentloade...
Introduction to the DOM - Web APIs
>link</tt></b></p> <select onchange="setbodyattr('link', this.options[this.selectedindex].value);"> <option value="blue">blue</option> <option value="green">green</option> </select> <small> <a href="http://some.website.tld/page.html" id="sample"> (sample link) </a> </small><br /> <input type="button" value="version" onclick="ver()" /> </form> </div> </body> </html> to test a lot of interfaces in a single page—for example, a "suite" of properties that affect the colors of a web page—you can create a similar test page with a whole console of buttons, textfields, and other html elements.
Example - Web APIs
nd paragraph var newelement = document.createelement("p"); // put the text in the paragraph newelement.appendchild(newtext); // and put the paragraph on the end of the document by appending it to // the body (which is the parent of para) para.parentnode.appendchild(newelement); } </script> </head> <body> <input type="button" value="change this document." onclick="change()"> <h1>header</h1> <p>paragraph</p> </body> </head> ...
Using the W3C DOM Level 1 Core - Web APIs
use javascript to access the document property of the global object.
DynamicsCompressorNode.attack - Web APIs
or.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.destination); } else if(active == 'true') { button.setattribute('data-active', 'false'); butto...
DynamicsCompressorNode.knee - Web APIs
or.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.destination); } else if(active == 'true') { button.setattribute('data-active', 'false'); butto...
DynamicsCompressorNode.ratio - Web APIs
or.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.destination); } else if(active == 'true') { button.setattribute('data-active', 'false'); butto...
DynamicsCompressorNode.release - Web APIs
or.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.destination); } else if(active == 'true') { button.setattribute('data-active', 'false'); butto...
DynamicsCompressorNode.threshold - Web APIs
or.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.destination); } else if(active == 'true') { button.setattribute('data-active', 'false'); butto...
DynamicsCompressorNode - Web APIs
or.threshold.setvalueattime(-50, audioctx.currenttime); compressor.knee.setvalueattime(40, audioctx.currenttime); compressor.ratio.setvalueattime(12, audioctx.currenttime); compressor.attack.setvalueattime(0, audioctx.currenttime); compressor.release.setvalueattime(0.25, audioctx.currenttime); // connect the audiobuffersourcenode to the destination source.connect(audioctx.destination); button.onclick = function() { var active = button.getattribute('data-active'); if(active == 'false') { button.setattribute('data-active', 'true'); button.innerhtml = 'remove compression'; source.disconnect(audioctx.destination); source.connect(compressor); compressor.connect(audioctx.destination); } else if(active == 'true') { button.setattribute('data-active', 'false'); butto...
Element: DOMActivate event - Web APIs
the domactivate event is fired at an element when it becomes active, such as when it is clicked on using the mouse or a keypress is used to navigate to it.
Element.attachShadow() - Web APIs
shadowroot: element.shadowroot; // returns a shadowroot obj closed: denies access to the node(s) of a closed shadow root from javascript outside it: element.shadowroot; // returns null delegatesfocus a boolean that, when set to true, specifies behavior that mitigates custom element issues around focusability.
Element.attributes - Web APIs
i = attrs.length - 1; i >= 0; i--) { output += attrs[i].name + "->" + attrs[i].value; } result.value = output; } else { result.value = "no attributes to show"; } } </script> </head> <body> <p id="paragraph" style="color: green;">sample paragraph</p> <form action=""> <p> <input type="button" value="show first attribute name and value" onclick="listattributes();"> <input id="result" type="text" value=""> </p> </form> </body> </html> specifications specification status comment domthe definition of 'element.attributes' in that specification.
Element: error event - Web APIs
margin: .5rem; } img { width: 0; height: 0; } js const log = document.queryselector('.event-log-contents'); const badimg = document.queryselector('.bad-img'); badimg.addeventlistener('error', (event) => { log.textcontent = log.textcontent + `${event.type}: loading image\n`; console.log(event) }); const imgerror = document.queryselector('#img-error'); imgerror.addeventlistener('click', () => { badimg.setattribute('src', 'i-dont-exist'); }); result specifications specification status ui events working draft ...
Element: keydown event - Web APIs
cial value set for a keycode relating to an event that has been processed by an ime): eventtarget.addeventlistener("keydown", event => { if (event.iscomposing || event.keycode === 229) { return; } // do something }); examples addeventlistener keydown example this example logs the keyboardevent.code value whenever you press down a key inside the <input> element.
Element: keyup event - Web APIs
s a special value set for a keycode relating to an event that has been processed by an ime): eventtarget.addeventlistener("keyup", event => { if (event.iscomposing || event.keycode === 229) { return; } // do something }); examples addeventlistener keyup example this example logs the keyboardevent.code value whenever you release a key inside the <input> element.
Element.onfullscreenerror - Web APIs
andler for the fullscreenerror event which is sent to the element when an error occurs while attempting to transition into or out of full-screen mode.
Element.prefix - Web APIs
Web › API › Element › prefix
the element.prefix read-only property returns the namespace prefix of the specified element, or null if no prefix is specified.
Element.scrollWidth - Web APIs
//check to determine if an overflow is happening function isoverflowing(element) { return (element.scrollwidth > element.offsetwidth); } function alertoverflow(element) { if (isoverflowing(element)) { alert('contents are overflowing the container.'); } else { alert('no overflows!'); } } buttonone.addeventlistener('click', function() { alertoverflow(divone); }); buttontwo.addeventlistener('click', function() { alertoverflow(divtwo); }); </script> </html> result specification specification status comment css object model (cssom) view modulethe definition of 'element.scrollwidth' in that specification.
Element.setCapture() - Web APIs
-browser support and you probably looking for element.setpointercapture instead, from the pointer events api.
Element.toggleAttribute() - Web APIs
ttribute name contains one or more characters which are not valid in attribute names.
Element: webkitmouseforcedown event - Web APIs
after a mousedown event has been fired at the element, if and when sufficient pressure has been applied to the mouse or trackpad button to qualify as a "force click," safari begins sending webkitmouseforcedown events to the element.
Element: webkitmouseforceup event - Web APIs
the non-standard webkitmouseforceup event is fired by safari at an element some time after the webkitmouseforcedown event, when pressure on the button has been reduced sufficiently to end the "force click".
Element: webkitmouseforcewillbegin event - Web APIs
safari for macos fires the non-standard webkitmouseforcewillbegin event at an element before firing the initial mousedown event.
Event.cancelBubble - Web APIs
cancelbubble property of the event interface is a historical alias to event.stoppropagation().
Event.stopPropagation() - Web APIs
the stoppropagation() method of the event interface prevents further propagation of the current event in the capturing and bubbling phases.
EventSource.close() - Web APIs
Web › API › EventSource › close
he close() method of the eventsource interface closes the connection, if one is made, and sets the eventsource.readystate attribute to 2 (closed).
FetchEvent() - Web APIs
entinit dictionary, containing options to apply to the event object.
FetchEvent.isReload - Web APIs
the isreload read-only property of the fetchevent interface returns true if the event was dispatched by the user attempting to reload the page, and false otherwise.
Using the Geolocation API - Web APIs
longitude: ${longitude} °`; } function error() { status.textcontent = 'unable to retrieve your location'; } if(!navigator.geolocation) { status.textcontent = 'geolocation is not supported by your browser'; } else { status.textcontent = 'locating…'; navigator.geolocation.getcurrentposition(success, error); } } document.queryselector('#find-me').addeventlistener('click', geofindme); result ...
Geolocation API - Web APIs
longitude: ${longitude} °`; } function error() { status.textcontent = 'unable to retrieve your location'; } if(!navigator.geolocation) { status.textcontent = 'geolocation is not supported by your browser'; } else { status.textcontent = 'locating…'; navigator.geolocation.getcurrentposition(success, error); } } document.queryselector('#find-me').addeventlistener('click', geofindme); result specifications specification status comment geolocation api recommendation ...
GlobalEventHandlers.onanimationend - Web APIs
psedtime.tofixed(2) + " seconds."; } logbox.innerhtml += "\n"; }; then we set up the event handlers for the animationstart and animationend events: let box = document.getelementbyid("box"); box.onanimationstart = function(event) { log("animation started", event); } box.onanimationend = function(event) { log("animation stopped", event); }; finally, we set up a handler for a click on the button that runs the animation: document.getelementbyid("play").addeventlistener("click", function(event) { document.getelementbyid("box").classname = "slideanimation"; event.target.style.display = "none"; }, false); this sets the class of the box we want to animate to the class that contains the animation description, then hides the play button because this example will only run the...
GlobalEventHandlers.onanimationstart - Web APIs
psedtime.tofixed(2) + " seconds."; } logbox.innerhtml += "\n"; }; then we set up the event handlers for the animationstart and animationend events: let box = document.getelementbyid("box"); box.onanimationstart = function(event) { log("animation started", event); } box.onanimationend = function(event) { log("animation stopped", event); }; finally, we set up a handler for a click on the button that runs the animation: document.getelementbyid("play").addeventlistener("click", function(event) { document.getelementbyid("box").classname = "slideanimation"; event.target.style.display = "none"; }, false); this sets the class of the box we want to animate to the class that contains the animation description, then hides the play button because this example will only run the...
GlobalEventHandlers.onmouseup - Web APIs
n is an eventhandler that processes mouseup events.
GlobalEventHandlers.onreset - Web APIs
the onreset property of the globaleventhandlers mixin is an eventhandler that processes reset events.
HTMLAnchorElement.referrerPolicy - Web APIs
.
HTMLAreaElement.referrerPolicy - Web APIs
been concealed to third-party by using tls.
disabled - Web APIs
is a boolean indicating whether or not the control is disabled, meaning that it does not accept any clicks.
HTMLDialogElement: close event - Web APIs
dialog">open dialog</button> <div class="result"></div> css button, div { margin: .5rem; } js const result = document.queryselector('.result'); const dialog = document.queryselector('.example-dialog'); dialog.addeventlistener('close', (event) => { result.textcontent = 'dialog was closed'; }); const opendialog = document.queryselector('.open-dialog'); opendialog.addeventlistener('click', () => { if (typeof dialog.showmodal === 'function') { dialog.showmodal(); result.textcontent = ''; } else { result.textcontent = 'the dialog api is not supported by this browser'; } }); const closebutton = document.queryselector('.close'); closebutton.addeventlistener('click', () => { dialog.close(); }); result specifications specification status ...
HTMLDialogElement.returnValue - Web APIs
} function handleuserinput(returnvalue) { if (returnvalue === 'cancel' || returnvalue == null) { // user canceled the dialog, do nothing } else if (returnvalue === 'confirm') { // user chose a favorite animal, do something with it } } // “update details” button opens the <dialog> modally updatebutton.addeventlistener('click', function() { dialog.showmodal(); opencheck(dialog); handleuserinput(dialog.returnvalue); }); })(); </script> note: you can find this example on github as htmldialogelement-basic (see it live also).
HTMLElement: animationcancel event - Web APIs
listener('animationend', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation ended'`; animation.classlist.remove('active'); applyanimation.textcontent = "activate animation"; }); animation.addeventlistener('animationcancel', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation canceled'`; }); applyanimation.addeventlistener('click', () => { animation.classlist.toggle('active'); animationeventlog.textcontent = ''; iterationcount = 0; let active = animation.classlist.contains('active'); if (active) { applyanimation.textcontent = "cancel animation"; } else { applyanimation.textcontent = "activate animation"; } }); result specifications specification status comment css an...
HTMLElement: animationend event - Web APIs
listener('animationend', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation ended'`; animation.classlist.remove('active'); applyanimation.textcontent = "activate animation"; }); animation.addeventlistener('animationcancel', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation canceled'`; }); applyanimation.addeventlistener('click', () => { animation.classlist.toggle('active'); animationeventlog.textcontent = ''; iterationcount = 0; let active = animation.classlist.contains('active'); if (active) { applyanimation.textcontent = "cancel animation"; } else { applyanimation.textcontent = "activate animation"; } }); result specifications specification status comment css an...
HTMLElement: animationiteration event - Web APIs
listener('animationend', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation ended'`; animation.classlist.remove('active'); applyanimation.textcontent = "activate animation"; }); animation.addeventlistener('animationcancel', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation canceled'`; }); applyanimation.addeventlistener('click', () => { animation.classlist.toggle('active'); animationeventlog.textcontent = ''; iterationcount = 0; let active = animation.classlist.contains('active'); if (active) { applyanimation.textcontent = "cancel animation"; } else { applyanimation.textcontent = "activate animation"; } }); result specifications specification status comment css an...
HTMLElement: animationstart event - Web APIs
listener('animationend', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation ended'`; animation.classlist.remove('active'); applyanimation.textcontent = "activate animation"; }); animation.addeventlistener('animationcancel', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation canceled'`; }); applyanimation.addeventlistener('click', () => { animation.classlist.toggle('active'); animationeventlog.textcontent = ''; iterationcount = 0; let active = animation.classlist.contains('active'); if (active) { applyanimation.textcontent = "cancel animation"; } else { applyanimation.textcontent = "activate animation"; } }); result specifications specification status comment css an...
HTMLFormElement.requestSubmit() - Web APIs
() was called.
HTMLFormElement.reset() - Web APIs
the htmlformelement.reset() method restores a form element's default values.
HTMLFormElement: submit event - Web APIs
perty globaleventhandlers.onsubmit note that the submit event fires on the <form> element itself, and not on any <button> or <input type="submit"> inside it.
HTMLFormElement - Web APIs
/cgi-bin/some.cgi"; // add action and method attributes f.method = "post"; f.submit(); // call the form's submit() method extract information from a <form> element and set some of its attributes: <form name="forma" action="/cgi-bin/test" method="post"> <p>press "info" for form details, or "set" to change those details.</p> <p> <button type="button" onclick="getforminfo();">info</button> <button type="button" onclick="setforminfo(this.form);">set</button> <button type="reset">reset</button> </p> <textarea id="form-info" rows="15" cols="20"></textarea> </form> <script> function getforminfo(){ // get a reference to the form via its name var f = document.forms["forma"]; // the form properties we're interested in var properties...
HTMLImageElement.loading - Web APIs
made to the element to fit the image.
HTMLMediaElement: loadstart event - Web APIs
document.queryselector('.event-log-contents'); let source = null; function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}\n`; } video.addeventlistener('loadstart', handleevent); video.addeventlistener('progress', handleevent); video.addeventlistener('canplay', handleevent); video.addeventlistener('canplaythrough', handleevent); loadvideo.addeventlistener('click', () => { if (source) { document.location.reload(); } else { loadvideo.textcontent = "reset example"; source = document.createelement('source'); source.setattribute('src', 'https://interactive-examples.mdn.mozilla.net/media/examples/flower.webm'); source.setattribute('type', 'video/webm'); video.appendchild(source); } }); result sp...
HTMLMediaElement: progress event - Web APIs
document.queryselector('.event-log-contents'); let source = null; function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}\n`; } video.addeventlistener('loadstart', handleevent); video.addeventlistener('progress', handleevent); video.addeventlistener('canplay', handleevent); video.addeventlistener('canplaythrough', handleevent); loadvideo.addeventlistener('click', () => { if (source) { document.location.reload(); } else { loadvideo.textcontent = "reset example"; source = document.createelement('source'); source.setattribute('src', 'https://interactive-examples.mdn.mozilla.net/media/examples/flower.webm'); source.setattribute('type', 'video/webm'); video.appendchild(source); } }); result sp...
HTMLSelectElement - Web APIs
indicates whether the control should have input focus when the page loads, unless the user overrides it, for example by typing in a different control.
HTMLVideoElement.msHorizontalMirror - Web APIs
layback of a webcam video, providing the user with better mirroring of their real behaviors (ie.
History.back() - Web APIs
Web › API › History › back
d call does nothing.
History.forward() - Web APIs
Web › API › History › forward
s calling history.go(1).
ImageCapture.grabFrame() - Web APIs
itmap object.
ImageCapture.takePhoto() - Web APIs
ves with a blob.
KeyboardEvent.key - Web APIs
Web › API › KeyboardEvent › key
g [event: keydown]`); }); textarea.addeventlistener('beforeinput', (e) => { logmessage(`key "${e.data}" about to be input [event: beforeinput]`); }); textarea.addeventlistener('input', (e) => { logmessage(`key "${e.data}" input [event: input]`); }); textarea.addeventlistener('keyup', (e) => { logmessage(`key "${e.key}" released [event: keyup]`); }); btnclearconsole.addeventlistener('click', (e) => { let child = consolelog.firstchild; while (child) { consolelog.removechild(child); child = consolelog.firstchild; } }); result note: on browsers that don't fully implement the inputevent interface which is used for the beforeinput and input events, you may get incorrect output on those lines of the log output.
KeyframeEffect.target - Web APIs
doelement, or null.
Location - Web APIs
Web › API › Location
:1.5; background:black;} [title]:hover:before, :target:before {background:black; color:yellow;} [title] [title]:before {margin-top:1.5em;} [title] [title] [title]:before {margin-top:3em;} [title]:hover, :target {position:relative; z-index:1; outline:50em solid rgba(255,255,255,.8);} javascript [].foreach.call(document.queryselectorall('[title][id]'), function (node) { node.addeventlistener("click", function(e) { e.preventdefault(); e.stoppropagation(); window.location.hash = '#' + $(this).attr('id'); }); }); [].foreach.call(document.queryselectorall('[title]'), function (node) { node.addeventlistener("click", function(e) { e.preventdefault(); e.stoppropagation(); window.location.hash = ''; }); }); result properties location.ancestororigins is a static...
MSSiteModeEvent - Web APIs
ent beyond the current target.
MediaDevices.getUserMedia() - Web APIs
ion(e) { video.play(); }; }) .catch(function(err) { console.log(err.name + ": " + err.message); }); frame rate lower frame-rates may be desirable in some cases, like webrtc transmissions with bandwidth restrictions.
MediaError.message - Web APIs
ation of what went wrong and possibly how it might be fixed.
MediaPositionState.playbackRate - Web APIs
e that the media is being played faster than normal.
MediaRecorder.onpause - Web APIs
recorder.onpause event handler (part of the mediarecorder api) handles the pause event, allowing you to run code in response to the media recording being paused.
MediaRecorder.onresume - Web APIs
nt handler (part of the mediarecorder api) handles the resume event, allowing you to run code in response to the media recording being resumed after pausing.
MediaRecorder.onstart - Web APIs
start event, allowing you to run code in response to media recording being started by a mediarecorder.
MediaRecorder.pause() - Web APIs
gathering data into the current blob, but keep it available so that recording can be resumed later on.
MediaRecorder.requestData() - Web APIs
is available under the event's data attribute.) create a new blob and place subsequently captured data into it.
MediaRecorder.resume() - Web APIs
e gathering data into the current blob.
MediaRecorder.start() - Web APIs
ission to use an input device.
MediaRecorder.state - Web APIs
ne of the following values: enumeration description inactive recording is not occuring — it has either not been started yet, or it has been started and then stopped.
MediaRecorder.stop() - Web APIs
ive" and stop capturing media.
MediaStream Recording API - Web APIs
> 0) { recordedchunks.push(event.data); console.log(recordedchunks); download(); } else { // ...
Using the Media Capabilities API - Web APIs
entbyid("results") li.innerhtml = content; ul.appendchild(li); }).catch((error) => { var li = document.createelement('li'), ul = document.getelementbyid("results"); li.innertext = 'codec ' + mc.videoconfiguration.video.contenttype + ' threw an error: ' + error; ul.appendchild(li); }); } } document.getelementbyid('tryit').addeventlistener('click', mc.tryit); live result ...
MessagePort: message event - Web APIs
erent browsing context, such as another <iframe>, using code like this: const channel = new messagechannel(); const myport = channel.port1; const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const messagecontrol = document.queryselector('#message'); const channelmessagebutton = document.queryselector('#channel-message'); channelmessagebutton.addeventlistener('click', () => { myport.postmessage(messagecontrol.value); }) targetframe.postmessage('init', targetorigin, [channel.port2]); the target can receive the port and start listening for messages on it using code like this: window.addeventlistener('message', (event) => { const myport = event.ports[0]; myport.addeventlistener('message', (event) => { received.textcontent = event.data; ...
MessagePort: messageerror event - Web APIs
erent browsing context, such as another <iframe>, using code like this: const channel = new messagechannel(); const myport = channel.port1; const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const messagecontrol = document.queryselector('#message'); const channelmessagebutton = document.queryselector('#channel-message'); channelmessagebutton.addeventlistener('click', () => { myport.postmessage(messagecontrol.value); }) targetframe.postmessage('init', targetorigin, [channel.port2]); the target can receive the port and start listening for messages and message errors on it using code like this: window.addeventlistener('message', (event) => { const myport = event.ports[0]; myport.addeventlistener('message', (event) => { received.textcont...
Microsoft API extensions - Web APIs
sgraphicstruststatus msisboxed msplaytodisabled msplaytopreferredsourceuri msplaytoprimary msplaytosource msrealtime mssetmediaprotectionmanager mssetvideorectangle msstereo3dpackingmode msstereo3drendermode onmsvideoformatchanged onmsvideoframestepcompleted onmsvideooptimallayoutchanged msfirstpaint pinned sites apis mssitemodeevent mssitemodejumplistitemremoved msthumbnailclick other apis x-ms-aria-flowfrom x-ms-acceleratorkey x-ms-format-detection mscaching mscachingenabled mscapslockwarningoff event.msconverturl() mselementresize document.mselementsfromrect() msisstatichtml navigator.mslaunchuri() mslaunchuricallback element.msmatchesselector() msprotocols msputpropertyenabled mswriteprofilermark ...
MouseEvent.WEBKIT_FORCE_AT_FORCE_MOUSE_DOWN - Web APIs
standard and is not on a standards track.
MouseEvent.WEBKIT_FORCE_AT_MOUSE_DOWN - Web APIs
non-standard and is not on a standards track.
MouseEvent.buttons - Web APIs
on or un-initialized 1 : primary button (usually the left button) 2 : secondary button (usually the right button) 4 : auxiliary button (usually the mouse wheel button or middle button) 8 : 4th button (typically the "browser back" button) 16 : 5th button (typically the "browser forward" button) example this example logs the buttons property when you trigger a mousedown event.
MouseEvent.clientX - Web APIs
the clientx read-only property of the mouseevent interface provides the horizontal coordinate within the application's client area at which the event occurred (as opposed to the coordinate within the page).
MouseEvent.clientY - Web APIs
the clienty read-only property of the mouseevent interface provides the vertical coordinate within the application's client area at which the event occurred (as opposed to the coordinate within the page).
MouseEvent.screenX - Web APIs
script let screenlog = document.queryselector('#screen-log'); document.addeventlistener('mousemove', logkey); function logkey(e) { screenlog.innertext = ` screen x/y: ${e.screenx}, ${e.screeny} client x/y: ${e.clientx}, ${e.clienty}`; } result routing an event when you trap events on the window, document, or other roomy elements, you can get the coordinates of that event (e.g., a click) and route it properly, as the following example demonstrates: function checkclickmap(e) { if (e.screenx < 50) doredbutton(); if (50 <= e.screenx && e.screenx < 100) doyellowbutton(); if (e.screenx >= 100) doredbutton(); } specifications specification status comment css object model (cssom) view modulethe definition of 'screenx' in that specification.
Navigator.productSub - Web APIs
the navigator.productsub read-only property returns the build number of the current browser.
Navigator.sendBeacon() - Web APIs
containing the data to send.
Navigator.onLine - Web APIs
returns the online status of the browser.
Node.cloneNode() - Web APIs
Web › API › Node › cloneNode
ird 29 / seamonkey 2.26)), a shallow clone is defaulted instead of a deep clone.
Node.prefix - Web APIs
Web › API › Node › prefix
the node.prefix read-only property returns the namespace prefix of the specified node, or null if no prefix is specified.
Notification.Notification() - Web APIs
ification.
Notification.requireInteraction - Web APIs
note: this feature is available in web workers.
OfflineAudioContext.startRendering() - Web APIs
source.start(); //source.loop = true; offlinectx.startrendering().then(function(renderedbuffer) { console.log('rendering completed successfully'); var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); var song = audioctx.createbuffersource(); song.buffer = renderedbuffer; song.connect(audioctx.destination); play.onclick = function() { song.start(); } }).catch(function(err) { console.log('rendering failed: ' + err); // note: the promise should reject when startrendering is called a second time on an offlineaudiocontext }); }); } request.send(); } // run getdata to start the process off getdata(); specifications specification status comm...
OfflineAudioContext - Web APIs
source.buffer = mybuffer; source.connect(offlinectx.destination); source.start(); //source.loop = true; offlinectx.startrendering().then(function(renderedbuffer) { console.log('rendering completed successfully'); var song = audioctx.createbuffersource(); song.buffer = renderedbuffer; song.connect(audioctx.destination); play.onclick = function() { song.start(); } }).catch(function(err) { console.log('rendering failed: ' + err); // note: the promise should reject when startrendering is called a second time on an offlineaudiocontext }); }); } request.send(); } // run getdata to start the process off getdata(); specifications specification status comm...
Payment Request API - Web APIs
a card has expired (or is about to expire).
PerformanceNavigation.type - Web APIs
ype read-only property returns an unsigned short containing a constant describing how the navigation to this page was done.
PerformanceNavigation - Web APIs
rformancenavigation interface doesn't inherit any properties.
PerformanceNavigationTiming.type - Web APIs
the type read-only property returns a string representing the type of navigation.
Using Pointer Events - Web APIs
could, of course, also be a stylus, mouse, or other method of pointing at a location.
PopStateEvent - Web APIs
nt.
PushEvent.data - Web APIs
Web › API › PushEvent › data
}; if (event.data) { data = event.data.json(); } var title = data.title || "something has happened"; var message = data.message || "here's something you might want to check out."; var icon = "images/new-notification.png"; var notification = new notification(title, { body: message, tag: 'simple-push-demo-notification', icon: icon }); notification.addeventlistener('click', function() { if (clients.openwindow) { clients.openwindow('https://example.blog.com/2015/03/04/something-new.html'); } }); }); specifications specification status comment push apithe definition of 'data' in that specification.
PushEvent - Web APIs
Web › API › PushEvent
if (event.data) { data = event.data.json(); } var title = data.title || "something has happened"; var message = data.message || "here's something you might want to check out."; var icon = "images/new-notification.png"; var notification = new self.notification(title, { body: message, tag: 'simple-push-demo-notification', icon: icon }); notification.addeventlistener('click', function() { if (clients.openwindow) { clients.openwindow('https://example.blog.com/2015/03/04/something-new.html'); } }); }); specifications specification status comment push apithe definition of 'pushevent' in that specification.
RTCPeerConnection.removeStream() - Web APIs
tax rtcpeerconnection.removestream(mediastream); parameters mediastream a mediastream specifying the stream to remove from the connection.
Range.selectNodeContents() - Web APIs
ttons below</b> to select or deselect the contents of this paragraph.</p> <button id="select-button">select paragraph</button> <button id="deselect-button">deselect paragraph</button> javascript const p = document.getelementbyid('p'); const selectbutton = document.getelementbyid('select-button'); const deselectbutton = document.getelementbyid('deselect-button'); selectbutton.addeventlistener('click', e => { // clear any current selection const selection = window.getselection(); selection.removeallranges(); // select paragraph const range = document.createrange(); range.selectnodecontents(p); selection.addrange(range); }); deselectbutton.addeventlistener('click', e => { const selection = window.getselection(); selection.removeallranges(); }); result specifications ...
ReadableStream.ReadableStream() - Web APIs
const stream = new readablestream({ start(controller) { interval = setinterval(() => { let string = randomchars(); // add the string to the stream controller.enqueue(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); controller.close(); }) }, pull(controller) { // we don't really need a pull in this example }, cancel() { // this is called if the reader cancels, // so we should stop generating strings clearinterval(interval); } }); specifications specification status comment streamst...
ReadableStreamDefaultController.close() - Web APIs
const stream = new readablestream({ start(controller) { interval = setinterval(() => { let string = randomchars(); // add the string to the stream controller.enqueue(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); controller.close(); }) }, pull(controller) { // we don't really need a pull in this example }, cancel() { // this is called if the reader cancels, // so we should stop generating strings clearinterval(interval); } }); specifications specification status comment streamst...
ReadableStreamDefaultController.enqueue() - Web APIs
const stream = new readablestream({ start(controller) { interval = setinterval(() => { let string = randomchars(); // add the string to the stream controller.enqueue(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); controller.close(); }) }, pull(controller) { // we don't really need a pull in this example }, cancel() { // this is called if the reader cancels, // so we should stop generating strings clearinterval(interval); } }); specifications specification status comment streamst...
ReadableStreamDefaultController - Web APIs
const stream = new readablestream({ start(controller) { interval = setinterval(() => { let string = randomchars(); // add the string to the stream controller.enqueue(string); // show it on the screen let listitem = document.createelement('li'); listitem.textcontent = string; list1.appendchild(listitem); }, 1000); button.addeventlistener('click', function() { clearinterval(interval); fetchstream(); controller.close(); }) }, pull(controller) { // we don't really need a pull in this example }, cancel() { // this is called if the reader cancels, // so we should stop generating strings clearinterval(interval); } }); specifications specification status comment streamst...
ReportingObserver() - Web APIs
h (although this last type usually isn't retrievable via a reportingobserver).
ReportingObserver.disconnect() - Web APIs
lling disconnect(), neither reportingobserver.takerecords() nor the records parameter of the reportingobserver() callback will return any reports.
ReportingObserver.observe() - Web APIs
the observe() method of the reportingobserver interface instructs a reporting observer to start collecting reports in its report queue.
ReportingObserver.takeRecords() - Web APIs
records() method of the reportingobserver interface returns the current list of reports contained in the observer's report queue, and empties the queue.
ReportingObserverOptions - Web APIs
ted by this observer.
ResizeObserver.disconnect() - Web APIs
the disconnect() method of the resizeobserver interface unobserves all observed element or svgelement targets.
SVGAnimationElement: endEvent event - Web APIs
istitem = document.createelement('li'); listitem.textcontent = 'endevent fired'; list.appendchild(listitem); }) animateelem.addeventlistener('repeatevent', (e) => { let listitem = document.createelement('li'); let msg = 'repeatevent fired'; if(e.detail) { msg += '; repeat number: ' + e.detail; } listitem.textcontent = msg; list.appendchild(listitem); }) btn.addeventlistener('click', () => { btn.disabled = true; animateelem.setattribute('repeatcount', '1'); }) event handler property equivalent note that you can also create an event listener for the end event using the onend event handler property: animateelem.onend = () => { console.log('endevent fired'); } specifications specification status comment scalable vector graphics (svg) 2the d...
SVGEllipseElement - Web APIs
only this property returns a svganimatedlength reflecting the ry attribute of the given <ellipse> element.
ScriptProcessorNode.bufferSize - Web APIs
utbuffer.getchanneldata(channel); // loop through the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make output equal to the same as the input outputdata[sample] = inputdata[sample]; // add noise to each output sample outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } } getdata(); // wire up play button playbutton.onclick = function() { source.connect(scriptnode); scriptnode.connect(audioctx.destination); source.start(); } // when the buffer source stops playing, disconnect everything source.onended = function() { source.disconnect(scriptnode); scriptnode.disconnect(audioctx.destination); } specifications specification status comment web audio apithe definition of 'buffersize'...
ScriptProcessorNode.onaudioprocess - Web APIs
getchanneldata(channel); // loop through the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make output equal to the same as the input outputdata[sample] = inputdata[sample]; // add noise to each output sample outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } } getdata(); // wire up play button playbutton.onclick = function() { source.connect(scriptnode); scriptnode.connect(audioctx.destination); source.start(); } // when the buffer source stops playing, disconnect everything source.onended = function() { source.disconnect(scriptnode); scriptnode.disconnect(audioctx.destination); } specifications specification status comment web audio apithe definition of 'onaud...
ScriptProcessorNode - Web APIs
utbuffer.getchanneldata(channel); // loop through the 4096 samples for (var sample = 0; sample < inputbuffer.length; sample++) { // make output equal to the same as the input outputdata[sample] = inputdata[sample]; // add noise to each output sample outputdata[sample] += ((math.random() * 2) - 1) * 0.2; } } } getdata(); // wire up play button playbutton.onclick = function() { source.connect(scriptnode); scriptnode.connect(audioctx.destination); source.start(); } // when the buffer source stops playing, disconnect everything source.onended = function() { source.disconnect(scriptnode); scriptnode.disconnect(audioctx.destination); } specifications specification status comment web audio apithe definition of 'scriptproce...
Selection.addRange() - Web APIs
tion.
Selection.selectAllChildren() - Web APIs
parentnode itself is not part of the selection.
Selection.setBaseAndExtent() - Web APIs
p><strong>output</strong>: <span class="output"></span></p> the javascript looks like so: var one = document.queryselector('.one'); var two = document.queryselector('.two'); var aoffset = document.getelementbyid('aoffset'); var foffset = document.getelementbyid('foffset'); var button = document.queryselector('button'); var output = document.queryselector('.output'); var selection; button.onclick = function() { try { selection = document.getselection(); selection.setbaseandextent(one, aoffset.value, two, foffset.value); var text = selection.tostring(); output.textcontent = text; } catch(e) { output.textcontent = e.message; } } play with the live example below, setting different offset values to see how this affects the selection.
onnotificationclose - Web APIs
otificationevent) { ...
ServiceWorkerGlobalScope.onpush - Web APIs
}; if (event.data) { data = event.data.json(); } var title = data.title || "something has happened"; var message = data.message || "here's something you might want to check out."; var icon = "images/new-notification.png"; var notification = new notification(title, { body: message, tag: 'simple-push-demo-notification', icon: icon }); notification.addeventlistener('click', function() { if (clients.openwindow) { clients.openwindow('https://example.blog.com/2015/03/04/something-new.html'); } }); }); specifications specification status comment push apithe definition of 'onpush' in that specification.
ServiceWorkerRegistration.update() - Web APIs
ample the following simple example registers a service worker example then adds an event handler to a button so you can explicitly update the service worker whenever desired: if ('serviceworker' in navigator) { navigator.serviceworker.register('/sw-test/sw.js', {scope: 'sw-test'}).then(function(registration) { // registration worked console.log('registration succeeded.'); button.onclick = function() { registration.update(); } }).catch(function(error) { // registration failed console.log('registration failed with ' + error); }); }; specifications specification status comment service workersthe definition of 'serviceworkerregistration.update()' in that specification.
SpeechRecognition.abort() - Web APIs
| sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.'); } abortbtn.onclick = function() { recognition.abort(); console.log('speech recognition aborted.'); } recognition.onspeechend = function() { recognition.stop(); console.log('speech recognition has stopped.'); } specifications specification status comment web speech apithe ...
SpeechRecognition.start() - Web APIs
| sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.'); } abortbtn.onclick = function() { recognition.abort(); console.log('speech recognition aborted.'); } recognition.onspeechend = function() { recognition.stop(); console.log('speech recognition has stopped.'); } specifications specification status comment web speech apithe ...
SpeechRecognition.stop() - Web APIs
| sienna | silver | snow | tan | teal | thistle | tomato | turquoise | violet | white | yellow ;' var recognition = new speechrecognition(); var speechrecognitionlist = new speechgrammarlist(); speechrecognitionlist.addfromstring(grammar, 1); recognition.grammars = speechrecognitionlist; var diagnostic = document.queryselector('.output'); var bg = document.queryselector('html'); document.body.onclick = function() { recognition.start(); console.log('ready to receive a color command.'); } abortbtn.onclick = function() { recognition.abort(); console.log('speech recognition aborted.'); } recognition.onspeechend = function() { recognition.stop(); console.log('speech recognition has stopped.'); } specifications specification status comment web speech apithe ...
Using readable streams - Web APIs
t.
Stylesheet.href - Web APIs
Web › API › StyleSheet › href
on of the style sheet.
StyleSheet.ownerNode - Web APIs
node property of the stylesheet interface returns the node that associates this style sheet with the document.
Using Touch Events - Web APIs
touchstart event handler to process the touch point in an application-specific manner.
Touch events - Web APIs
(id == idtofind) { return i; } } return -1; // not found } showing what's going on function log(msg) { var p = document.getelementbyid('log'); p.innerhtml = msg + "\n" + p.innerhtml; } if your browser supports it, you can see it live.
sourceCapabilities - Web APIs
input device was responsible for the event, it returns null.
WakeLockSentinel - Web APIs
ock const requestwakelock = async () => { try { wakelock = await navigator.wakelock.request('screen'); // listen for our release event wakelock.addeventlistener('release', () => { // if wake lock is released alter the ui accordingly }); } catch (err) { // if wake lock request fails - usually system related, such as battery } } wakelockonbutton.addeventlistener('click', () => { requestwakelock(); }) wakelockoffbutton.addeventlistener('click', () => { if (wakelock !== null) { wakelock.release() .then(() => { wakelock = null; }) } }) specifications specification status comment screen wake lock apithe definition of 'wakelocksentinel' in that specification.
Using bounded reference spaces - Web APIs
reference space if available by using code such as the following: async function onactivatexrbutton(event) { if (!xrsession) { navgator.xr.requestsession("immersive-vr"), { requiredfeatures: ["local-floor"], optionalfeatures: ["bounded-floor"] }).then((session) => { xrsession = session; startsessionanimation(); }); } } this function, called when the user clicks on a button to start the xr experience, works as usual, exiting at once if a session is already in place, then requesting a new session using immersive-vr mode.
Example and tutorial: Simple synth keyboard - Web APIs
aster gain node, thereby changing the loudness of all playing notes.
Window.back() - Web APIs
Web › API › Window › back
the obsolete and non-standard method back() on the window interface returns the window to the previous item in the history.
Window.crypto - Web APIs
Web › API › Window › crypto
enrandomnumbers = function getrandomnumbers() { var array = new uint32array(10); window.crypto.getrandomvalues(array); var randtext = document.getelementbyid("myrandtext"); randtext.innerhtml = "the random numbers are: " for (var i = 0; i < array.length; i++) { randtext.innerhtml += array[i] + " "; } } html <p id="myrandtext">the random numbers are: </p> <button type="button" onclick='genrandomnumbers()'>generate 10 random numbers</button> result specifications specification status comment web cryptography apithe definition of 'window.crypto' in that specification.
Window.defaultStatus - Web APIs
s, its use is discouraged since it could be removed at any time.
window.dump() - Web APIs
Web › API › Window › dump
will output to stdout.
Window: error event - Web APIs
y: block; } button { height: 2rem; margin: .5rem; } img { width: 0; height: 0; } js const log = document.queryselector('.event-log-contents'); window.addeventlistener('error', (event) => { log.textcontent = log.textcontent + `${event.type}: ${event.message}\n`; console.log(event) }); const scripterror = document.queryselector('#script-error'); scripterror.addeventlistener('click', () => { const badcode = 'const s;'; eval(badcode); }); result specifications specification status ui events working draft ...
Window.focus() - Web APIs
Web › API › Window › focus
makes a request to bring the window to the front.
Window.history - Web APIs
Web › API › Window › history
h provides an interface for manipulating the browser session history (pages visited in the tab or frame that the current page is loaded in).
Window: load event - Web APIs
Web › API › Window › load event
rol log"; } .controls { grid-area: control; display: flex; align-items: center; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } #reload { height: 2rem; } js const log = document.queryselector('.event-log-contents'); const reload = document.queryselector('#reload'); reload.addeventlistener('click', () => { log.textcontent =''; window.settimeout(() => { window.location.reload(true); }, 200); }); window.addeventlistener('load', (event) => { log.textcontent = log.textcontent + 'load\n'; }); document.addeventlistener('readystatechange', (event) => { log.textcontent = log.textcontent + `readystate: ${document.readystate}\n`; }); document.addeventlistener('domcontentloade...
Window: message event - Web APIs
interface messageevent event handler property onmessage examples suppose a script sends a message to a different browsing context, such as another <iframe>, using code like this: const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const windowmessagebutton = document.queryselector('#window-message'); windowmessagebutton.addeventlistener('click', () => { targetframe.postmessage('hello there', targetorigin); }); the receiver can listen for the message using addeventlistener() with code like this: window.addeventlistener('message', (event) => { console.log(`received message: ${event.data}`); }); alternatively the listener could use the onmessage event handler property: window.onmessage = (event) => { console.log(`received ...
Privileged features - Web APIs
alog feature removes all icons (restore, minimize, maximize) from the window's titlebar, leaving only the close button.
Window: pagehide event - Web APIs
the pagehide event is sent to a window when the browser hides the current page in the process of presenting a different page from the session's history.
Window: popstate event - Web APIs
sponding events can be used to add data to the history stack which can be used to reconstruct a dynamically generated page, or to otherwise alter the state of the content being presented while remaining on the same document.
WindowEventHandlers.onpopstate - Web APIs
document.
XRInputSource.targetRayMode - Web APIs
very frame.
XRInputSource.targetRaySpace - Web APIs
very frame.
XRInputSource - Web APIs
sion.
XRInputSourceArray.length - Web APIs
[ { label: "shop now", url: "https://www.amazon.com/s?k=vr+controllers" }, { label: "quit" handler: quitgame } ]); } here, if length is 0, a hypothetical showalertdialog() function is called with a prompt string explaining the need for a controller, and an array of objects, each describing a button and what should happen when it's clicked.
XRInputSourceEvent() - Web APIs
when an ongoing primary squeeze action ends or when an input source with an ongoing primary squeeze action is disconnected.
XRInputSourceEvent - Web APIs
when an ongoing primary squeeze action ends or when an input source with an ongoing primary squeeze action is disconnected.
XRSession.cancelAnimationFrame() - Web APIs
ull; let xrsession = null; if (xr) { xr.issessionsupported('immersive-vr') .then((issupported) => { if (issupported) { startxr(); } }); } function framecallback(time, xrframe) { xrsession.requestanimationframe(framecallback); // update and render the frame } async function startxr() { xrsession = xr.requestsession("immersive-vr"); if (xrsession) { stopbutton.onclick = stopxr; requesthandle = xrsession.requestanimationframe(framecallback); } } function pausexr() { if (xrsession && requesthandle) { xrsession.cancelanimationframe(requesthandle); requesthandle = null; } } specifications specification status comment webxr device apithe definition of 'xrsession.cancelanimationframe' in that specification.
msCapsLockWarningOff - Web APIs
ocument.mscapslockwarningoff = true; document.getelementbyid("caps").innerhtml = "warning off"; } else { document.mscapslockwarningoff = false; document.getelementbyid("caps").innerhtml = "warning on"; } } </script> </head> <body> <label>type a password: <input type="password" /></label><br /> <button id="caps" onclick="capsoff();">warning off</button> </body> </html> ...
ARIA live regions - Accessibility
planettitle.textcontent = planets_info[planet].title; planetdescription.textcontent = planets_info[planet].description; } else { planettitle.textcontent = 'no planet selected'; planetdescription.textcontent = 'select a planet to view its description'; } } const renderplanetinfobutton = document.queryselector('#renderplanetinfobutton'); renderplanetinfobutton.addeventlistener('click', event => { const planetsselect = document.queryselector('#planetsselect'); const selectedplanet = planetsselect.options[planetsselect.selectedindex].value; renderplanetinfo(selectedplanet); }); as the user selects a new planet, the information in the live region will be announced.
Using the alertdialog role - Accessibility
ative.
Using the aria-describedby attribute - Accessibility
he game schedule for the boston red sox.
Using the aria-label attribute - Accessibility
ne of those opinions and therefore not normative.
ARIA: alert role - Accessibility
e element becomes visible.</p> while triggering an alert via css alone is possible, it is better to rely on javascript because it has more browser/screen reader support and is often more appropriate as part of a larger user interaction such as inside an event handler or form validation.
ARIA: application role - Accessibility
.
WAI-ARIA Roles - Accessibility
usually set on related content items such as comments, forum posts, newspaper articles or other items grouped together on one page.aria: banner rolea banner role represents general and informative content frequently placed at the beginning of the page.
Cognitive accessibility - Accessibility
rly phrased link text may confuse users as to its purpose or destination.
HTML To MSAA - Accessibility
column has n/a value then it means specific elements doesn't provide own rules to calculate name but name can be computed from aria markup or @title attribute.
Accessibility documentation index - Accessibility
anner role aria, accessibility, needscontent a banner role represents general and informative content frequently placed at the beginning of the page.
Perceivable - Accessibility
al layout styles, irrespective of the markup.
Text labels and names - Accessibility
hite close-up photo of milkweed flowers"> interactive elements must be labeled if an element is intended for users to interact with it, it should have a label.
Understanding the Web Content Accessibility Guidelines - Accessibility
at further expand on these areas, giving you practical advice on how to write your web content so it conforms to the success criteria outlined in each of the wcag 2.0 and 2.1 guidelines that further sub-divides each principle.
:-moz-focusring - CSS: Cascading Style Sheets
system settings and other factors, so the precise behavior of this pseudo-class will vary from platform to platform.
::-webkit-search-results-button - CSS: Cascading Style Sheets
the ::-webkit-search-results-button css pseudo-element represents a button (the "search results button") at the left edge of an <input> of type="search" which when clicked displays a menu which allows the user to choose from previous recent search queries.
::before (:before) - CSS: Cascading Style Sheets
Web › CSS › ::before
ightgrey; font-family: sans-serif; } li.done { background: #ccff99; } li.done::before { content: ''; position: absolute; border-color: #009933; border-style: solid; border-width: 0 0.3em 0.25em 0; height: 1em; top: 1.3em; left: 0.6em; margin-top: -1em; transform: rotate(45deg); width: 0.5em; } javascript var list = document.queryselector('ul'); list.addeventlistener('click', function(ev) { if (ev.target.tagname === 'li') { ev.target.classlist.toggle('done'); } }, false); here is the above code example running live.
::selection - CSS: Cascading Style Sheets
the ::selection css pseudo-element applies styles to the part of a document that has been highlighted by the user (such as clicking and dragging the mouse across text).
:checked - CSS: Cascading Style Sheets
Web › CSS › :checked
r-radius: 3px; } /* show hidden content when the checkbox is checked */ #expand-toggle:checked ~ * .expandable { visibility: visible; } /* style the button when the checkbox is checked */ #expand-toggle:checked ~ #expand-btn { background-color: #ccc; } result image gallery you can use the :checked pseudo-class to build an image gallery with full-size images that show only when the user clicks on a thumbnail.
:disabled - CSS: Cascading Style Sheets
Web › CSS › :disabled
the :disabled css pseudo-class represents any disabled element.
:enabled - CSS: Cascading Style Sheets
Web › CSS › :enabled
the :enabled css pseudo-class represents any enabled element.
:first - CSS: Cascading Style Sheets
Web › CSS › :first
reaks of the document.
:focus - CSS: Cascading Style Sheets
Web › CSS › :focus
the :focus css pseudo-class represents an element (such as a form input) that has received focus.
:is() (:matches(), :any()) - CSS: Cascading Style Sheets
Web › CSS › :is
= document.queryselectorall(':-webkit-any(header, main, footer) p'); } catch(e) { try { matcheditems = document.queryselectorall(':-moz-any(header, main, footer) p'); } catch(e) { console.log('your browser doesn\'t support :is(), :matches(), or :any()'); } } } } matcheditems.foreach(applyhandler); function applyhandler(elem) { elem.addeventlistener('click', function(e) { alert('this paragraph is inside a ' + e.target.parentnode.nodename); }); } simplifying list selectors the :is() pseudo-class can greatly simplify your css selectors.
:read-only - CSS: Cascading Style Sheets
ad-write controls one use of readonly form controls is to allow the user to check and verify information that they may have entered in an earlier form (for example, shipping details), while still being able to submit the information along with the rest of the form.
:read-write - CSS: Cascading Style Sheets
ad-write controls one use of readonly form controls is to allow the user to check and verify information that they may have entered in an earlier form (for example, shipping details), while still being able to submit the information along with the rest of the form.
:target - CSS: Cascading Style Sheets
Web › CSS › :target
hat has been linked to from a table of contents.
Alternative style sheets - CSS: Cascading Style Sheets
heet" type="text/css" title="basic"> in this example, the styles "default style", "fancy", and "basic" will be listed in the page style submenu, with "default style" pre-selected.
Using multiple backgrounds - CSS: Cascading Style Sheets
background-image: url(https://mdn.mozillademos.org/files/11305/firefox.png), url(https://mdn.mozillademos.org/files/11307/bubbles.png), linear-gradient(to right, rgba(30, 75, 115, 1), rgba(255, 255, 255, 0)); background-repeat: no-repeat, no-repeat, no-repeat; background-position: bottom right, left, right; } result (if image does not appear in codepen, click the 'tidy' button in the css section) as you can see here, the firefox logo (listed first within background-image) is on top, directly above the bubbles graphic, followed by the gradient (listed last) sitting underneath all previous 'images'.
OpenType font features guide - CSS: Cascading Style Sheets
e designers and foundries will provide sample pages and css just for this very reason).
Basic Concepts of grid layout - CSS: Cascading Style Sheets
.
Stacking context example 3 - CSS: Cascading Style Sheets
« css « understanding css z-index stacking context example 3 this last example shows problems that arise when mixing several positioned elements in a multi-level html hierarchy and when z-indexes are assigned using class selectors.
Pagination - CSS: Cascading Style Sheets
ex items.
animation - CSS: Cascading Style Sheets
Web › CSS › animation
te = ''; anim.classlist.add('a' + (i + 1)); }, 100) } } animation.foreach(function (node, index) { node.addeventlistener('animationstart', function () { togglebutton(button[index], 'pause'); }); node.addeventlistener('animationend', function () { togglebutton(button[index], 'restart'); }); }); button.foreach(function (btn, index) { btn.addeventlistener('click', function () { playpause(index); }); }); }) a description of which properties are animatable is available; it's worth noting that this description is also valid for css transitions.
<easing-function> - CSS: Cascading Style Sheets
infinite alternate; } @keyframes move-right { from { left: 10%; } to { left: 90%; } } li { display: flex; align-items: center; justify-content: center; margin-bottom: 20px; } javascript const selectelem = document.queryselector('select'); const startbtn = document.queryselector('button'); const divelem = document.queryselector('div > div'); startbtn.addeventlistener('click', () => { if(startbtn.textcontent === 'start animation') { divelem.style.animationname = 'move-right'; startbtn.textcontent = 'stop animation'; divelem.style.animationtimingfunction = selectelem.value; } else { divelem.style.animationname = 'unset'; startbtn.textcontent = 'start animation'; } }); selectelem.addeventlistener('change', () => { divelem.style.animationtim...
pointer-events - CSS: Cascading Style Sheets
section of this wiki page (don't worry about keeping it tidy).
touch-action - CSS: Cascading Style Sheets
ay be combined with pan-y, pan-up, pan-down and/or pinch-zoom.
WAI ARIA Live Regions/API Support - Developer guides
rienting the user.
Media buffering, seeking, and time ranges - Developer guides
red.length; i++) { var startx = myaudio.buffered.start(i) * inc; var endx = myaudio.buffered.end(i) * inc; var width = endx - startx; context.fillrect(startx, 0, width, mycanvas.height); context.rect(startx, 0, width, mycanvas.height); context.stroke(); } }); } this works better with longer pieces of audio or video, but press play and click about the player progress bar and you should get something like this.
Challenge solutions - Developer guides
without looking up a reference, find five more color names that work in your stylesheet.
Event developer guide - Developer guides
Web › Guide › Events
play to the user.
Constraint validation - Developer guides
form is called interactively validating the constraints.
Mobile Web Development - Developer guides
Web › Guide › Mobile
the use of media queries to conditionally include css rules appropriate for the device screen width and height the viewport meta tag instructs the browser to display your site at the appropriate scale for the user's device.
HTML attribute: accept - HTML: Hypertext Markup Language
the user's device or operating system, the file input provides a button that opens up a file picker dialog that allows the user to choose a file.
HTML attribute: step - HTML: Hypertext Markup Language
Web › HTML › Attributes › step
valid for the numeric input types, including the date, month, week, time, datetime-local, number and range types, the step attribute is a number that specifies the granularity that the value must adhere to or the keyword any.
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
ocal local storage, just as if they were being served from the same domain the code is running on.
<command>: The HTML Command element - HTML: Hypertext Markup Language
Web › HTML › Element › command
dicates the kind of command.
<dfn>: The Definition element - HTML: Hypertext Markup Language
Web › HTML › Element › dfn
e below.
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
Web › HTML › Element › fieldset
de it, and disabled, which allows you to disable the <fieldset> and all its contents in one go.
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
Web › HTML › Element › iframe
g the frame's parent.
<img>: The Image Embed element - HTML: Hypertext Markup Language
Web › HTML › Element › img
to ignore the actual intrinsic size of the image and pretend it’s the size specified in the attribute.
<input type="color"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › color
ppearance variations as previously mentioned, when a browser doesn't support a color picker interface, its implementation of color inputs will be a text box that validates the contents automatically to ensure that the value is in the correct format.
<input type="date"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › date
its value to 2017-06-01 (june 1st, 2017).
<input type="month"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › month
mobile browser versions — having usable implementations.
<input type="password"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › password
inputmode="numeric" minlength="4" maxlength="8" size="8"> selecting text as with other textual entry controls, you can use the select() method to select all the text in the password field.
<input type="search"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › search
search inputs, although it's not mandatory.
<input type="tel"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › tel
-2222"> <option value="333-3333-3333"> <option value="344-4444-4444"> </datalist> with the <datalist> element and its <option>s in place, the browser will offer the specified values as potential values for the email address; this is typically presented as a popup or drop-down menu containing the suggestions.
<input type="url"> - HTML: Hypertext Markup Language
Web › HTML › Element › input › url
om/"> <option value="https://www.mozilla.org/"> <option value="http://w3.org/"> </datalist> with the <datalist> element and its <option>s in place, the browser will offer the specified values as potential values for the url; this is typically presented as a popup or drop-down menu containing the suggestions.
<isindex> - HTML: Hypertext Markup Language
Web › HTML › Element › isindex
nstead of isindex.
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
Web › HTML › Element › kbd
on text presented by the system, such as the names of menus and menu items, or the names of buttons displayed on the screen.
<map> - HTML: Hypertext Markup Language
Web › HTML › Element › map
the html <map> element is used with <area> elements to define an image map (a clickable link area).
<optgroup> - HTML: Hypertext Markup Language
Web › HTML › Element › optgroup
oup permitted aria roles no role permitted dom interface htmloptgroupelement note: optgroup elements may not be nested.
<option>: The HTML Option element - HTML: Hypertext Markup Language
Web › HTML › Element › option
<optgroup> or a <datalist> element.
<p>: The Paragraph element - HTML: Hypertext Markup Language
Web › HTML › Element › p
s is considered claustrophobic and hard to read.</p> <p>how hard to read?
<select>: The HTML Select element - HTML: Hypertext Markup Language
Web › HTML › Element › select
browser currently does that, so mozilla has opted to continue to return 0 for the time being with firefox.
<textarea> - HTML: Hypertext Markup Language
Web › HTML › Element › textarea
e of data that should be entered into a form; they are not a substitute for a proper <label> element tied to the input.
data-* - HTML: Hypertext Markup Language
attributes, even ordinary html elements can become rather complex and powerful program-objects.
tabindex - HTML: Hypertext Markup Language
o contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
Basics of HTTP - HTTP
this article explains how this is accomplished using the content-type header and the mime standard.
Browser detection using the user agent - HTTP
s device has a touchscreen.
CORS errors - HTTP
Web › HTTP › CORS › Errors
ipt code.
CSP: script-src-attr - HTTP
the http content-security-policy (csp) script-src-attr directive specifies valid sources for javascript inline event handlers.
CSP: script-src-elem - HTTP
the http content-security-policy (csp) script-src-elem directive specifies valid sources for javascript <script> elements, but not inline script event handlers like onclick.
X-Frame-Options - HTTP
the x-frame-options http response header can be used to indicate whether or not a browser should be allowed to render a page in a <frame>, <iframe>, <embed> or <object>.
An overview of HTTP - HTTP
Web › HTTP › Overview
tained within the page (usually images and videos).
Redirections in HTTP - HTTP
, but there are existing user agents that do change their method.
JavaScript modules - JavaScript
and main.js files — the module exports remain the same as before.
Memory Management - JavaScript
= 'azerty'; // allocates memory for a string var o = { a: 1, b: null }; // allocates memory for an object and contained values // (like object) allocates memory for the array and // contained values var a = [1, null, 'abra']; function f(a) { return a + 2; } // allocates a function (which is a callable object) // function expressions also allocate an object someelement.addeventlistener('click', function() { someelement.style.backgroundcolor = 'blue'; }, false); allocation via function calls some function calls result in object allocation.
Web app manifests
en of a device, providing users with quicker access and a richer experience).
Media container formats (file types) - Web media technologies
ique fashion.
Web Performance
web performance is the objective measurements and the perceived user experience of load time and runtime.
How to make PWAs installable - Progressive web apps (PWAs)
, it should display a notification (such as a banner or dialog box) indicating that it's possible to install the app as a pwa.
Progressive loading - Progressive web apps (PWAs)
arlier.
Graphic design for responsive sites - Progressive web apps (PWAs)
sing web fonts for icons.
Media - Progressive web apps (PWAs)
styles for a button that changes dynamically as the user interacts with it: .green-button { background-color:#cec; color:#black; border:2px outset #cec; padding: 5px 10px; } .green-button[disabled] { background-color:#cdc; color:#777; } .green-button:active, .green-button.active { border-style: inset; } <table> <tbody> <tr> <td><button class="green-button" disabled>click me</button></td> <td><button class="green-button">click me</button></td> <td><button class="green-button active">click me</button></td> </tr> <tr style="line-height:25%;"> <td>&nbsp;</td> </tr> <tr style="font-style:italic;"> <td>disabled</td> <td>normal</td> <td>active</td> </tr> </tbody> </table> live sample a fully functional button also has a dark outline aro...
The building blocks of responsive design - Progressive web apps (PWAs)
w is equivalent to 1% of the viewport width.
requiredFeatures - SVG: Scalable Vector Graphics
feimage>, <femerge>, <femergenode>, <feoffset>, <fetile>, <fefuncr>, <fefuncg>, <fefuncb> and <fefunca> elements http://www.w3.org/tr/svg11/feature#documenteventsattribute the browser supports the onunload, onabort, onerror, onresize, onscroll and onzoom attributes http://www.w3.org/tr/svg11/feature#graphicaleventsattribute the browser supports the onfocusin, onfocusout, onactivate, onclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout and onload attributes http://www.w3.org/tr/svg11/feature#animationeventsattribute the browser supports the onbegin, onend, onrepeat and onload attributes http://www.w3.org/tr/svg11/feature#cursor the browser supports the <cursor> element http://www.w3.org/tr/svg11/feature#hyperlinking the browser supports the <a> elem...
restart - SVG: Scalable Vector Graphics
Web › SVG › Attribute › restart
name="y" from="30" to="100" dur="5s" repeatcount="1" restart="always" /> </rect> <rect x="120" y="30" width="100" height="100"> <animate attributetype="xml" attributename="y" from="30" to="100" dur="5s" repeatcount="1" restart="whennotactive"/> </rect> <a id="restart"><text y="20">restart animation</text></a> </svg> document.getelementbyid("restart").addeventlistener("click", evt => { document.queryselectorall("animate").foreach(element => { element.beginelement(); }); }); usage notes value always | whennotactive | never default value always animatable no always this value indicates that the animation can be restarted at any time.
SVG Attribute reference - SVG: Scalable Vector Graphics
Web › SVG › Attribute
ill animation value attributes calcmode, values, keytimes, keysplines, from, to, by, autoreverse, accelerate, decelerate animation addition attributes additive, accumulate event attributes animation event attributes onbegin, onend, onrepeat document event attributes onabort, onerror, onresize, onscroll, onunload global event attributes oncancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncuechange, ondblclick, ondrag, ondragend, ondragenter, ondragexit, ondragleave, ondragover, ondragstart, ondrop, ondurationchange, onemptied, onended, onerror, onfocus, oninput, oninvalid, onkeydown, onkeypress, onkeyup, onload, onloadeddata, onloadedmetadata, onloadstart, onmousedown, onmouseenter, onmouseleave, onmousemove, onmouseout, onmouseover, onmouseup, onmousewheel, onpause, ...
<clipPath> - SVG: Scalable Vector Graphics
Web › SVG › Element › clipPath
rent geometry.
<script> - SVG: Scalable Vector Graphics
Web › SVG › Element › script
indow.addeventlistener('domcontentloaded', () => { function getcolor () { const r = math.round(math.random() * 255).tostring(16).padstart(2,'0') const g = math.round(math.random() * 255).tostring(16).padstart(2,'0') const b = math.round(math.random() * 255).tostring(16).padstart(2,'0') return `#${r}${g}${b}` } document.queryselector('circle').addeventlistener('click', (e) => { e.target.style.fill = getcolor() }) }) // ]]> </script> <circle cx="5" cy="5" r="4" /> </svg> attributes crossorigin this attribute defines cors settings as define for the html <script> element.
<set> - SVG: Scalable Vector Graphics
Web › SVG › Element › set
n-additive.
Getting started - SVG: Scalable Vector Graphics
height="200" xmlns="http://www.w3.org/2000/svg"> <rect width="100%" height="100%" fill="red" /> <circle cx="150" cy="100" r="80" fill="green" /> <text x="150" y="125" font-size="60" text-anchor="middle" fill="white">svg</text> </svg> copy the code and paste it in a file demo1.svg.
SVG In HTML Introduction - SVG: Scalable Vector Graphics
tbyid('body').setattribute("class", "invalid"); } </script> </head> <body id="body" style="position:absolute; z-index:0; border:1px solid black; left:5%; top:5%; width:90%; height:90%;"> <form> <fieldset> <legend>html form</legend> <p><label>enter something:</label> <input type="text"> <span id="err">incorrect value!</span></p> <p><input type="button" value="activate!" onclick="signalerror();"></p> </fieldset> </form> <svg viewbox="0 0 100 100" preserveaspectratio="xmidymid slice" style="width:100%; height:100%; position:absolute; top:0; left:0; z-index:-1;"> <lineargradient id="gradient"> <stop class="begin" offset="0%"/> <stop class="end" offset="100%"/> </lineargradient> <rect x="0" y="0" width="100" height="100" style="fill:url(#gradient)" /> ...
How to turn off form autocompletion - Web security
ff" on fields has two effects: it tells the browser not to save data inputted by the user for later autocompletion on similar forms, though heuristics for complying vary by browser.
Securing your site - Web security
ims and lets the attackers bypass access controls and impersonate users.
Compiling a New C/C++ Module to WebAssembly - WebAssembly
yfunction() function from javascript.
Using the WebAssembly JavaScript API - WebAssembly
.then(response => response.arraybuffer() ).then(bytes => webassembly.instantiate(bytes, importobject) ).then(results => { results.instance.exports.exported_func(); }); viewing wasm in developer tools in firefox 54+, the developer tool debugger panel has functionality to expose the text representation of any wasm code included in a web page.