Search completed in 1.17 seconds.
3455 results for "start":
Your results are loading. Please wait...
border-start-start-radius - CSS: Cascading Style Sheets
the border-start-start-radius css property defines a logical border radius on an element, which maps to a physical border radius that depends on the element's writing-mode, direction, and text-orientation.
... /* <length> values */ /* with one value the corner will be a circle */ border-start-start-radius: 10px; border-start-start-radius: 1em; /* with two values the corner will be an ellipse */ border-start-start-radius: 1em 2em; /* global values */ border-start-start-radius: inherit; border-start-start-radius: initial; border-start-start-radius: unset; for instance, in a horizontal-tb writing mode this property corresponds to the border-top-left-radius property.
... of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typea length, percentage or calc(); formal syntax <length-percentage>{1,2}where <length-percentage> = <length> | <percentage> examples border radius with vertical text html <div> <p class="exampletext">example</p> </div> css div { background-color: rebeccapurple; width: 120px; height: 120px; border-start-start-radius: 10px; } .exampletext { writing-mode: vertical-rl; padding: 10px; background-color: #fff; border-start-start-radius: 10px; } results specifications specification status comment css logical properties and values level 1the definition of 'border-start-start-radius' in that specification.
How to convert an overlay extension to restartless - Archive of obsolete content
this article is a step-by-step tutorial on how to convert an old overlay-based extension into a restartless (bootstrapped) extension that is also extractionless.
...mappings, so that you can access your files with custom paths such as: resource://myaddon/filename.ext chrome://myaddon/content/filename.ext step 2: no more resource:// uris for files internal to your bundle unfortunately, resource mappings in your chrome.manifest were not usable in restartless add-ons until mozilla finally fixed this bug in firefox 38, which looked bad, but only because mozilla is still using resource:// uris internally and in examples.
...it does still work if you don't have restartlessness to worry about, though the protocol (or scheme, or whatever term you prefer) really should be avoided at this point.
...And 28 more matches
Starting WebLock
getting called at startup no person is an island to himself, and neither are components.
... in order to be started up or notified when some event happens, the sample component has to hook into mozilla, which it can do either by overriding an existing component or by registering for some event that will cause it to start up.
... weblock does the latter and gets called when a gecko profile startup occurs.
...And 26 more matches
Getting started with Svelte - Learn web development
objective: to setup a local svelte development environment, create and build a starter app, and understand the basics of how it works.
...you can either start from scratch letting svelte drive your ui or you can incrementally integrate it into an existing application.
...web developers with basic html, css, and javascript knowledge can easily grasp svelte specifics in a short time and start building web applications.
...And 20 more matches
nsIAppStartup
toolkit/components/startup/public/nsiappstartup.idlscriptable this interface is intended to be used as application startup service.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) implemented by: @mozilla.org/toolkit/app-startup;1.
... to use the service: var appstartup = components.classes["@mozilla.org/toolkit/app-startup;1"] .getservice(components.interfaces.nsiappstartup); method overview void createhiddenwindow(); boolean createstartupstate(in long awindowwidth, in long awindowheight); obsolete since gecko 1.9.1 void destroyhiddenwindow(); void doprofilestartup(in nsicmdlineservice acmdlineservice, in boolean caninteract); obsolete since gecko 1.9.1 void ensure1window(in nsicmdlineservice acmdlineservice); obsolete since gecko 1.9.1 void enterlastwindowclosingsurvivalarea(); void exitlastwindowclosingsurvivalarea(); void getstartupinfo(); void hidesplashscreen(); obsolete since gecko 1.9.1 void initialize(in ...
...And 20 more matches
Optimizing startup performance - Web Performance
an often overlooked aspect of app software development—even among those focusing on performance optimization—is startup performance.
... how long does your app take to start up?
...it's always a good idea to take the time to ensure that your app starts up nicely.
...And 18 more matches
Receiving startup notifications
sometimes it's necessary for xpcom components to receive notifications as to the progress of the application's startup process, so they can start new services at appropriate times, for example.
... receiving startup notifications in gecko 2.0 (firefox 4) and later in order to improve startup times, changes were made to the xpcom startup process.
... see the startup process for details on how this now works, if you're interested in specifics.
...And 12 more matches
RTCPeerConnection.restartIce() - Web APIs
the webrtc api's rtcpeerconnection interface offers the restartice() method to allow a web application to easily request that ice candidate gathering be redone on both ends of the connection.
... this simplifies the process by allowing the same method to be used by either the caller or the receiver to trigger an ice restart.
... after restartice() returns, the offer returned by the next call to createoffer() is automatically configured to trigger ice restart on both the local peer (once the local peer has been set) and on the remote peer, once the offer is sent across your signaling mechanism and the remote peer has set its description as well.
...And 11 more matches
Getting started with React - Learn web development
we'll discover a little bit of detail about its background and use cases, set up a basic react toolchain on our local computer, and create and play with a simple starter app — learning a bit about how react works in the process.
... objective: to set up a local react development environment, create a start app, and understand the basics of how it works hello react as its official tagline states, react is a library for building user interfaces.
...you could just as well write the header expression like this: const header = <header> <h1>mozilla developer network</h1> </header> however, this looks kind of awkward, because the <header> tag that starts the expression is not indented to the same position as its corresponding closing tag.
...And 9 more matches
Starting our Svelte Todo list app - Learn web development
previous overview: client-side javascript frameworks next now that we have a basic understanding of how things work in svelte, we can start building our example app: a todo list.
... in this article we will first have a look at the desired functionality of our app, then we'll create a todos.svelte component and put static markup and styles in place, leaving everything ready to start developing our to-do list app features, which we'll go on to in subsequent articles.
... code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/02-starting-our-todo-app or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/02-starting-our-todo-app remember to run npm install && npm run dev to start your app in development mode.
...And 8 more matches
Animation.startTime - Web APIs
the animation.starttime property of the animation interface is a double-precision floating-point value which indicates the scheduled time when an animation's playback should begin.
... an animation’s start time is the time value of its documenttimeline when its target keyframeeffect is scheduled to begin playback.
... an animation’s start time is initially unresolved (meaning that it's null because it has no value).
...And 8 more matches
Range.setStart() - Web APIs
WebAPIRangesetStart
the range.setstart() method sets the start position of a range.
... if the startnode is a node of type text, comment, or cdatasection, then startoffset is the number of characters from the start of startnode.
... for other node types, startoffset is the number of child nodes between the start of the startnode.
...And 8 more matches
Getting started with HTML - Learn web development
to get you started, this article defines elements, attributes, and all the other important terms you may have heard.
...this opening tag marks where the element begins or starts to take effect.
... in this example, it precedes the start of the paragraph text.
...And 7 more matches
PerformanceEntry.startTime - Web APIs
the starttime property returns the first recorded timestamp of the performance entry.
... the value returned by this property depends on the performance entry's type: "frame" - returns the timestamp when the frame was started.
... "resource" - returns the timestamp immediately before the browser starts fetching the resource.
...And 6 more matches
RTCOfferOptions.iceRestart - Web APIs
the icerestart property of the rtcofferoptions dictionary is a boolean value which, when true, tells the rtcpeerconnection to start ice renegotiation.
... note: rather than manually creating and submitting an offer with icerestart set to true, you should consider calling the rtcpeerconnection method restartice() instead.
... syntax var options = { icerestart: trueorfalse }; value a boolean value indicating whether or not the rtcpeerconnection should generate new values for the connection's ice-ufrag and ice-pwd values, which will trigger ice renegotiation on the next message sent to the remote peer.
...And 6 more matches
grid-column-start - CSS: Cascading Style Sheets
the grid-column-start css property specifies a grid item’s start position within the grid column by contributing a line, a span, or nothing (automatic) to its grid placement.
... this start position defines the block-start edge of the grid area.
... syntax /* keyword value */ grid-column-start: auto; /* <custom-ident> value */ grid-column-start: somegridarea; /* <integer> + <custom-ident> values */ grid-column-start: 2; grid-column-start: somegridarea 4; /* span + <integer> + <custom-ident> values */ grid-column-start: span 3; grid-column-start: span somegridarea; grid-column-start: span somegridarea 5; /* global values */ grid-column-start: inherit; grid-column-start: initial; grid-column-start: unset; this property is specified as a single <grid-line> value.
...And 6 more matches
AudioBufferSourceNode.loopStart - Web APIs
the loopstart property of the audiobuffersourcenode interface is a floating-point value indicating, in seconds, where in the audiobuffer the restart of the play must happen.
... the loopstart property's default value is 0.
... syntax audiobuffersourcenode.loopstart = startoffsetinseconds; startoffsetinseconds = audiobuffersourcenode.loopstart; value a floating-point number indicating the offset, in seconds, into the audio buffer at which each loop should begin during playback.
...And 5 more matches
AudioBufferSourceNode.start() - Web APIs
the start() method of the audiobuffersourcenode interface is used to schedule playback of the audio data contained in the buffer, or to begin playback immediately.
... syntax audiobuffersourcenode.start([when][, offset][, duration]); parameters when optional the time, in seconds, at which the sound should begin to play, in the same time coordinate system used by the audiocontext.
...for example, to start playback halfway through a 10-second audio clip, offset should be 5.
...And 5 more matches
EffectTiming.iterationStart - Web APIs
web animations api's effecttiming dictionary's iterationstart property specifies the repetition number which repetition the animation begins at and its progress through it.
... element.animate(), keyframeeffectreadonly.keyframeeffectreadonly(), and keyframeeffect.keyframeeffect() all accept an object of timing properties including iterationstart.
... the value of iterationstart corresponds directly to animationeffecttimingreadonly.iterationstart in timing objects returned by animationeffectreadonly, keyframeeffectreadonly, and keyframeeffect.
...And 5 more matches
grid-row-start - CSS: Cascading Style Sheets
the grid-row-start css property specifies a grid item’s start position within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start edge of its grid area.
... syntax /* keyword value */ grid-row-start: auto; /* <custom-ident> values */ grid-row-start: somegridarea; /* <integer> + <custom-ident> values */ grid-row-start: 2; grid-row-start: somegridarea 4; /* span + <integer> + <custom-ident> values */ grid-row-start: span 3; grid-row-start: span somegridarea; grid-row-start: 5 somegridarea span; /* global values */ grid-row-start: inherit; grid-row-start: initial; grid-row-start: unset; this property is specified as a single <grid-line> value.
... <custom-ident> if there is a named line with the name '<custom-ident>-start', it contributes the first such line to the grid item’s placement.
...And 5 more matches
String.prototype.trimStart() - JavaScript
the trimstart() method removes whitespace from the beginning of a string.
... syntax str.trimstart(); str.trimleft(); return value a new string representing the calling string stripped of whitespace from its beginning (left end).
... description the trimstart() / trimleft() methods return the string stripped of whitespace from its left end.
...And 5 more matches
restart - SVG: Scalable Vector Graphics
WebSVGAttributerestart
the restart attribute specifies whether or not an animation can restart.
...bute: <animate>, <animatecolor>, <animatemotion>, <animatetransform>, and <set> html, body, svg { height: 100%; } a { fill: blue; text-decoration: underline; cursor: pointer; } <svg viewbox="0 0 220 200" xmlns="http://www.w3.org/2000/svg"> <rect y="30" width="100" height="100"> <animate attributetype="xml" attributename="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(elem...
...ent => { 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.
...And 5 more matches
Document Loading - From Load Start to Finding a Handler - Archive of obsolete content
we start with the request to load a particular link in a particular window, and proceed up to the point at which the data stream is dispatched to the proper handler.
...some facilities are provided for starting loads, canceling loads, and other such micromanagement.
...area alt="(10) getcategoryentry()" coords="575,418,821,418,821,455,629,455,629,484,575,484" href="#categorymanager" shape="poly"> <area alt="(12)" coords="539,133,583,163" href="#stream-converter"> <area alt="(11)" coords="485,133,537,163" href="#contenthandler"> <area alt="(9)" coords="445,132,484,165" href="#nsdocumentopeninfo::dispatchcontent"> <area alt="(8)" coords="405,133,439,162" href="#onstartrequest-innards"> <area alt="(7) onstartrequest()" coords="639,129,703,129,703,165,833,165,833,204,639,204" href="#onstartrequest" shape="poly"> <area alt="(6) asyncopen()" coords="637,121,709,121,709,96,783,96,783,58,637,58" href="#asyncopen" shape="poly"> <area alt="(5) open()" coords="311,306,432,371" href="#open"> <area alt="(4)" coords="90,384,127,417" href="#openuri-innards"> <area alt="(0) ...
...And 4 more matches
Measuring add-on startup performance - Archive of obsolete content
using about:startup the about startup add-on provides a much simpler way to measure startup performance.
... once installed, it will gather startup data and display it in the about:startup page.
... to test with about:startup, you should set up a new firefox profile, install this add-on, and then open and quit firefox repeatedly.
...And 4 more matches
Getting started with the Web - Learn web development
getting started with the web is a concise series introducing you to the practicalities of web development.
... the story of your first website it's a lot of work to create a professional website, so if you're new to web development, we encourage you to start small.
... you won't build another facebook right away, but it's not hard to get your own simple website online, so we'll start there.
...And 4 more matches
AudioScheduledSourceNode.start() - Web APIs
the start() method on audioscheduledsourcenode schedules a sound to begin playback at the specified time.
... syntax audioscheduledsourcenode.start([when [, offset [, duration]]]); parameters when optional the time, in seconds, at which the sound should begin to play.
...a value of 0 (or omitting the when parameter entirely) causes the sound to start playback immediately.
...And 4 more matches
Document: transitionstart event - Web APIs
the transitionstart event is fired when a css transition has actually started, i.e., after any transition-delay has ended.
... the difference is transitionstart and transitionrun is that transitionrun fires when the transition is created (i.e.
... at the start of any delay) and transitionstart fires when the actual animation has begun (i.e.
...And 4 more matches
GlobalEventHandlers.onanimationstart - Web APIs
an event handler for the animationstart event.
... this event is sent when a css animation starts to play.
... syntax var animstarthandler = target.onanimationstart; target.onanimationstart = function value a function to be called when an animationstart event occurs indicating that a css animation has begun on the target, where the target object is an html element (htmlelement), document (document), or window (window).
...And 4 more matches
HTMLElement: transitionstart event - Web APIs
the transitionstart event is fired when a css transition has actually started, i.e., after any transition-delay has ended.
... bubbles yes cancelable no interface transitionevent event handler property ontransitionstart examples this code adds a listener to the transitionstart event: element.addeventlistener('transitionstart', () => { console.log('started transitioning'); }); the same, but using the ontransitionstart property instead of addeventlistener(): element.ontransitionrun = () => { console.log('started transitioning'); }; live example in the following example, we have a simple <div> element, styled with a transition that includes a delay: <div class="transition">hover over me</div> <div class="message"></div> .transition { width: 100px; height: 100px; background: rgba(255,0,0,1); transition-property: transform, background; transition...
...-duration: 2s; transition-delay: 1s; } .transition:hover { transform: rotate(90deg); background: rgba(255,0,0,0); } to this, we'll add some javascript to indicate where the transitionstart and transitionrun events fire.
...And 4 more matches
MediaRecorder.onstart - Web APIs
the mediarecorder.onstartevent handler (part of the mediarecorder api) handles the start event, allowing you to run code in response to media recording being started by a mediarecorder.
... the start event is thrown as a result of the mediarecorder.start() method being invoked.
... at this point, the data starts being gathered into a blob.
...And 4 more matches
MediaRecorder.start() - Web APIs
the mediarecorder method start(), which is part of the mediastream recording api, begins recording media into one or more blob objects.
...then, each time that amount of media has been recorded, an event will be delivered to let you act upon the recorded media, while a new blob is created to record the next slice of the media assuming the mediarecorder's state is inactive, start() sets the state to recording, then begins capturing media from the input stream.
... note: if the browser is unable to start recording or continue recording, it will raise a domerror event, followed by a mediarecorder.dataavailable event containing the blob it has gathered, followed by the mediarecorder.stop event.
...And 4 more matches
OfflineAudioContext.startRendering() - Web APIs
the startrendering() method of the offlineaudiocontext interface starts rendering the audio graph, taking into account the current connections and the current scheduled changes.
... browsers currently support two versions of the startrendering() method — an older event-based version and a newer promise-based version.
... syntax event-based version: offlineaudioctx.startrendering(); offlineaudioctx.oncomplete = function(e) { // e.renderedbuffer contains the output buffer } promise-based version: offlineaudioctx.startrendering().then(function(buffer) { // buffer contains the output buffer }); parameters none.
...And 4 more matches
XRSession: selectstart event - Web APIs
the webxr event selectstart is sent to an xrsession when the user begins a primary action on one of its input sources.
... bubbles yes cancelable no interface xrinputsourceevent event handler property onselectstart for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources.
... examples the following example uses addeventlistener() to establish handlers for the selection events: selectstart, selectend, and select.
...And 4 more matches
XRSession: squeezestart event - Web APIs
the webxr event squeezestart is sent to an xrsession when the user begins a primary squeeze action on one of its input sources.
... bubbles yes cancelable no interface xrinputsourceevent event handler property onsqueezestart for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources.
... examples the following example uses addeventlistener() to establish handlers for the squeezeion events: squeezestart, squeezeend, and squeeze.
...And 4 more matches
SyntaxError: identifier starts immediately after numeric literal - JavaScript
the javascript exception "identifier starts immediately after numeric literal" occurs when an identifier started with a digit.
... identifiers can only start with a letter, underscore (_), or dollar sign ($).
... message syntaxerror: unexpected identifier after numeric literal (edge) syntaxerror: identifier starts immediately after numeric literal (firefox) syntaxerror: unexpected number (chrome) error type syntaxerror what went wrong?
...And 4 more matches
marker-start - SVG: Scalable Vector Graphics
the marker-start attribute defines the arrowhead or polymarker that will be drawn at the first vertex of the given shape.
...in this case, if the value of marker-start and marker-end are both not none, then two markers will be rendered on that final vertex.
...marker-start is only rendered on the first vertex of the path data.
...And 4 more matches
startOffset - SVG: Scalable Vector Graphics
the startoffset attribute defines an offset from the start of the path for the initial current text position along the path after converting the path to the <textpath> element's coordinate system.
...ody,svg { height:100% } <svg viewbox="0 0 220 100" xmlns="http://www.w3.org/2000/svg"> <path id="path1" fill="none" stroke="red" d="m10,90 q90,90 90,45 q90,10 50,10 q10,10 10,40 q10,70 45,70 q70,70 75,50" /> <path id="path2" fill="none" stroke="red" d="m130,90 q210,90 210,45 q210,10 170,10 q130,10 130,40 q130,70 165,70 q190,70 195,50" /> <text> <textpath href="#path1" startoffset="0"> quick brown fox jumps over the lazy dog.
... </textpath> </text> <text> <textpath href="#path2" startoffset="40"> quick brown fox jumps over the lazy dog.
...And 4 more matches
Getting started with CSS - Learn web development
starting with some html our starting point is an html document.
... <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>getting started with css</title> </head> <body> <h1>i am a level one heading</h1> <p>this is a paragraph of text.
...your list will now look like this: <ul> <li>item one</li> <li class="special">item two</li> <li>item <em>three</em></li> </ul> in your css you can target the class of special by creating a selector that starts with a full stop character.
...And 3 more matches
Getting started with Ember - Learn web development
objective: to learn how to install ember, and create a starter app.
... getting started the rest of the ember material you'll find here consists of a multi-part tutorial, in which we'll make a version of the classic todomvc sample app, teaching you how to use the essentials of the ember framework along the way.
... starting the development server you may start the app in development mode by typing the following command in your terminal, while inside the todomvc directory: ember server this should give you an output similar to the following: build successful (190ms) – serving on http://localhost:4200/ slowest nodes (totaltime >= 5%) | total (avg) -----------------------------------------+----------...
...And 3 more matches
Getting started with Vue - Learn web development
in this article we'll look at a little bit of vue background, learn how to install it and create a new project, study the high-level structure of the whole project and an individual component, see how to run the project locally, and get it prepared to start building our example.
... objective: to setup a local vue development environment, create a starter app, and understand the basics of how it works.
...this allows you to start using vue on existing sites, which is why vue prides itself on being a progressive framework.
...And 3 more matches
Localization quick start guide
whether you're here to start up your own localization in the mozilla project or to join the efforts of an existing localization, you've come to the right place.
...we will take you through the steps to get started, from the initial environment setup to testing and releasing your own localization.
...in closing, when you finish this guide, you will have all the tools necessary to start contributing!
...And 3 more matches
GlobalEventHandlers.ondragstart - Web APIs
a global event handler for the dragstart event.
... syntax var dragstarthandler = targetelement.ondragstart; return value dragstarthandler the dragstart event handler for element targetelement.
... example this example demonstrates using the ondragstart attribute handler to set an element's dragstart event handler.
...And 3 more matches
PerformanceResourceTiming.fetchStart - Web APIs
the fetchstart read-only property represents a timestamp immediately before the browser starts to fetch the resource.
... if there are http redirects the property returns the time immediately before the user agent starts to fetch the final resource in the redirection.
... syntax resource.fetchstart; return value a domhighrestimestamp immediately before the browser starts to fetch the resource.
...And 3 more matches
PerformanceResourceTiming.redirectStart - Web APIs
the redirectstart read-only property returns a timestamp representing the start time of the fetch which that initiates the redirect.
... if there are http redirects when fetching the resource and if any of the redirects are not from the same origin as the current document, but the timing allow check algorithm passes for each redirected resource, this property returns the starting time of the fetch that initiates the redirect; otherwise, zero is returned.
... syntax resource.redirectstart; return value a timestamp representing the start time of the fetch which initiates the redirect.
...And 3 more matches
PerformanceResourceTiming.requestStart - Web APIs
the requeststart read-only property returns a timestamp of the time immediately before the browser starts requesting the resource from the server, cache, or local resource.
... if the transport connection fails and the browser retires the request, the value returned will be the start of the retry request.
... there is no end property for requeststart.
...And 3 more matches
Range.startOffset - Web APIs
WebAPIRangestartOffset
the range.startoffset read-only property returns a number representing where in the startcontainer the range starts.
... if the startcontainer is a node of type text, comment, or cdatasection, then the offset is the number of characters from the start of the startcontainer to the boundary point of the range.
... for other node types, the startoffset is the number of child nodes between the start of the startcontainer and the boundary point of the range.
...And 3 more matches
ServiceWorkerContainer.startMessages() - Web APIs
the startmessages() method of the serviceworkercontainer interface explicitly starts the flow of messages being dispatched from a service worker to pages under its control (e.g.
...it's possible to start dispatching these messages earlier by calling serviceworkercontainer.startmessages(), for example if you've invoked a message handler using eventtarget.addeventlistener() before the page has finished loading, but want to start processing the messages right away.
... note: the messages start being sent automatically when setting the handler directly using serviceworkercontainer.onmessage.
...And 3 more matches
border-block-start - CSS: Cascading Style Sheets
the border-block-start css property is a shorthand property for setting the individual logical block-start border property values in a single place in the style sheet.
... constituent properties this property is a shorthand for the following css properties: border-block-start-color border-block-start-style border-block-start-width syntax border-block-start: 1px; border-block-start: 2px dotted; border-block-start: medium dashed blue; border-block-start can be used to set the values for one or more of border-block-start-width, border-block-start-style, and border-block-start-color.
... related properties are border-block-end, border-inline-start, and border-inline-end, which define the other borders of the element.
...And 3 more matches
border-inline-start - CSS: Cascading Style Sheets
the border-inline-start css property is a shorthand property for setting the individual logical inline-start border property values in a single place in the style sheet.
... constituent properties this property is a shorthand for the following css properties: border-inline-start-color border-inline-start-style border-inline-start-width syntax border-inline-start: 1px; border-inline-start: 2px dotted; border-inline-start: medium dashed green; the physical border to which border-inline-start maps depends on the element's writing mode, directionality, and text orientation.
... related properties are border-block-start, border-block-end, and border-inline-end, which define the other borders of the element.
...And 3 more matches
Getting Started with Firefox Extensions - Archive of obsolete content
if you're only getting started developing add-ons, the add-ons sdk provides a great way to quickly create simple ones and build on them.
...let's start by installing it.
...starting with firefox 43, extensions need to be signed by mozilla before they can be installed in firefox.
...And 2 more matches
Getting started with XULRunner - Archive of obsolete content
step 3: create the application folder structure time to start a simple, bare bones application shell.
... the toolkit preferences are described in further detail in xulrunner:specifying startup chrome window.
...first change into the \myapp folder, then start the application by: xulrunner application.ini you should now see a window that looks something like this.
...And 2 more matches
Debug.msTraceAsyncCallbackStarting - Archive of obsolete content
the debug.mstraceasynccallbackstarting function associates the callback stack with a previously specified asynchronous operation.
... syntax debug.mstraceasynccallbackstarting(asyncoperationid) parameters asyncoperationid the id associated with the asynchronous operation.
... asyncoperationid must correspond to the operation name previously returned from debug.mstraceasyncoperationstarting.
...And 2 more matches
TCP slow start - MDN Web Docs Glossary: Definitions of Web-related terms
tcp slow start helps buildup transmission speeds to the network's capabilities.
...tcp slow start is an algorithm used to detect the available bandwidth for packet transmission, and balances the speed of a network connection.
... to implement tcp slow start, the congestion window (cwnd) sets an upper limit on the amount of data a source can transmit over the network before receiving an acknowledgment (ack).
...And 2 more matches
How do I start to design my website? - Learn web development
summary when starting with a web project, many people focus on the technical side.
... deeper dive a project never starts with the technical side.
... an hour's discussion with friends is a good start, but inadequate.
...And 2 more matches
GlobalEventHandlers.onloadstart - Web APIs
the onloadstart property sets and returns the event handler for the loadstart event.
... syntax element.onloadstart = handlerfunction; var handlerfunction = element.onloadstart; handlerfunction should be either null or a javascript function specifying the handler for the event.
... the loadstart event is fired when progress has begun.
...And 2 more matches
GlobalEventHandlers.onselectstart - Web APIs
the onselectstart property of the globaleventhandlers mixin is an eventhandler that processes selectstart events.
... the selectstart event fires when the user starts to make a new text selection on a webpage.
... syntax object.onselectstart = functionref; value functionref is a function name or a function expression.
...And 2 more matches
GlobalEventHandlers.ontouchstart - Web APIs
the ontouchstart property of the globaleventhandlers mixin is an eventhandler that processes touchstart events.
... syntax var starthandler = someelement.ontouchstart; return value starthandler the touchstart event handler for element someelement.
... example this example shows two ways to use ontouchstart to set an element's touchstart event handler.
...And 2 more matches
HTMLMediaElement: loadstart event - Web APIs
the loadstart event is fired when the browser has started to load a resource.
... bubbles no cancelable no interface event event handler property onloadstart examples live example html <div class="example"> <button type="button">load video</button> <video controls width="250"></video> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .example { display: grid; grid-template-areas: "button log" "video log"; } button { grid-area: button; width: 10rem; margin: .5rem 0; } video { grid-area: video; } .event-log { grid-area: log; } .event-log>label...
... { display: block; } js const loadvideo = document.queryselector('button'); const video = document.queryselector('video'); const eventlog = 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.mozill...
...And 2 more matches
PerformanceResourceTiming.connectStart - Web APIs
the connectstart read-only property returns the timestamp immediately before the user agent starts establishing the connection to the server to retrieve the resource.
... syntax resource.connectstart; return value a domhighrestimestamp immediately before the browser starts to establish the connection to the server to retrieve the resource.
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
...And 2 more matches
PerformanceResourceTiming.domainLookupStart - Web APIs
the domainlookupstart read-only property returns the timestamp immediately before the browser starts the domain name lookup for the resource.
... syntax resource.domainlookupstart; return value a domhighrestimestamp immediately before the browser starts the domain name lookup for the resource.
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
...And 2 more matches
PerformanceResourceTiming.responseStart - Web APIs
the responsestart read-only property returns a timestamp immediately after the browser receives the first byte of the response from the server, cache, or local resource.
... syntax resource.responsestart; return value a domhighrestimestamp immediately after the browser receives the first byte of the response from the server.
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
...And 2 more matches
PerformanceResourceTiming.secureConnectionStart - Web APIs
the secureconnectionstart read-only property returns a timestamp immediately before the browser starts the handshake process to secure the current connection.
... syntax resource.secureconnectionstart; return value if the resource is fetched over a secure connection, a domhighrestimestamp immediately before the browser starts the handshake process to secure the current connection.
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
...And 2 more matches
PerformanceResourceTiming.workerStart - Web APIs
the workerstart read-only property of the performanceresourcetiming interface returns a domhighrestimestamp immediately before dispatching the fetchevent if a service worker thread is already running, or immediately before starting the service worker thread if it is not already running.
... syntax resource.workerstart; value a domhighrestimestamp.
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
...And 2 more matches
Range.setStartAfter() - Web APIs
the range.setstartafter() method sets the start position of a range relative to a node.
... the parent node of the start of the range will be the same as that for the referencenode.
... syntax range.setstartafter(referencenode); parameters referencenode the node to start the range after.
...And 2 more matches
Range.setStartBefore() - Web APIs
the range.setstartbefore() method sets the start position of a range relative to another node.
... the parent node of the start of the range will be the same as that for the referencenode.
... syntax range.setstartbefore(referencenode); parameters referencenode the node before which the range should start.
...And 2 more matches
Starting up and shutting down a WebXR session - Web APIs
context requirements a webxr compatible environment starts with a securely-loaded document.
... const immersiveok = await navigator.xr.issessionsupported("immersive-vr"); if (immersiveok) { // create and use an immersive vr session } else { // create an inline session instead, or tell the user about the // incompatibility if inline is required } creating and starting the session a webxr session is represented by an xrsession object.
...so a more complete function that starts up and returns a webxr session could look like this: async function createimmersivesession(xr) { try { session = await xr.requestsession("immersive-vr"); return session; } catch(error) { throw error; } } this function returns the new xrsession or throws an exception if an error occurs while creating the session.
...And 2 more matches
Window: transitionstart event - Web APIs
the transitionstart event is fired when a css transition has actually started, i.e., after any transition-delay has ended.
... bubbles yes cancelable no interface transitionevent event handler property globaleventhandlers.ontransitionstart the original target for this event is the element that had the transition applied.
...for full details on this event please see the page on htmlelement: transitionstart.
...And 2 more matches
margin-block-start - CSS: Cascading Style Sheets
the margin-block-start css property defines the logical block start margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation.
... syntax /* <length> values */ margin-block-start: 10px; /* an absolute length */ margin-block-start: 1em; /* relative to the text size */ margin-block-start: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-block-start: auto; /* global values */ margin-block-start: inherit; margin-block-start: initial; margin-block-start: unset; it corresponds to the margin-top, margin-right, margin-bottom, or margin-left property depending on the values defined for writing-mode, direction, and text-orientation.
... it relates to margin-block-end, margin-inline-start, and margin-inline-end, which define the other margins of the element.
...And 2 more matches
scroll-margin-inline-start - CSS: Cascading Style Sheets
the scroll-margin-inline-start property defines the margin of the scroll snap area at the start of the inline dimension that is used for snapping this box to the snapport.
... syntax /* <length> values */ scroll-margin-inline-start: 10px; scroll-margin-inline-start: 1em; /* global values */ scroll-margin-inline-start: inherit; scroll-margin-inline-start: initial; scroll-margin-inline-start: unset; values <length> an outset from the inline start edge of the scroll container.
... the child elements are styled as follows: .scroller > div { flex: 0 0 250px; width: 250px; background-color: #663399; color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; scroll-snap-align: start; } .scroller > div:nth-child(2n) { background-color: #fff; color: #663399; } the most relevant part here is scroll-snap-align: start, which specifies that the left-hand edges (the "starts" along the x axis, in our case) are the designated snap points.
...And 2 more matches
String.prototype.padStart() - JavaScript
the padstart() method pads the current string with another string (multiple times, if needed) until the resulting string reaches the given length.
... the padding is applied from the start of the current string.
... syntax str.padstart(targetlength [, padstring]) parameters targetlength the length of the resulting string once the current str has been padded.
...And 2 more matches
mozbrowserloadstart
the mozbrowserloadstart event is fired when the browser <iframe> starts to load a new page.
... this can be used when the embedder wants to start spinning a loading indicator, or update the ui in some other way to indicate loading has started.
... example in this example the mozbrowserloadend and mozbrowserloadstart events are used to change the icon shown on the stop/reload button between stop (x) and reload (r), as appropriate.
... var browser = document.queryselector("iframe"); browser.addeventlistener('mozbrowserloadstart',function() { stopreload.textcontent = 'x'; }); browser.addeventlistener('mozbrowserloadend',function() { stopreload.textcontent = 'r'; }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
Getting Started With NSS
you can start with: the current primary nss documentation page from which we link to other documentation.
...you could contribute by organizing it in a better way.) nss sample code a good place to start learning how to write nss applications are the command line tools that are maintained by the nss developers.
...(this section is still under construction, but there are many contribution opportunities) start by opening a bugzilla account at bugzilla.mozilla.org if you don't have one.
... creating your patch seee our section on nss sources, building, and testing to get started making your patch.
nsISessionStartup
browser/components/sessionstore/nsisessionstartup.idlscriptable handles the session restore process.
... 1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) implemented by: @mozilla.org/browser/sessionstartup;1.
... to use this service, use: var sessionstartup = components.classes["@mozilla.org/browser/sessionstartup;1"] .getservice(components.interfaces.nsisessionstartup); method overview boolean dorestore(); attributes attribute type description sessiontype unsigned long the type of session being restored; this will be one of the session type constants.
... resume_session 2 the previous session should be restored at startup.
AbstractRange.startContainer - Web APIs
the read-only startcontainer property of the abstractrange interface returns the start node for the range.
... syntax var startnode = range.startcontainer value the dom node inside which the start position of the range is found.
... specifications specification status comment domthe definition of 'startcontainer ' in that specification.
... living standard static rangethe definition of 'startcontainer' in that specification.
AbstractRange.startOffset - Web APIs
the read-only startoffset property of the abstractrange interface returns the offset into the start node of the range's start position.
... syntax var startoffset = range.startoffset value an integer value indicating the number of characters into the node indicated by startcontainer at which the first character of the range is located.
... specifications specification status comment domthe definition of 'startoffset' in that specification.
... living standard static rangethe definition of 'startoffset' in that specification.
Document: animationstart event - Web APIs
the animationstart event is fired when a css animation has started.
... bubbles yes cancelable no interface animationevent event handler property onanimationstart the original target for this event is the element that had the animation applied.
...for full details on this event please see the page on htmlelement: animationstart.
... examples this listens for the animationstart event and logs a message when it is fired: document.addeventlistener('animationstart', () => { console.log('animation started'); }); the same, but using onanimationstart: document.onanimationstart = () => { console.log('animation started'); }; see a live example of this event.
Element: compositionstart event - Web APIs
the compositionstart event is fired when a text composition system such as an input method editor starts a new composition session.
... for example, this event could be fired after a user starts entering a chinese character using a pinyin ime.
... bubbles 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...
... 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 ui events working draft ...
HTMLElement: animationstart event - Web APIs
the animationstart event is fired when a css animation has started.
... bubbles yes cancelable no interface animationevent event handler property onanimationstart examples this listens for the animationstart event and logs a message when it is fired: const animated = document.queryselector('.animated'); animated.addeventlistener('animationstart', () => { console.log('animation started'); }); the same, but using onanimationstart: const animated = document.queryselector('.animated'); animated.onanimationstart = () => { console.log('animatio...
...n started'); }; live example html <div class="animation-example"> <div class="container"> <p class="animation">you chose a cold night to visit our planet.</p> </div> <button class="activate" type="button">activate animation</button> <div class="event-log"></div> </div> css .container { height: 3rem; } .event-log { width: 25rem; height: 2rem; border: 1px solid black; margin: 0.2rem; padding: 0.2rem; } .animation.active { animation-duration: 2s; animation-name: slidein; animation-iteration-count: 2; } @keyframes slidein { from { transform: translatex(100%) scalex(3); } to { transform: translatex(0) scalex(1); } } js const animation = document.queryselector('p.animation'); const animationeventlog = document.queryselector('.anim...
...ation-example>.event-log'); const applyanimation = document.queryselector('.animation-example>button.activate'); let iterationcount = 0; animation.addeventlistener('animationstart', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation started' `; }); animation.addeventlistener('animationiteration', () => { iterationcount++; animationeventlog.textcontent = `${animationeventlog.textcontent}'animation iterations: ${iterationcount}' `; }); animation.addeventlistener('animationend', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation ended'`; animation.classlist.remove('active'); applyanimation.textcontent = "activate animation"; }); animation.addeventlistener('animationcancel', () => { animationeventlog.textcontent = `...
OscillatorNode.start() - Web APIs
the start method of the oscillatornode interface specifies the exact time to start playing the tone.
... syntax oscillator.start(when); // start playing oscillator at the point in time specified by when parameters when optional an optional double representing the time (in seconds) when the oscillator should start, in the same coordinate system as audiocontext's currenttime attribute.
... if a value is not included or is less than currenttime, the oscillator starts playing immediately.
... // create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(3000, audioctx.currenttime); // value in hertz oscillator.start(); specifications specification status comment web audio apithe definition of 'start' in that specification.
PerformanceNavigationTiming.domContentLoadedEventStart - Web APIs
the domcontentloadedeventstart read-only property returns a timestamp representing the time value equal to the time immediately before the user agent fires the domcontentloaded event at the current document.
... syntax perfentry.domcontentloadedeventstart; return value a timestamp representing the time value equal to the time immediately before the user agent fires the domcontentloaded event at the current document.
...on print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = ...
..." + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'domcontentloadedeventstart' in that specification.
PerformanceNavigationTiming.loadEventStart - Web APIs
the loadeventstart read-only property returns a timestamp representing the time value equal to the time immediately before the load event of the current document is fired.
... syntax perfentry.loadeventstart; return value a timestamp representing a time value equal to the time immediately before the load event of the current document is fired.
...on print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = ...
..." + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'loadeventstart' in that specification.
PerformanceNavigationTiming.unloadEventStart - Web APIs
the unloadeventstart read-only property returns a timestamp representing the time value equal to the time immediately before the user agent starts the unload event of the previous document.
... syntax perfentry.unloadeventstart; return value a timestamp representing the time value equal to the time immediately before the user agent starts the unload event of the previous document.
...on print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = ...
..." + p.redirectcount); } } specifications specification status comment navigation timing level 2the definition of 'unloadeventstart' in that specification.
PerformanceTiming.connectStart - Web APIs
the legacy performancetiming.connectstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the request to open a connection is sent to the network.
... if the transport layer reports an error and the connection establishment is started again, the last connection establisment start time is given.
... if a persistent connection is used, the value will be the same as performancetiming.fetchstart.
... syntax time = performancetiming.connectstart; specifications specification status comment navigation timingthe definition of 'performancetiming.connectstart' in that specification.
Range.startContainer - Web APIs
the range.startcontainer read-only property returns the node within which the range starts.
... to change the start position of a node, use one of the range.setstart() methods.
... syntax startrangenode = range.startcontainer; example range = document.createrange(); range.setstart(startnode,startoffset); range.setend(endnode,endoffset); startrangenode = range.startcontainer; specifications specification status comment domthe definition of 'range.endcontainer' in that specification.
... document object model (dom) level 2 traversal and range specificationthe definition of 'range.startcontainer' in that specification.
SourceBuffer.appendWindowStart - Web APIs
the appendwindowstart property of the sourcebuffer interface controls the timestamp for the start of the append window, a timestamp range that can be used to filter what media data is appended to the sourcebuffer.
... the default value of appendwindowstart is the presentation start time, which is the beginning time of the playable media.
... syntax var myappendwindowstart = sourcebuffer.appendwindowstart; sourcebuffer.appendwindowstart = 2.0; value a double, indicating the start time of the append window, in seconds.
... example tbd specifications specification status comment media source extensionsthe definition of 'appendwindowstart' in that specification.
StaticRange.startContainer - Web APIs
the read-only startcontainer property of the staticrange interface returns the start node for the range.
... syntax var node = staticnode.startcontainer value the dom node inside which the start position of the range is found.
... specifications specification status comment domthe definition of 'startcontainer ' in that specification.
... living standard static rangethe definition of 'startcontainer' in that specification.
StaticRange.startOffset - Web APIs
the read-only startoffset property of the staticrange interface returns the offset into the start node of the range's start position.
... syntax var startoffset = staticrange.startoffset value an integer value indicating the number of characters into the node indicated by startcontainer at which the first character of the range is located.
... specifications specification status comment domthe definition of 'startoffset' in that specification.
... living standard static rangethe definition of 'startoffset' in that specification.
Window: animationstart event - Web APIs
the animationstart event is fired when a css animation has started.
... bubbles yes cancelable no interface animationevent event handler property onanimationstart the original target for this event is the element that had the animation applied.
...for full details on this event please see the page on htmlelement: animationstart.
... examples this listens for the animationstart event and logs a message when it is fired: window.addeventlistener('animationstart', () => { console.log('animation started'); }); the same, but using onanimationstart: window.onanimationstart = () => { console.log('animation started'); }; see a live example of this event.
XRSession.onsqueezestart - Web APIs
the xrsession interface's onsqueezestart event handler property can be set to a function which is then invoked to handle the squeezestart event that's sent when the user successfully begins a primary squeeze action on a webxr input device.
... syntax xrsession.onsqueezestart = squeezestarthandlerfunction; value a function to be invoked whenever the xrsession receives a squeezestart event.
... examples this snippet of code adds a simple handler for the squeezestart event, which responds only to events on the user's dominant hand by getting the target ray, then calling a function findobjectusingray() to identify the object that the user is pointing at.
... xrsession.onsqueezestart = event => { if (event.inputsource.handedness == user.handedness) { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace; if (targetraypose) { user.heldobject = findobjectusingray(targetraypose.transform); } } }; specifications specification status comment webxr device apithe definition of 'xrsession.onsqueezestart' in that specification.
inset-inline-start - CSS: Cascading Style Sheets
the inset-inline-start css property defines the logical inline start inset of an element, which maps to a physical offset depending on the element's writing mode, directionality, and text orientation.
... /* <length> values */ inset-inline-start: 3px; inset-inline-start: 2.4em; /* <percentage>s of the width or height of the containing block */ inset-inline-start: 10%; /* keyword value */ inset-inline-start: auto; /* global values */ inset-inline-start: inherit; inset-inline-start: initial; inset-inline-start: unset; the shorthand for inset-inline-start and inset-inline-end is inset-inline.
... syntax values the inset-inline-start property takes the same values as the left property.
... formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-width of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'> examples setting inline start offset html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; position: relative; inset-inline-start: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'inset-inline-start' in that specification.
margin-inline-start - CSS: Cascading Style Sheets
the margin-inline-start css property defines the logical inline start margin of an element, which maps to a physical margin depending on the element's writing mode, directionality, and text orientation.
... syntax /* <length> values */ margin-inline-start: 10px; /* an absolute length */ margin-inline-start: 1em; /* relative to the text size */ margin-inline-start: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-inline-start: auto; /* global values */ margin-inline-start: inherit; it relates to margin-block-start, margin-block-end, and margin-inline-end, which define the other margins of the element.
... values the margin-inline-start property takes the same values as the margin-left property.
... formal definition initial value0applies tosame as margininheritednopercentagesdepends on layout modelcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typea length formal syntax <'margin-left'> examples setting inline start margin html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; margin-inline-start: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'margin-inline-start' in that specification.
padding-block-start - CSS: Cascading Style Sheets
the padding-block-start css property defines the logical block start padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation.
... syntax /* <length> values */ padding-block-start: 10px; /* an absolute length */ padding-block-start: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-block-start: 5%; /* a padding relative to the block container's width */ /* global values */ padding-block-start: inherit; padding-block-start: initial; padding-block-start: unset; values the padding-block-start property takes the same values as the padding-left property.
... it relates to padding-block-end, padding-inline-start, and padding-inline-end, which define the other paddings of the element.
... formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting block start padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-block-start: 20px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'padding-block-start' in that specification.
padding-inline-start - CSS: Cascading Style Sheets
the padding-inline-start css property defines the logical inline start padding of an element, which maps to a physical padding depending on the element's writing mode, directionality, and text orientation.
... syntax /* <length> values */ padding-inline-start: 10px; /* an absolute length */ padding-inline-start: 1em; /* a length relative to the text size */ /* <percentage> value */ padding-inline-start: 5%; /* a padding relative to the block container's width */ /* global values */ padding-inline-start: inherit; padding-inline-start: initial; padding-inline-start: unset; values the padding-inline-start property takes the same values as the padding-left property.
... it relates to padding-block-start, padding-block-end, and padding-inline-end, which define the other paddings of the element.
... formal definition initial value0applies toall elementsinheritednopercentageslogical-width of containing blockcomputed valueas <length>animation typea length formal syntax <'padding-left'> examples setting inline start padding for vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; padding-inline-start: 20px; background-color: #c8c800; } specifications specification status comment css logical properties and values level 1the definition of 'padding-inline-start' in that specification.
String.prototype.startsWith() - JavaScript
the startswith() method determines whether a string begins with the characters of a specified string, returning true or false as appropriate.
... syntax str.startswith(searchstring[, position]) parameters searchstring the characters to be searched for at the start of this string.
...however, you can polyfill string.prototype.startswith() with the following snippet: if (!string.prototype.startswith) { object.defineproperty(string.prototype, 'startswith', { value: function(search, rawpos) { var pos = rawpos > 0 ?
... examples using startswith() //startswith let str = 'to be, or not to be, that is the question.' console.log(str.startswith('to be')) // true console.log(str.startswith('not to be')) // false console.log(str.startswith('not to be', 10)) // true specifications specification ecmascript (ecma-262)the definition of 'string.prototype.startswith' in that specification.
start_url - Web app manifests
type string mandatory no the start_url member is a string that represents the start url of the web application — the prefered url that should be loaded when the user launches the web application (e.g., when the user taps on the web application's icon from a device's application menu or homescreen).
... note: the start_url member is purely advisory, and a user agent may ignore it or allow the user to alter it at install time or afterwards.
... examples absolute url "start_url": "https://example.com" relative url if the url is relative, the manifest url is used as the base url to resolve it.
... "start_url": "../startpoint.html" specification specification status comment feedback web app manifestthe definition of 'start_url' in that specification.
Getting started (cfx) - Archive of obsolete content
see: getting started with jpm cfx to jpm prerequisites to create add-ons for firefox using the sdk, you'll first need to follow the instructions to install and activate the sdk.
... developing without cfx run because cfx run restarts the browser each time you invoke it, it can be a little cumbersome if you are making frequent changes to an add-on.
...that way you can test new changes without needing to restart the browser: make a change to your add-on run cfx xpi post the add-on to the port specified you could even automate this workflow with a simple script.
Getting Started Guide
don't worry; the getting started guide is short.
...the following lists are good starting point, but by no means complete.
...you now know enough to start using nscomptrs.
BluetoothRemoteGATTCharacteristic.startNotifications() - Web APIs
the bluetoothremotegattcharacteristic.startnotifications() method returns a promise to the bluetoothremotegattcharacteristic instance when there is an active notification on it.
... syntax bluetoothremotegattcharacteristic.startnotifications().then(function(bluetoothremotegattcharacteristic) { ...
... specifications specification status comment web bluetooththe definition of 'startnotifications()' in that specification.
Document: dragstart event - Web APIs
the dragstart event is fired when the user starts dragging an element or text selection.
... interface dragevent event handler property ondragstart examples see the drag event for example code or this jsfiddle demo.
... specifications specification status comment html living standardthe definition of 'dragstart' in that specification.
FileReader: loadstart event - Web APIs
the loadstart event is fired when a file read operation has begun.
... bubbles no cancelable no interface progressevent event handler property filereader.onloadstart examples live example html <div class="example"> <div class="file-select"> <label for="avatar">choose a profile picture:</label> <input type="file" id="avatar" name="avatar" accept="image/png, image/jpeg"> </div> <img src="" class="preview" height="200" alt="image preview..."> <div class="event-log"> <label>event log:</label> <textarea readonly class="event-log-contents"></textarea> </div> </div> css img.preview { margin: 1rem 0; } .event-log-contents { width: 18rem; height: 5rem; border: 1px solid black; margin: .2rem; padding: .2rem; } .
...lector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistener('load', handleevent); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selected...
MessagePort.start() - Web APIs
WebAPIMessagePortstart
the start() method of the messageport interface starts the sending of messages queued on the port.
... syntax port.start() returns void.
... example in the following code block, you can see a handlemessage handler function, run when a message is sent back to this document using onmessage: channel.port1.onmessage = handlemessage; function handlemessage(e) { para.innerhtml = e.data; } another option would be to do this using eventtarget.addeventlistener, however, when this method is used, you need to explicitly call start() to begin the flow of messages to this document: channel.port1.addeventlistener('message', handlemessage, false); function handlemessage(e) { para.innerhtml = e.data; textinput.value = ''; } channel.port1.start(); specifications specification status comment html living standardthe definition of 'start()' in that specification.
PerformanceTiming.domainLookupStart - Web APIs
the legacy performancetiming.domainlookupstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the domain lookup starts.
... if a persistent connection is used, or the information is stored in a cache or a local resource, the value will be the same as performancetiming.fetchstart.
... syntax time = performancetiming.domainlookupstart; specifications specification status comment navigation timingthe definition of 'performancetiming.domainlookupstart' in that specification.
PerformanceTiming.loadEventStart - Web APIs
please use the performancenavigationtiming interface's performancenavigationtiming.loadeventstart read-only property instead..
... the legacy performancetiming.loadeventstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the load event was sent for the current document.
... syntax time = performancetiming.loadeventstart; specifications specification status comment navigation timingthe definition of 'performancetiming.loadeventstart' in that specification.
PerformanceTiming.navigationStart - Web APIs
the legacy performancetiming.navigationstart read-only property returns an unsigned long long representing the moment, in milliseconds since the unix epoch, right after the prompt for unload terminates on the previous document in the same browsing context.
... if there is no previous document, this value will be the same as performancetiming.fetchstart.
... syntax time = performancetiming.navigationstart; specifications specification status comment navigation timingthe definition of 'performancetiming.navigationstart' in that specification.
PerformanceTiming.requestStart - Web APIs
the legacy performancetiming.requeststart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the browser sent the request to obtain the actual document, from the server or from a cache.
... if the transport layer fails after the start of the request and the connection is reopened, this property will be set to the time corresponding to the new request.
... syntax time = performancetiming.requeststart; specifications specification status comment navigation timingthe definition of 'performancetiming.requeststart' in that specification.
Selection.collapseToStart() - Web APIs
the selection.collapsetostart() method collapses the selection to the start of the first range in the selection.
... syntax sel.collapsetostart() parameters none.
... specifications specification status comment selection apithe definition of 'selection.collapsetostart()' in that specification.
Sensor.start() - Web APIs
WebAPISensorstart
the start method activates one of the sensors based on sensor.
... syntax sensor.start() parameters none.
... return value undefined specifications specification status comment generic sensor apithe definition of 'start' in that specification.
SpeechRecognition.start() - Web APIs
the start() method of the web speech api starts the speech recognition service listening to incoming audio with intent to recognize grammars associated with the current speechrecognition.
... syntax myspeechrecognition.start(); parameters none.
...al | 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 definition of 'start()' in that spe...
SpeechSynthesisUtterance.onstart - Web APIs
the onstart property of the speechsynthesisutterance interface represents an event handler that will run when the utterance has begun to be spoken (when the start event fires.) this occurs when the speechsynthesis.speak() method is invoked.
... syntax speechsynthesisutteranceinstance.onstart = function() { ...
... inputform.onsubmit = function(event) { event.preventdefault(); var utterthis = new speechsynthesisutterance(inputtxt.value); var selectedoption = voiceselect.selectedoptions[0].getattribute('data-name'); for(i = 0; i < voices.length ; i++) { if(voices[i].name === selectedoption) { utterthis.voice = voices[i]; } } synth.speak(utterthis); utterthis.onstart = function(event) { console.log('we have started uttering this speech: ' + event.utterance.text); } inputtxt.blur(); } specifications specification status comment web speech apithe definition of 'onstart' in that specification.
TimeRanges.start() - Web APIs
WebAPITimeRangesstart
syntax starttime = timeranges.start(index) parameters index is the range number to return the starting time for.
... example given a video element with the id "myvideo": var v = document.getelementbyid("myvideo"); var buf = v.buffered; var numranges = buf.length; if (buf.length == 1) { // only one range if (buf.start(0) == 0 && buf.end(0) == v.duration) { // the one range starts at the beginning and ends at // the end of the video, so the whole thing is loaded } } this example looks at the time ranges and looks to see if the entire video has been loaded.
... specifications specification status comment html living standardthe definition of 'timeranges.start()' in that specification.
Window.mozAnimationStartTime - Web APIs
returns the time, in milliseconds since the epoch, at which animations started now should be considered to have started.
... this value should be used instead of, for example, date.now(), because this value will be the same for all animations started in this window during this refresh interval, allowing them to remain in sync with one another.
... syntax time = window.mozanimationstarttime; parameters time is the time in milliseconds since the epoch at which animations for the current window should be considered to have started.
XMLHttpRequest: loadstart event - Web APIs
the loadstart event is fired when a request has started to load data.
... bubbles no cancelable 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 = docum...
...ent.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.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', ()...
XMLHttpRequestEventTarget.onloadstart - Web APIs
the xmlhttprequesteventtarget.onloadstart is the function called when an xmlhttprequest transaction starts transferring data.
... syntax xmlhttprequest.onloadstart = callback; values callback is the function to be called when the transaction begins to transfer data.
... example var xmlhttp = new xmlhttprequest(), method = 'get', url = 'https://developer.mozilla.org/'; xmlhttp.open(method, url, true); xmlhttp.onloadstart = function () { console.log("download underway"); }; xmlhttp.send(); specifications specification status comment xmlhttprequest living standard whatwg living standard ...
XRSession.onselectstart - Web APIs
the onselectstart attribute of the xrsession object is the event handler for the selectstart event, which is dispatched when user starts making some sort of selection by pressing a trigger, touchpad, or button, speaking a command, or making a hand gesture.
... syntax xrsession.onselectstart = function(event) { ...
... } example xrsession.onselectstart = function(event) { console.log("the user has started a primary action, but might not have completed it.") } specifications specification status comment webxr device apithe definition of 'xrsession.onselectstart' in that specification.
border-block-start-color - CSS: Cascading Style Sheets
the border-block-start-color css property defines the color of the logical block-start border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation.
... syntax border-block-start-color: blue; border-block-start-color: #4c5d21; related properties are border-block-end-color, border-inline-start-color, and border-inline-end-color, which define the other border colors of the element.
...currentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <'border-top-color'> examples border color with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-block-start-color: red; } results specifications specification status comment css logical properties and values level 1the definition of 'border-block-start-color' in that specification.
border-block-start-style - CSS: Cascading Style Sheets
the border-block-start-style css property defines the style of the logical block start border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation.
... syntax /* <'border-style'> values */ border-block-start-style: dashed; border-block-start-style: dotted; border-block-start-style: groove; related properties are border-block-end-style, border-inline-start-style, and border-inline-end-style, which define the other border styles of the element.
...ial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples dashed border wtih vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-block-start-style: dashed; } results specifications specification status comment css logical properties and values level 1the definition of 'border-block-start-style' in that specification.
border-block-start-width - CSS: Cascading Style Sheets
the border-block-start-width css property defines the width of the logical block-start border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation.
... syntax /* <'border-width'> values */ border-block-start-width: 5px; border-block-start-width: thick; related properties are border-block-end-width, border-inline-start-width, and border-inline-end-width, which define the other border widths of the element.
...ockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length formal syntax <'border-top-width'> examples border width with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid blue; border-block-start-width: 5px; } results specifications specification status comment css logical properties and values level 1the definition of 'border-block-start-width' in that specification.
border-end-start-radius - CSS: Cascading Style Sheets
the border-end-start-radius css property defines a logical border radius on an element, which maps to a physical border radius depending on the element's writing-mode, direction, and text-orientation.
... /* <length> values */ /* with one value the corner will be a circle */ border-end-start-radius: 10px; border-end-start-radius: 1em; /* with two values the corner will be an ellipse */ border-end-start-radius: 1em 2em; /* global values */ border-end-start-radius: inherit; border-end-start-radius: initial; border-end-start-radius: unset; for instance, in a horizontal-tb writing mode this property corresponds to the border-top-right-radius property.
...the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typea length, percentage or calc(); formal syntax <length-percentage>{1,2}where <length-percentage> = <length> | <percentage> examples border radius with vertical text html <div> <p class="exampletext">example</p> </div> css div { background-color: rebeccapurple; width: 120px; height: 120px; border-end-start-radius: 10px; } .exampletext { writing-mode: vertical-rl; padding: 10px; background-color: #fff; border-end-start-radius: 10px; } results specifications specification status comment css logical properties and values level 1the definition of 'border-end-start-radius' in that specification.
border-inline-start-color - CSS: Cascading Style Sheets
the border-inline-start-color css property defines the color of the logical inline start border of an element, which maps to a physical border color depending on the element's writing mode, directionality, and text orientation.
... syntax border-inline-start-color: red; border-inline-start-color: #ee4141; related properties are border-block-start-color, border-block-end-color, and border-inline-end-color, which define the other border colors of the element.
...formal definition initial valuecurrentcolorapplies toall elementsinheritednocomputed valuecomputed coloranimation typea color formal syntax <'border-top-color'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 10px solid blue; border-inline-start-color: red; } specifications specification status comment css logical properties and values level 1the definition of 'border-inline-start-color' in that specification.
border-inline-start-style - CSS: Cascading Style Sheets
the border-inline-start-style css property defines the style of the logical inline start border of an element, which maps to a physical border style depending on the element's writing mode, directionality, and text orientation.
... syntax /* <'border-style'> values */ border-inline-start-style: dashed; border-inline-start-style: dotted; border-inline-start-style: groove; related properties are border-block-start-style, border-block-end-style, and border-inline-end-style, which define the other border styles of the element.
... formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax <'border-top-style'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 5px solid blue; border-inline-start-style: dashed; } specifications specification status comment css logical properties and values level 1the definition of 'border-inline-start-style' in that specification.
border-inline-start-width - CSS: Cascading Style Sheets
the border-inline-start-width css property defines the width of the logical inline-start border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation.
... syntax /* <'border-width'> values */ border-inline-start-width: 5px; border-inline-start-width: thick; related properties are border-block-start-width, border-block-end-width, and border-inline-end-width, which define the other border widths of the element.
...eslogical-width of containing blockcomputed valueabsolute length; 0 if the border style is none or hiddenanimation typea length formal syntax <'border-top-width'> examples html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; border: 1px solid blue; border-inline-start-width: 5px; } specifications specification status comment css logical properties and values level 1the definition of 'border-inline-start-width' in that specification.
border-start-end-radius - CSS: Cascading Style Sheets
the border-start-end-radius css property defines a logical border radius on an element, which maps to a physical border radius depending on the element's writing-mode, direction, and text-orientation.
... /* <length> values */ /* with one value the corner will be a circle */ border-start-end-radius: 10px; border-start-end-radius: 1em; /* with two values the corner will be an ellipse */ border-start-end-radius: 1em 2em; /* global values */ border-start-end-radius: inherit; border-start-end-radius: initial; border-start-end-radius: unset; for instance, in a horizontal-tb writing mode this property corresponds to the border-bottom-left-radius property.
... of the border boxcomputed valuetwo absolute <length>s or <percentage>sanimation typea length, percentage or calc(); formal syntax <length-percentage>{1,2}where <length-percentage> = <length> | <percentage> examples border radius with vertical text html <div> <p class="exampletext">example</p> </div> css div { background-color: rebeccapurple; width: 120px; height: 120px; border-start-end-radius: 10px; } .exampletext { writing-mode: vertical-rl; padding: 10px; background-color: #fff; border-start-end-radius: 10px; } results specifications specification status comment css logical properties and values level 1the definition of 'border-start-end-radius' in that specification.
inset-block-start - CSS: Cascading Style Sheets
the inset-block-start css property defines the logical block start offset of an element, which maps to a physical inset depending on the element's writing mode, directionality, and text orientation.
... /* <length> values */ inset-block-start: 3px; inset-block-start: 2.4em; /* <percentage>s of the width or height of the containing block */ inset-block-start: 10%; /* keyword value */ inset-block-start: auto; /* global values */ inset-block-start: inherit; inset-block-start: initial; inset-block-start: unset; syntax values the inset-block-start property takes the same values as the left property.
... formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-height of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'> examples setting block start offset html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; position: relative; inset-block-start: 20px; background-color: #c8c800; } specifications specification status comment css logical properties and values level 1the definition of 'inset-block-start' in that specification.
scroll-margin-block-start - CSS: Cascading Style Sheets
the scroll-margin-block-start property defines the margin of the scroll snap area at the start of the block dimension that is used for snapping this box to the snapport.
... syntax /* <length> values */ scroll-margin-block-start: 10px; scroll-margin-block-start: 1em; /* global values */ scroll-margin-block-start: inherit; scroll-margin-block-start: initial; scroll-margin-block-start: unset; values <length> an outset from the block start edge of the scroll container.
... formal definition initial value0applies toall elementsinheritednocomputed valueas specifiedanimation typeby computed value type formal syntax <length> specifications specification status comment css scroll snap module level 1the definition of 'scroll-margin-block-start' in that specification.
scroll-padding-block-start - CSS: Cascading Style Sheets
the scroll-padding-block-start property defines offsets for the start edge in the block dimension of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user.
... syntax /* keyword values */ scroll-padding-block-start: auto; /* <length> values */ scroll-padding-block-start: 10px; scroll-padding-block-start: 1em; scroll-padding-block-start: 10%; /* global values */ scroll-padding-block-start: inherit; scroll-padding-block-start: initial; scroll-padding-block-start: unset; values <length-percentage> an inwards offset from the block start edge of the scrollport, as a valid length or a percentage.
...eautoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-block-start' in that specification.
scroll-padding-inline-start - CSS: Cascading Style Sheets
the scroll-padding-inline-start property defines offsets for the start edge in the inline dimension of the optimal viewing region of the scrollport: the region used as the target region for placing things in view of the user.
... syntax /* keyword values */ scroll-padding-inline-start: auto; /* <length> values */ scroll-padding-inline-start: 10px; scroll-padding-inline-start: 1em; scroll-padding-inline-start: 10%; /* global values */ scroll-padding-inline-start: inherit; scroll-padding-inline-start: initial; scroll-padding-inline-start: unset; values <length-percentage> an inwards offset from the inline start edge of the scrollport, as a valid length or a percentage.
...autoapplies toscroll containersinheritednopercentagesrelative to the scroll container's scrollportcomputed valueas specifiedanimation typeby computed value type formal syntax auto | <length-percentage>where <length-percentage> = <length> | <percentage> specifications specification status comment css scroll snap module level 1the definition of 'scroll-padding-inline-start' in that specification.
starts-with - XPath
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the starts-with checks whether the first string starts with the second string and returns true or false.
... syntax starts-with(haystack, needle) arguments haystack the string to look in.
... returns true if haystack starts with needle.
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.
... function triggerurl(url) { installtrigger.startsoftwareupdtate(url); } // get the url to the .xpi from either a form // or text field entry.
startFind - Archive of obsolete content
« xul reference home startfind( mode ) return type: no return value call this method to handle your application's "find" command.
... example typically, you'll simply bind this method to your "find" command, like this: <command name="cmd_find" oncommand="gfindbar.startfind(gfindbar.find_normal);"/> ...
nsIAppStartup_MOZILLA_2_0
toolkit/components/startup/public/nsiappstartup.idlscriptable this lets you get information about the times at which key application startup events occurred.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) in gecko 4.0 this interface was merged into the nsiappstartup interface.
Document: selectstart event - Web APIs
the selectstart event of the selection api is fired when a user starts a new selection.
... bubbles yes cancelable yes interface event event handler property onselectstart examples // addeventlistener version document.addeventlistener('selectstart', () => { console.log('selection started'); }); // onselectstart version document.onselectstart = () => { console.log('selection changed.'); }; specifications specification status comment selection apithe definition of 'selectstart' in that specification.
Document: touchstart event - Web APIs
the touchstart event is fired when one or more touch points are placed on the touch surface.
... bubbles yes cancelable yes interface touchevent event handler property ontouchstart examples code samples for those events are available on the dedicated page: touch events.
Element: touchstart event - Web APIs
the touchstart event is fired when one or more touch points are placed on the touch surface.
... bubbles yes cancelable yes interface touchevent event handler property ontouchstart examples code samples for those events are available on the dedicated page: touch events.
GlobalEventHandlers.onloadstart - Web APIs
the onloadstart property of the globaleventhandlers mixin is an eventhandler representing the code to be called when the loadstart event is raised (when progress has begun on the loading of a resource.) syntax img.onloadstart = funcref; value funcref is the handler function to be called when the resource's loadstart event fires.
... examples html content <img src="myimage.jpg"> javascript content // 'loadstart' fires first, then 'load', then 'loadend' image.addeventlistener('load', function(e) { console.log('image loaded'); }); image.addeventlistener('loadstart', function(e) { console.log('image load started'); }); image.addeventlistener('loadend', function(e) { console.log('image load finished'); }); specifications specification status comment html living standardthe definition of 'onloadstart' in that specification.
startSoftwareUpdate - Web APIs
method of installtrigger object syntax boolean startsoftwareupdate ( string url); parameters the startsoftwareupdate method has the following parameter: url a uniform resource locator specifying the location of the xpi file containing the software.
... description the startsoftwareupdate method triggers a software download and install from the specified url.
PerformanceTiming.domContentLoadedEventStart - Web APIs
the legacy performancetiming.domcontentloadedeventstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, right before the parser sent the domcontentloaded event, that is right after all the scripts that need to be executed right after parsing has been executed.
... syntax time = performancetiming.domcontentloadedeventstart; specifications specification status comment navigation timingthe definition of 'performancetiming.domcontentloadedeventstart' in that specification.
PerformanceTiming.fetchStart - Web APIs
the legacy performancetiming.fetchstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, the browser is ready to fetch the document using an http request.
... syntax time = performance.timing.fetchstart; specifications specification status comment navigation timingthe definition of 'performancetiming.fetchstart' in that specification.
PerformanceTiming.redirectStart - Web APIs
the legacy performancetiming.redirectstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, the first http redirect starts.
... syntax time = performancetiming.redirectstart; specifications specification status comment navigation timingthe definition of 'performancetiming.redirectstart' in that specification.
PerformanceTiming.responseStart - Web APIs
the legacy performancetiming.responsestart read-only property returns an unsigned long long representing the moment in time (in milliseconds since the unix epoch) when the browser received the first byte of the response from the server, cache, or local resource.
... syntax time = performancetiming.responsestart; specifications specification status comment navigation timingthe definition of 'performancetiming.responsestart' in that specification.
PerformanceTiming.secureConnectionStart - Web APIs
the legacy performancetiming.secureconnectionstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, where the secure connection handshake starts.
... syntax time = performancetiming.secureconnectionstart; specifications specification status comment navigation timingthe definition of 'performancetiming.secureconnectionstart' in that specification.
PerformanceTiming.unloadEventStart - Web APIs
the legacy performancetiming.unloadeventstart read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, the unload event has been thrown.
... syntax time = performancetiming.unloadeventstart; specifications specification status comment navigation timingthe definition of 'performancetiming.unloadeventstart' in that specification.
SpeechRecognition: audiostart event - Web APIs
the audiostart event of the web speech api is fired when the user agent has started to capture audio for speech recognition.
... bubbles no cancelable no interface event event handler onaudiostart examples you can use the audiostart event in an onaudiostart method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('audiostart', function() { console.log('audio capturing started'); }); or use the onaudiostart event handler property: recognition.onaudiostart = function() { console.log('audio capturing started'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that specification.
SpeechRecognition.onaudiostart - Web APIs
the onaudiostart property of the speechrecognition interface represents an event handler that will run when the user agent has started to capture audio (when the audiostart event fires.) syntax myspeechrecognition.onaudiostart = function() { ...
... }; examples var recognition = new speechrecognition(); recognition.onaudiostart = function() { console.log('audio capturing started'); } specifications specification status comment web speech apithe definition of 'onaudiostart' in that specification.
SpeechRecognition.onsoundstart - Web APIs
the onsoundstart property of the speechrecognition interface represents an event handler that will run when any sound — recognisable speech or not — has been detected (when the soundstart event fires.) syntax myspeechrecognition.onsoundstart = function() { ...
... }; examples recognition.onsoundstart = function() { console.log('some sound is being received'); } specifications specification status comment web speech apithe definition of 'onsoundstart' in that specification.
SpeechRecognition.onspeechstart - Web APIs
the onspeechstart property of the speechrecognition interface represents an event handler that will run when sound recognised by the speech recognition service as speech has been detected (when the speechstart event fires.) syntax myspeechrecognition.onspeechstart = function() { ...
... }; examples recognition.onspeechstart = function() { console.log('speech has been detected'); } specifications specification status comment web speech apithe definition of 'onspeechstart' in that specification.
SpeechRecognition.onstart - Web APIs
the onstart property of the speechrecognition interface represents an event handler that will run when the speech recognition service has begun listening to incoming audio with intent to recognize grammars associated with the current speechrecognition (when the start event fires.) syntax myspeechrecognition.onstart = function() { ...
... }; examples recognition.onstart = function() { console.log('speech recognition service has started'); } specifications specification status comment web speech apithe definition of 'onstart' in that specification.
SpeechRecognition: soundstart event - Web APIs
the soundstart event of the web speech api is fired when any sound — recognisable speech or not — has been detected.
... bubbles no cancelable no interface event event handler property onsoundstart examples you can use the soundstart event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('soundstart', function() { console.log('some sound is being received'); }); or use the onsoundstart event handler property: recognition.onsoundstart = function() { console.log('some sound is being received'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that specification.
SpeechRecognition: speechstart event - Web APIs
the speechstart event of the web speech api is fired when sound recognized by the speech recognition service as speech has been detected.
... bubbles no cancelable no interface event event handler property onspeechstart examples you can use the speechstart event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('speechstart', function() { console.log('speech has been detected'); }); or use the onspeechstart event handler property: recognition.onspeechstart = function() { console.log('speech has been detected'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that specification.
SpeechRecognition: start event - Web APIs
the start event of the web speech api speechrecognition object is fired when the speech recognition service has begun listening to incoming audio with intent to recognize grammars associated with the current speechrecognition.
... bubbles no cancelable no interface event event handler property onstart examples you can use the start event in an addeventlistener method: var recognition = new webkitspeechrecognition() || new speechrecognition(); recognition.addeventlistener('start', function() { console.log('speech recognition service has started'); }); or use the onstart event handler property: recognition.onstart = function() { console.log('speech recognition service has started'); } specifications specification status comment web speech apithe definition of 'speech recognition events' in that specification.
SpeechSynthesisUtterance: start event - Web APIs
the start event of the web speech api speechsynthesisutterance object is fired when the utterance has begun to be spoken.
... bubbles no cancelable no interface speechsynthesisevent event handler property onstart examples you can use the start event in an addeventlistener method: utterthis.addeventlistener('start', function(event) { console.log('we have started uttering this speech: ' + event.utterance.text); }); or use the onstart event handler property: utterthis.onstart = function(event) { console.log('we have started uttering this speech: ' + event.utterance.text); } specifications specification status comment web speech apithe definition of 'speech synthesis utterance events' in that specification.
Getting started with WebGL - Web APIs
its purpose is to set up the webgl context and start rendering content.
... // // start here // function main() { const canvas = document.queryselector("#glcanvas"); // initialize the gl context const gl = canvas.getcontext("webgl"); // only continue if webgl is available and working if (gl === null) { alert("unable to initialize webgl.
touchstart - Event reference
the touchstart event is fired when one or more touch points are placed on the touch surface.
... element: touchstart document: touchstart bubbles yes cancelable yes interface touchevent event handler property ontouchstart specifications specification status touch events recommendation ...
Getting Started (jpm) - Archive of obsolete content
see instructions for getting started with cfx.
Creating a Skin for Firefox/Getting Started - Archive of obsolete content
note: starting in gecko 2.0, the new omni.jar file contains the skin, among other resources.
startEditing - Archive of obsolete content
« xul reference home startediting( row, column ) return type: no return value activates user editing of the given cell, which is specified by row index number and the nsitreecolumn in which it is located.
selectionStart - Archive of obsolete content
« xul reference selectionstart type: integer get or set the beginning of the selected portion of the field's text.
Getting Started - Archive of obsolete content
what do you need before you start?
:-moz-system-metric(scrollbar-start-backward) - Archive of obsolete content
the :-moz-system-metric(scrollbar-start-backward) css pseudo-class will match an element if the computer's user interface includes a backward arrow button at the start of scrollbars.
:-moz-system-metric(scrollbar-start-forward) - Archive of obsolete content
the :-moz-system-metric(scrollbar-start-forward) css pseudo-class will match an element if the computer's user interface includes a forward arrow button at the start of scrollbars.
Getting Started with Chat
for example, you can connect using ssl or a non-secure connection, and you can configure the client to automatically connect to a server and join a particular set of channels when you start the client.
Element: MSGestureStart event - Web APIs
the msgesturestart event is fired when there's a new point of contact on the touch surface, thus starting a new gesture.
Element: MSInertiaStart event - Web APIs
the msinertiastart event is fired when contact with the touch surface stops when a scroll has enough inertia to continue scrolling.
Element: gesturestart event - Web APIs
the gesturestart event is fired when multiple fingers contact the touch surface, thus starting a new gesture.
Getting Started - Developer guides
this article guides you through the ajax basics and gives you some simple hands-on examples to get you started.
Getting started - SVG: Scalable Vector Graphics
(firefox users: click here) the rendering process involves the following: we start with the <svg> root element: a doctype declaration as known from (x)html should be left off because dtd based svg validation leads to more problems than it solves before svg 2, to identify the version of the svg for other types of validation the version and baseprofile attributes should always be used instead.
Index - Web APIs
WebAPIIndex
a range is an object that indicates the start and end points of a section of content within the document.
... 17 abstractrange.collapsed api, abstractrange, dom, dom api, empty, property, range, reference, collapsed the collapsed read-only property of the abstractrange interface returns true if the range's start position and end position are the same.
... 20 abstractrange.startcontainer api, abstractrange, dom, dom api, property, range, read-only, reference, start, startcontainer the read-only startcontainer property of the abstractrange interface returns the start node for the range.
...And 196 more matches
Index - Archive of obsolete content
26 getting started add-on sdk learn how to contribute to the add-on sdk.
... 58 simple-prefs add-on sdk store preferences across application restarts.
... 59 simple-storage add-on sdk, add-ons, reference lets an add-on store data so that it's retained across firefox restarts.
...And 65 more matches
Index - Learn web development
this set of articles aims to provide complete beginners to web development with all that they need to start coding websites.
...to help you achieve this, this module will cover general best practices (which are demonstrated throughout the html, css, and javascript topics), cross browser testing, and some tips on enforcing accessibility from the start.
...you should now also have a thirst to learn about the implementation details that can make sites accessible, and we'll start on that in the next section, looking at why html is a good basis for accessibility.
...And 52 more matches
StringView - Archive of obsolete content
|*| http://www.gnu.org/licenses/lgpl-3.0.html |*| \*/ function stringview (vinput, sencoding /* optional (default: utf-8) */, noffset /* optional */, nlength /* optional */) { var ftaview, awhole, araw, fputoutptcode, fgetoutptchrsize, ninptlen, nstartidx = isfinite(noffset) ?
... vinput.bytelength >>> 1 : vinput.bytelength; araw = nstartidx === 0 && (!isfinite(nlength) || nlength === ninptlen) ?
... awhole : new ftaview(vinput, nstartidx, !isfinite(nlength) ?
...And 41 more matches
Index
MozillaTechXPCOMIndex
this can be particularly handy with restartless (boostrapped) extensions, so that you can unload an old version of a code module when a new version of your add-on is installed.
...if you're looking here just to learn about nscomptrs, you'll get a better introduction in the getting started guide.
... 81 getting started guide xpcom an nscomptr is an owning reference.
...And 37 more matches
JavaScript Daemons Management - Archive of obsolete content
in such a condition it is difficult and unnatural to keep track of all events started and then to stop them when appropriate through the cleartimeout() function.
... a possible approach to solve this problem is to nest all the information needed by each animation to start, stop, etc.
...but the daemon constructor itself is nothing but a clone of minidaemon with an added support for init and onstart functions declarable during the instantiation of the daemon.
...And 33 more matches
MathML Accessibility in Mozilla
we started exposing generic accessible objects for mathml in bug 920547 and so these can be retrieved by nvda starting with gecko 27.0 (firefox 27.0 / thunderbird 27.0 / seamonkey 2.24).
... mathml windows mac linux accessfu diagonal of a regular pentagon video video video / x+2 __________ x plus 2 __________ x+2 x plus 2 x + y ab __________ a over b __________ fraction start, a over b, end of fraction fraction start.
... a numerator b denominator fraction ab\frac a b ab __________ a over b __________ fraction start, a over b, end of fraction.
...And 31 more matches
Navigation and resource timings - Web Performance
as displayed in the image below, the navigation process goes from navigationstart, unloadeventstart, unloadeventend, redirectstart, redirectend, fetchstart, domainlookupstart, domainlookupend, connectstart , connectend, secureconnectionstart, requeststart, responsestart, responseend, domloading, dominteractive, domcontentloadedeventstart, domcontentloadedeventend, domcomplete, loadeventstart, and loadeventend.
... the order is: performance timings details navigationstart when the prompt for unload terminates on the previous document in the same browsing context.
... if there is no previous document, this value will be the same as performancetiming.fetchstart.
...And 31 more matches
Enhanced Extension Installation - Archive of obsolete content
<location>/extensions.ini - an ini manifest listing the directories for all the extensions and themes at the location (used by the component manager, preferences system, chrome registry etc to locate files during the startup process).
... in the profile directory, the file compatibility.ini stores information about the version of the application (build info) that last started this profile - during startup this file is checked and if the version info held by the running app disagrees with the info held by this file, a compatibility check is run on all installed items.
... when changes are made to the extensions datasource - new items are installed, old items uninstalled, enabled or disabled, a .autoreg file is written to the profile directory as well, which tells the startup code that the system has been modified, so that it destroys the component registries, finishes pending transactions and regenerates metadata appropriately.
...And 28 more matches
AddonManager
addonlistcallback() a callback that is passed an array of addons void addonlistcallback( in addon addons[] ) parameters addons the array of addons passed back from the asynchronous request constants addoninstall states constant description state_available an install that is waiting to be started.
... pending_enable this add-on will be enabled after the application restarts.
... pending_disable this add-on will be disabled after the application restarts.
...And 28 more matches
Drawing graphics - Learn web development
the situation started to improve when browsers began to support the <canvas> element and associated canvas api — apple invented it in around 2004, and other browsers followed by implementing it in the years that followed.
... the below example shows a simple 2d canvas-based bouncing balls animation that we originally met in our introducing javascript objects module: around 2006–2007, mozilla started work on an experimental 3d canvas implementation.
...we will however show how to use a webgl library to create a 3d scene more easily, and you can find a tutorial covering raw webgl elsewhere — see getting started with webgl.
...And 27 more matches
Command line options
command line options are used to specify various startup options for mozilla applications.
... using command line options command line options follow the command to start the application.
...in general, the syntax is as follows: application -option -option "argument" -option argument examples the following examples show the use of the "-profilemanager" command, which will open the profile manager prior to starting firefox or thunderbird: windows select run from windows start menu.
...And 27 more matches
Event reference
css animation events event name fired when animationstart a css animation has started.
... css transition events event name fired when transitionstart a css transition has actually started (fired after any delay).
... transitionrun a css transition has begun running (fired before any delay starts).
...And 27 more matches
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
you need to display a time as before, but in this example, you need: a "start" button to start the stopwatch running.
... you probably want to create a variable that starts at 0, then increments by one every second using a constant loop.
...a more accurate way would be to run starttime = date.now() to get a timestamp of exactly when the user clicked the start button, and then do date.now() - starttime to get the number of milliseconds after the start button was clicked.
...And 25 more matches
Layout using named grid lines - CSS: Cascading Style Sheets
i have defined a name for the start and end of the container, both for rows and columns.
... then defined the centre block of the grid as content-start and content-end again, both for columns and rows although you do not need to name all of the lines on your grid.
... .wrapper { display: grid; grid-template-columns: [main-start] 1fr [content-start] 1fr [content-end] 1fr [main-end]; grid-template-rows: [main-start] 100px [content-start] 100px [content-end] 100px [main-end]; } once the lines have names, we can use the name to place the item rather than the line number.
...And 25 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
objective the objective is to provide users with a mailer agent, a web browser, and a news reader which are automatically configured (preferences) at startup to the current user connected on the computer.
...fbranch() function pref(prefname, value) function defaultpref(prefname, value) function lockpref(prefname, value) function unlockpref(prefname) function getpref(prefname) function getldapattributes(host, base, filter, attribs) function getldapvalue(str, key) function displayerror(funcname, message) function getenv(name) configure autoconfig two directives ask thunderbird to use autoconfig at startup: # cat /usr/lib/thunderbird/defaults/pref/tb-autoconf.js // 20100526 - modification autoconfig jehan.
...evry.fr/sent"); lockpref("mail.identity.id1.fcc_folder_picker_mode", "0"); lockpref("mail.identity.id1.organization", "int evry france"); lockpref("mail.identity.id1.overrideglobal_pref", true); lockpref("mail.identity.id1.reply_to", ""); //imap lockpref("mail.server.server2.hostname", "imap-int.int-evry.fr"); lockpref("mail.server.server2.issecure", true); lockpref("mail.server.server2.login_at_startup", true); lockpref("mail.server.server2.max_cached_connections", 5); //lockpref("mail.server.server2.name", "jehan.procaccia@int-evry.fr"); lockpref("mail.server.server2.type", "imap"); lockpref("mail.server.server2.username", env_user); //smtp lockpref("mail.identity.id1.smtpserver", "smtp1"); lockpref("mail.identity.id1.stationery_folder", "imap://" + env_user + "@imap-int.int-evry.fr/templat...
...And 22 more matches
Timing element visibility with the Intersection Observer API - Web APIs
let's get started!
...we start with an empty <main> element here.
...more interesting is our use of grid-column here; here we specify that we want the column to start in the first column and ends in the first column past the last grid line—in other words, the header spans across all of the columns within the grid.
...And 22 more matches
Line-based placement with CSS Grid - CSS: Cascading Style Sheets
in the article covering the basic concepts of grid layout, we started to look at how to position items on a grid using line numbers.
... starting your exploration of grid with numbered lines is the most logical place to begin, as when you use grid layout you always have numbered lines.
...i would like the first item to start on the far left of the grid and span a single column track.
...And 22 more matches
source-editor.jsm
number findprevious(boolean awrap); event management void addeventlistener(string aeventtype, function acallback); void removeeventlistener(string aeventtype, function acallback); undo stack operations boolean canredo(); boolean canundo(); void endcompoundchange(); boolean redo(); void resetundo(); void startcompoundchange(); boolean undo(); display management operations void focus(); number gettopindex(); boolean hasfocus(); void settopindex(number atopindex); content management operations number getcharcount(); string getindentationstring(); string getlinedelimiter(); number getlinecount(); num...
...ber getlineend(number alineindex, boolean aincludedelimiter); number getlinestart(number alineindex); string getmode(); string gettext([optional] number astart, [optional] number aend); string getselectedtext(); void setmode(string amode); void settext(string atext, [optional] number astart, [optional] number aend); selection operations void dropselection(); number getcaretoffset(); object getcaretposition(); object getselection(); void setcaretoffset(number aoffset); void setcaretposition(number aline, [optional] number acolumn, [optional] number aalign); void setselection(number astart, number aend); breakpoint management void addbreakpoint(number ali...
... endcompoundchange() ends a compound change that was previously started by calling startcompoundchange().
...And 21 more matches
Download
method overview promise start(); promise launch(); promise showcontainingdirectory(); promise cancel(); promise removepartialdata(); promise whensucceeded(); promise finalize([optional] boolean aremovepartialdata); properties attribute type description canceled read only boolean indicates that the download has been canceled.
... this property can become true, then it can be reset to false when a canceled download is restarted.
...this value starts at zero, and may be updated regardless of the value of hasprogress.
...And 20 more matches
Signaling and video calling - Web APIs
exchanging session descriptions when starting the signaling process, an offer is created by the user initiating the call.
...each peer sends candidates in the order they're discovered, and keeps sending candidates until it runs out of suggestions, even if media has already started streaming.
...you should note that candidates are exchanged and media starts to flow as soon as the ice layer is satisfied.
...And 20 more matches
TypeScript support in Svelte - Learn web development
code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/07-typescript-support or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/07-typescript-support remember to run npm install && npm run dev to start your app in development mode.
... creating a svelte typescript project from scratch you can start a new svelte typescript project using the standard template.
... all you have to do is run the following terminal commands (run them somewhere where you are storing your svelte test projects — it creates a new directory): npx degit sveltejs/template svelte-typescript-app cd svelte-typescript-app node scripts/setuptypescript.js this creates a starter project that includes typescript support, which you can then modify as you wish.
...And 19 more matches
DataView - JavaScript
dataview.prototype.bytelength the length (in bytes) of this view from the start of its arraybuffer.
... dataview.prototype.byteoffset the offset (in bytes) of this view from the start of its arraybuffer.
... instance methods dataview.prototype.getint8() gets a signed 8-bit integer (byte) at the specified byte offset from the start of the view.
...And 19 more matches
Bootstrapped extensions - Archive of obsolete content
while this makes creating extensions that add to the application's user interface relatively easy, it means that updating, installing, or disabling an extension requires an application restart.
...this is done using a special script file that's included in the extension that contains functions the browser calls to command the extension to install, uninstall, start up, and shut down.
...see this tutorial on converting from an overlay extension to restartless for a practical step by step guide to migrating.
...And 18 more matches
IAccessibleText
other-licenses/ia2/accessibletext.idlnot scriptable a structure containing a substring and the start and end offsets in the enclosing string.
...method overview hresult addselection([in] long startoffset, [in] long endoffset ); [propget] hresult attributes([in] long offset, [out] long startoffset, [out] long endoffset, [out] bstr textattributes ); [propget] hresult caretoffset([out] long offset ); [propget] hresult characterextents([in] long offset, [in] enum ia2coordinatetype coordtype, [out] long x, [out] long y, [out] long width, [out] long height ); [propget] hresult ncharacters...
...acters ); [propget] hresult newtext([out] ia2textsegment newtext ); [propget] hresult nselections([out] long nselections ); [propget] hresult offsetatpoint([in] long x, [in] long y, [in] enum ia2coordinatetype coordtype, [out] long offset ); [propget] hresult oldtext([out] ia2textsegment oldtext ); hresult removeselection([in] long selectionindex ); hresult scrollsubstringto([in] long startindex, [in] long endindex, [in] enum ia2scrolltype scrolltype ); hresult scrollsubstringtopoint([in] long startindex, [in] long endindex, [in] enum ia2coordinatetype coordinatetype, [in] long x, [in] long y ); [propget] hresult selection([in] long selectionindex, [out] long startoffset, [out] long endoffset ); hresult setcaretoffset([in] long offset ); hresult setselection([in] long select...
...And 18 more matches
RDF Query Syntax - Archive of obsolete content
<vbox datasources="http://www.xulplanet.com/ds/sample.rdf" ref="http://www.xulplanet.com/rdf/a"> <template> <query> <content uri="?start"/> <triple subject="?start" predicate="http://www.xulplanet.com/rdf/relateditem" object="?relateditem"/> </query> <rule> ...
...the builder needs to start with a single result as the seed result.
...it indicates that we are going to use a starting point when navigating the graph.
...And 17 more matches
2D maze game with device orientation - Game development
starting with the project you can see cyber orb source code on github.
... the folder structure is quite straightforward: the starting point is the index.html file where we initialize the framework and set up an <canvas> to render the game on.
...let’s set it up: our starting point is the index.html file with the following content.
...And 17 more matches
IME handling guide
then, startcomposition(), setpendingcomposition(), flushpendingcomposition(), commitcomposition(), etc.
...its message is one of following values: ecompositionstart this is dispatched at starting a composition.
... this represents a dom compositionstart event.
...And 17 more matches
Bytecode Descriptions
getpropsuper operands: (uint32_t nameindex) stack: receiver, obj ⇒ super.name get the value of receiver.name, starting the property search at obj.
...format: jof_atom, jof_prop, jof_typeset, jof_ic getelemsuper stack: receiver, key, obj ⇒ super[key] get the value of receiver[key], starting the property search at obj.
...format: jof_elem, jof_typeset, jof_ic setpropsuper operands: (uint32_t nameindex) stack: receiver, obj, val ⇒ val assign val to receiver.name, starting the search for an existing property at obj.
...And 17 more matches
Document - Web APIs
WebAPIDocument
globaleventhandlers.onanimationstart an eventhandler called when an animationstart event is sent, indicating that a css animation has started playing.
... globaleventhandlers.ondragstart is an eventhandler representing the code to be called when the dragstart event is raised.
... globaleventhandlers.onloadend is an eventhandler representing the code to be called when the loadend event is raised (when progress has stopped on the loading of a resource.) globaleventhandlers.onloadstart is an eventhandler representing the code to be called when the loadstart event is raised (when progress has begun on the loading of a resource.) globaleventhandlers.onlostpointercapture is an eventhandler representing the code to be called when the lostpointercapture event type is raised.
...And 17 more matches
PerformanceTiming - Web APIs
performancetiming.navigationstart read only when the prompt for unload terminates on the previous document in the same browsing context.
... if there is no previous document, this value will be the same as performancetiming.fetchstart.
... performancetiming.unloadeventstart read only when the unload event has been thrown, indicating the time at which the previous document in the window began to unload.
...And 17 more matches
Inputs and input sources - Web APIs
inputsourcelist.foreach(source => { switch(source) { case "left": lefthandsource = source; break; case "right": righthandsource = source; break; } }); }); the inputsourceschange event is also fired once when the session's creation callback first completes execution, so you can use it to fetch the input source list as soon as it's available at startup time.
... let primaryinputsource = xrsession.inputsources[0]; for (let i=0; i < xrsession.inputsources.length; i++) { if (xrsession.inputsources[i].handedness === user.handedness) { primaryinputsource = inputsources[i]; break; } } this snippet of code starts by assuming that the first input source is the primary, but then looks for one whose handedness matches the one specified in the user object.
...the code below starts by assuming the first input source is the primary, then establishes a handler for the select event that records the event's source as the primary input source.
...And 17 more matches
Movement, orientation, and motion: A WebXR example - Web APIs
setup and utility functions next, we declare the variables and constants used throughout the application, starting with those used to store webgl and webxr specific information: let polyfill = null; let xrsession = null; let xrinputsources = null; let xrreferencespace = null; let xrbutton = null; let gl = null; let animationframerequestid = 0; let shaderprogram = null; let programinfo = null; let buffers = null; let texture = null; let mouseyaw = 0; let mousepitch = 0; this is followed by a set of const...
... const viewerstartposition = vec3.fromvalues(0, 0, -10); const viewerstartorientation = vec3.fromvalues(0, 0, 1.0); const cubeorientation = vec3.create(); const cubematrix = mat4.create(); const mousematrix = mat4.create(); const inverseorientation = quat.create(); const radians_per_degree = math.pi / 180.0; the first two—viewerstartposition and viewerstartorientation—indicate where the viewer will be placed relative to the center of the space, and the direction in which they'll initially be looking.
... starting up and shutting down webxr upon initially loading the script, we install a handler for the load event, so that we can perform initialization.
...And 17 more matches
Audio for Web games - Game development
many browsers will simply ignore any requests made by your game to automatically play audio; instead playback for audio needs to be started by a user-initiated event, such as a click or tap.
... for more passive audio auto play, for example background music that starts as soon as a game loads, one trick is to detect any user initiated event and start playback then.
... for other more active sounds that are to be used during the game we could consider priming them as soon as something like a start button is pressed.
...And 16 more matches
A first splash into JavaScript - Learn web development
you need to start thinking like a programmer — this generally involves looking at descriptions of what your program needs to do, working out what code features are needed to achieve those things, and how to make them work together.
...guess > 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 = document.queryselectorall('.resultparas p'); for(let i = 0 ; i < resetparas.length ; i++) { resetparas[i].textcontent = ''; } resetbutton.parentnode.removechild(resetbutton); gu...
...when the game ends, the player should be given an option to start playing again.
...And 16 more matches
Understanding client-side JavaScript frameworks - Learn web development
in this set of articles, we are aiming to give you a comfortable starting point to help you begin learning frameworks.
... after that, we'll provide some tutorials covering the essentials of some of the different framework choices, to provide you with enough context and familiarity to start going into greater depth yourself.
... get started now, with "introduction to client-side frameworks" prerequisites you should really learn the basics of the core web languages first before attempting to move on to learning client-side frameworks — html, css, and especially javascript.
...And 16 more matches
Component Internals
xxx mediawiki...xxx sucks creating components in c++ let's start by examining how xpcom components are written in c++.
...when an application starts up, that application may initialize xpcom.
... the sequence of events that kicks off this xpcom initialization may be triggered by user action or by the application startup itself.
...And 15 more matches
nsIAccessibleText
inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void addselection(in long startoffset, in long endoffset); nsiaccessible getattributerange(in long offset, out long rangestartoffset, out long rangeendoffset); obsolete since gecko 1.9.1 wchar getcharacteratoffset(in long offset); void getcharacterextents(in long offset, out long x, out long y, out long width, out long height, in unsigned long coordtype); long getoffsetatpoint(in long x, in long y, in unsigned long coordtype); void getrangeextents(in long startoffset, in long endoffset, out long x, out long y, out long width, out long height, in unsigned long coor...
...dtype); void getselectionbounds(in long selectionnum, out long startoffset, out long endoffset); astring gettext(in long startoffset, in long endoffset); astring gettextafteroffset(in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset); astring gettextatoffset(in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset); nsipersistentproperties gettextattributes(in boolean includedefattrs, in long offset, out long rangestartoffset, out long rangeendoffset); astring gettextbeforeoffset(in long offset, in nsaccessibletextboundary boundarytype, out long startoffset, out long endoffset); void removeselection(in long selectionnum); void scrollsubstringto(in long startindex, in long endindex, in unsi...
...gned long scrolltype); void scrollsubstringtopoint(in long startindex, in long endindex, in unsigned long coordinatetype, in long x, in long y); void setselectionbounds(in long selectionnum, in long startoffset, in long endoffset); attributes attribute type description caretoffset long the current current caret offset.
...And 15 more matches
Drawing shapes with canvas - Web APIs
the grid before we can start drawing, we need to talk about the canvas grid or coordinate space.
... closepath() adds a straight line to the path, going to the start of the current sub-path.
...every time this method is called, the list is reset and we can start drawing new shapes.
...And 15 more matches
<easing-function> - CSS: Cascading Style Sheets
the easing functions in the cubic-bezier subset of easing functions are often called "smooth" easing functions, because they can be used to smooth down the start and end of the animation.
...as these curves are continuous, they are often used to smooth down the start and end of the animation and are therefore sometimes called easing functions.
...p0 and p3 are the start and the end of the curve and, in css these points are fixed as the coordinates are ratios (the abscissa the ratio of time, the ordinate the ratio of the output range).
...And 15 more matches
Introduction to automated testing - Learn web development
to start using node/npm-based packages on your projects, you need to set up your project directories as npm projects.
...you'll have to restart the watch once a css error is encountered, or find another way to do this.
...see getting started with grunt for more details.
...And 14 more matches
Using the Resource Timing API - Web APIs
the interface's properties create a resource loading timeline with high-resolution timestamps for network events such as redirect start and end times, fetch start, dns lookup start and end times, response start and end times, etc.
... timing resource loading phases the following example illustrates using the resource timing properties to calculate the amount of time the following phases take: redirection (redirectstart and redirectend ), dns lookup (domainlookupstart and domainlookupend), tcp handshake (connectstart and connectend), and response (responsestart and responseend).
... this example also calculates the time from the start of the fetch and request start phases (fetchstart and requeststart, respectively), until the response has ended (responseend).
...And 14 more matches
Web Video Text Tracks Format (WebVTT) - Web APIs
in the case of each cue: the first line is started with a time, which is the starting time for showing the text that appears underneath.
... we can then have one or more lines that start with a hyphen (-), each containing part of the text track to be shown.
...these should be on separate lines, starting with the string note.
...And 14 more matches
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
as a simple example, i am creating a 12-column flexible grid that has 12 1fr-unit column tracks, they all have a start line named col-start.
... this means that we will have twelve grid lines named col-start.
... .wrapper { max-width: 1024px; margin: 0 auto; font: 1.2em helvetica, arial, sans-serif; } .wrapper > * { border: 2px solid #f08c00; background-color: #ffec99; border-radius: 5px; padding: 10px; } .wrapper { display: grid; grid-template-columns: repeat(12, [col-start] 1fr); grid-gap: 20px; } to demonstrate how this grid system works i have four child elements inside my wrapper.
...And 14 more matches
Drag and Drop JavaScript Wrapper - Archive of obsolete content
<button label="drag me" ondraggesture="nsdraganddrop.startdrag(event,buttonobserver);" /> the function startdrag will be called when a drag starts on the button.
...in this case we only do anything special when the button drag is started.
... if we wanted to handle the other cases also, we can call the other functions, as in the following example: <description value="click and drag this text." ondraggesture="nsdraganddrop.startdrag(event,textobserver)" ondragover="nsdraganddrop.dragover(event,textobserver)" ondragexit="nsdraganddrop.dragexit(event,textobserver)" ondragdrop="nsdraganddrop.drop(event,textobserver)" /> as mentioned earlier, there is nothing special that happens during a dragenter event, so you can just write that yourself.
...And 13 more matches
Anatomy of a video game - Game development
here is an example of a simple main loop: window.main = function () { window.requestanimationframe( main ); // whatever your main loop needs to do }; main(); // start the cycle note: in each of the main() methods discussed here, we schedule a new requestanimationframe before performing our loop contents.
... /* * starting with the semicolon is in case whatever line of code above this example * relied on automatic semicolon insertion (asi).
...*/ ;(function () { function main() { window.requestanimationframe( main ); // your main loop contents } main(); // start the cycle })(); when the browser comes across this iife, it will define your main loop and immediately queue it for the next frame.
...And 13 more matches
Hacking Tips
if you have no precise idea which function you are looking at, you can set a breakpoint on the js::ion::codegenerator::visitstart function.
... $ gdb --args js […] (gdb) b js::ion::codegenerator::visitstart (gdb) command >call masm.breakpoint() >continue >end (gdb) r js> function f(a, b) { return a + b; } js> for (var i = 0; i < 100000; i++) f(i, i + 1); breakpoint 1, js::ion::codegenerator::visitstart (this=0x101ed20, lir=0x10234e0) at /home/nicolas/mozilla/ionmonkey/js/src/ion/codegenerator.cpp:609 609 } program received signal sigtrap, trace/breakpoint trap.
...(gdb) r starting program: /home/code/mozilla-central/js/src/32-release/js -f /home/code/jaeger.js [thread debugging using libthread_db enabled] using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
...And 13 more matches
Recording a media element - Web APIs
html content <p>click the "start" button to begin video recording for a few seconds.
...</p> <br> let's start by looking at the key bits of the html.
... <div class="left"> <div id="startbutton" class="button"> start </div> <h2>preview</h2> <video id="preview" width="160" height="120" autoplay muted></video> </div> we present our main interface in two columns.
...And 13 more matches
Using CSS animations - CSS: Cascading Style Sheets
animations consist of two components, a style describing the css animation and a set of keyframes that indicate the start and end states of the animation’s style, as well as possible intermediate waypoints.
... animation-direction configures whether or not the animation should alternate direction on each run through the sequence or reset to the start point and repeat itself.
...if from/0% or to/100% is not specified, the browser starts or finishes the animation using the computed values of all attributes.
...And 13 more matches
Aligning Items in a Flex Container - CSS: Cascading Style Sheets
we can use other values to control how the items align: align-items: flex-start align-items: flex-end align-items: center align-items: stretch align-items: baseline in the live example below, the value of align-items is stretch.
... in this next live example, the flex container has align-items: flex-start, which means the items are all aligned to the start of the cross axis.
... the align-content property takes the following values: align-content: flex-start align-content: flex-end align-content: center align-content: space-between align-content: space-around align-content: stretch align-content: space-evenly (not defined in the flexbox specification) in the live example below, the flex container has a height of 400 pixels, which is more than needed to display our items.
...And 13 more matches
Paths - SVG: Scalable Vector Graphics
WebSVGTutorialPaths
the "move to" command appears at the beginning of paths to specify where the drawing should start.
... h x (or) h dx v y (or) v dy an easy place to start is by drawing a shape.
... we will start with a rectangle (the same type that could be more easily made with a <rect> element).
...And 13 more matches
Setting up an extension development environment - Archive of obsolete content
edit files in the extensions folder of this profile, and restart the application as this new developer profile.
... to quickly achieve our task of creating just a developer profile, we will start the application with the parameters: /path/to/firefox -no-remote -p profilename without these parameters, the default behavior of your mozilla applications is to only open the everyday user profile: named default.
... in the following example, the described command starts a new instance of firefox, with a profile called dev; even if an instance of firefox is already running.
...And 12 more matches
Handling common JavaScript problems - Learn web development
for a start, the javascript console will report errors in your code.
...for a start, there is a console api that allows javascript code to interact with the browser's javascript console.
... performance issues as your apps get more complex and you start to use more javascript, you may start to run into performance problems, especially when viewing apps on slower devices.
...And 12 more matches
Profiling with the Firefox Profiler
using the firefox profiler visit profiler.firefox.com to get started.
...for example:in the results above we can see that we're spending ~287 milliseconds in startup::xre_initchildprocess, 194 ms of which are spent in pvsync::msg_notify and all child functions that it calls.
... profiling firefox startup start your firefox with the environment variable moz_profiler_startup=1 set.
...And 12 more matches
Shell global objects
these are the global objects that are set up automatically by the spidermonkey js command-line interpreter when you start the program.
...options is an optional object that may have these properties: isrunonce use the isrunonce compiler option (default: false) noscriptrval use the no-script-rval compiler option (default: false) filename filename for error messages and debug info linenumber starting line number for error messages and debug info columnnumber starting column number for error messages and debug info global global in which to execute the code newcontext if true, create and use a new cx (default: false) catchtermination if true, catch termination (failure without an exception value, as for slow scripts or out-of-memory) and return 'terminated' element if pr...
... starttimingmutator() start accounting time to mutator vs gc.
...And 12 more matches
Mozilla internal string guide
if there's a need to request a different capacity before you are ready to call finish(), you can call restartbulkwrite() on the handle.
...calling restartbulkwrite() invalidates previously-obtained span, raw pointer or length.
...the syntax is: prbool findinreadable(const nsastring& pattern, nsastring::const_iterator start, nsastring::const_iterator end, nsstringcomparator& acomparator = nsdefaultstringcomparator()); to use this, start and end should point to the beginning and end of a string that you would like to search.
...And 12 more matches
Observer Notifications
application startup these are the topics that you can observe on startup, in order of appearance.
... if your component requires access to the user profile, or any services which require access to the profile (preferences, bookmarks, and so on) then a common pattern is to register with the nsicategorymanager for the app-startup topic which can be done in the component's registration code, and then in that notification register with the observer service for the profile-after-change notification.
... see receiving startup notifications for more information about how this works.
...And 12 more matches
nsDependentCString
methods constructors nsdependentcstring(const char*, const char*) - source parameters char* start a pointer to the start of the string.
...pruint32 startpos the position within the existing string at which the dependent string should start.
... this is similar to using substring(str, startpos), except that the resulting string is flat.
...And 12 more matches
Web Console remoting - Firefox Developer Tools
the new web console actors are: the webconsoleactor allows js evaluation, autocomplete, start/stop listeners, etc.
... to attach to the webconsoleactor, follow these steps: connecttoserver() // the usual listtabs() pickthetabyouwant() debuggerclient.attachconsole(tab.consoleactor, listeners, onattachconsole) the listeners argument is an array which specifies listeners you want to start in the web console.
...for example: ["pageerror", "consoleapi", "networkactivity", "fileactivity"] the web console actor does not start any listeners by default.
...And 12 more matches
Advanced techniques: Creating and sequencing audio - Web APIs
if you are about to embark on building something more complex, tone.js would be a good place to start.
... creating an audio context as you should be used to by now, each web audio api app starts with an audio context: // for cross browser compatibility const audiocontext = window.audiocontext || window.webkitaudiocontext; const audioctx = new audiocontext(); the "sweep" — oscillators, periodic waves, and envelopes for what we will call the "sweep" sound, that first noise you hear when you dial up, we're going to create an oscillator to generate the sound.
... the oscillator now we can create an oscillatornode and set its wave to the one we've created: function playsweep() { let osc = audioctx.createoscillator(); osc.setperiodicwave(wave); osc.frequency.value = 440; osc.connect(audioctx.destination); osc.start(); osc.stop(audioctx.currenttime + 1); } controlling amplitude this is great, but wouldn't it be nice if we had an amplitude envelope to go with it?
...And 12 more matches
Migrating from webkitAudioContext - Web APIs
changes to starting and stopping nodes in webkitaudiocontext, there are two ways to start and stop audiobuffersourcenode and oscillatornode: the noteon() and noteoff() methods, and the start() and stop() methods.
... (audiobuffersourcenode has yet another way of starting output: the notegrainon() method.) the noteon()/notegrainon()/noteoff() methods were the original way to start/stop output in these nodes, and in the newer versions of the specification, the noteon() and notegrainon() methods were consolidated into a single start() method, and the noteoff() method was renamed to the stop() method.
... for example, if you have code like the below: var osc = context.createoscillator(); osc.noteon(1); osc.noteoff(1.5); var src = context.createbuffersource(); src.notegrainon(1, 0.25); src.noteoff(2); you can simply change it like this in order to port it to the standard audiocontext api: var osc = context.createoscillator(); osc.start(1); osc.stop(1.5); var src = context.createbuffersource(); src.start(1, 0.25); src.stop(2); remove synchronous buffer creation in the old webkit implementation of web audio, there were two versions of createbuffer(), one which created an initially empty buffer, and one which took an existing arraybuffer containing encoded audio, decoded it and returned the result in the form of an audiobuffer.
...And 12 more matches
Box alignment in CSS Grid Layout - CSS: Cascading Style Sheets
so we will start by looking at the two axes that we deal with when aligning things in a grid.
...i can use the align-items property on the grid container, to align the items using one of the following values: auto normal start end center stretch baseline first baseline last baseline * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } .wrapper { display: grid; grid-template-columns: repe...
...at(8, 1fr); grid-gap: 10px; grid-auto-rows: 100px; grid-template-areas: "a a a a b b b b" "a a a a b b b b" "c c c c d d d d" "c c c c d d d d"; align-items: start; } .item1 { grid-area: a; } .item2 { grid-area: b; } .item3 { grid-area: c; } .item4 { grid-area: d; } <div class="wrapper"> <div class="item1">item 1</div> <div class="item2">item 2</div> <div class="item3">item 3</div> <div class="item4">item 4</div> </div> keep in mind that once you set align-items: start, the height of each child <div> will be determined by the contents of the <div>.
...And 12 more matches
CSS grids, logical values, and writing modes - CSS: Cascading Style Sheets
this can become an issue when developing a site that has to work in multiple languages, including languages that have text starting on the right, rather than the left.
...which is why in grid layout we use the keyword start when aligning something to the start of the container.
... for me, working in english, start may well be on the left, however it doesn’t have to be, and the word start infers no physical location.
...And 12 more matches
Linear-gradient Generator - CSS: Cascading Style Sheets
entlistener('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; 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); }); var slideend = function slideend(e) { document.removeeventlistener("mousemove", slidermotion); document.body.style.cursor = "auto"; slider.style.cursor = "pointer"; }; var slidermotion = function slidermotion(e) { slider.style.cursor = "e-resize"; var delta = (e.clientx - startx) / obj.sensivity | 0; var value = delta * obj.step + start_value; setvalue(obj.topic, value); }; return slider; }; var inputslider = function(node) { var min = parsefloat(node.getattribute('data-min')); var max = parsefloat(node.getattribute('data-max')); var step = parsefloat(node.getattribute('data-step')); var value = parsefloat(node.getattribute('data-value')); var topic = node.getattribute('data-topic'...
...p : getstep, setvalue : setvalue, subscribe : subscribe, unsubscribe : unsubscribe, setprecision : setprecision, setsensivity : setsensivity, getprecision : getprecision, createslider : createslider, }; })(); /** * ui-slidersmanager */ var slidermanager = (function slidermanager() { 'use strict'; var subscribers = {}; var sliders = []; function trackmouse(elem, callback, startfunc, endfunc) { startfunc = startfunc || function(e) {}; endfunc = endfunc || function(e) {}; elem.addeventlistener('mousedown', function(e) { e.preventdefault(); startfunc(e); document.addeventlistener('mousemove', callback); document.addeventlistener('mouseup', function up(e) { document.removeeventlistener('mousemove', callback); document.removeeventlistener('mouseup...
...And 12 more matches
justify-self - CSS: Cascading Style Sheets
ayout) in flexbox layouts, this property is ignored (more about alignment in flexbox) in grid layouts, it aligns an item inside its grid area on the inline axis (more about alignment in grid layouts) syntax /* basic keywords */ justify-self: auto; justify-self: normal; justify-self: stretch; /* positional alignment */ justify-self: center; /* pack item around the center */ justify-self: start; /* pack item from the start */ justify-self: end; /* pack item from the end */ justify-self: flex-start; /* equivalent to 'start'.
...*/ justify-self: self-start; justify-self: self-end; justify-self: left; /* pack item from the left */ justify-self: right; /* pack item from the right */ /* baseline alignment */ justify-self: baseline; justify-self: first baseline; justify-self: last baseline; /* overflow alignment (for positional alignment only) */ justify-self: safe center; justify-self: unsafe center; /* global values */ justify-self: inherit; justify-self: initial; justify-self: unset; this property can take one of three different forms: basic keywords: one of the keyword values normal, auto, or stretch.
... positional alignment: one of: center, start, end, flex-start, flex-end, self-start, self-end, left, or right.
...And 12 more matches
Monitoring downloads - Archive of obsolete content
the result is a window you can open by choosing "download log" in the tools menu, which lists all downloads that have been started since you installed the extension.
... in the list is the name of the file, the start and end times of the download, the download speed, and the status of the download.
... dbconn.executesimplesql("create table items (source text, size integer," + " starttime integer, endtime integer," + " speed real, status integer)"); dbconn.close(); }, this is fairly simple stuff.
...And 11 more matches
Venkman Introduction - Archive of obsolete content
starting the debugger the javascript debugger is automatically pre-installed in mozilla 1.x but must be installed separately in firefox and other gecko-based products, such as thunderbird and netscape 7.x.
...when the download is complete, restart your browser (some windows users may also need to restart their computer as well).
... you can then access the debugger via a new, dynamically created menuitem in the tools menu of that browser, or else restart the browser with a special debugger option.
...And 11 more matches
nsIWebProgressListener
for any given request, onstatechange() is called once with the state_start flag, zero or more times with the state_transferring flag or once with the state_redirecting flag, and then finally once with the state_stop flag.
... constant value description state_start 0x00000001 this flag indicates the start of a request.
...expect a corresponding state_start event for the new request, and a state_stop for the redirected request.
...And 11 more matches
Using the Screen Capture API - Web APIs
starting screen capture: async/await style async function startcapture(displaymediaoptions) { let capturestream = null; try { capturestream = await navigator.mediadevices.getdisplaymedia(displaymediaoptions); } catch(err) { console.error("error: " + err); } return capturestream; } you can write this code either using an asynchronous function and the await operator, as shown above, ...
... starting screen capture: promise style function startcapture(displaymediaoptions) { let capturestream = null; return navigator.mediadevices.getdisplaymedia(displaymediaoptions) .catch(err => { console.error("error:" + err); return null; }); } either way, the user agent responds by presenting a user interface that prompts the user to choose the screen area to share.
... both of these implementations of startcapture() return the mediastream containing the captured display imagery.
...And 11 more matches
Basic concepts of flexbox - CSS: Cascading Style Sheets
understanding which axis is which is important when we start to look at aligning and justifying flex items; flexbox features properties that align and justify content along one axis or the other.
... start and end lines another vital area of understanding is how flexbox makes no assumption about the writing mode of the document.
...modern layout methods encompass the range of writing modes and so we no longer assume that a line of text will start at the top left of a document and run towards the right hand side, with new lines appearing one under the other.
...And 11 more matches
justify-content - CSS: Cascading Style Sheets
syntax /* positional alignment */ justify-content: center; /* pack items around the center */ justify-content: start; /* pack items from the start */ justify-content: end; /* pack items from the end */ justify-content: flex-start; /* pack flex items from the start */ justify-content: flex-end; /* pack flex items from the end */ justify-content: left; /* pack items from the left */ justify-content: right; /* pack items from the right */ /* baseline alignment */ /* justify-content does n...
...ot take baseline values */ /* normal alignment */ justify-content: normal; /* distributed alignment */ justify-content: space-between; /* distribute items evenly the first item is flush with the start, the last is flush with the end */ justify-content: space-around; /* distribute items evenly items have a half-size space on either end */ justify-content: space-evenly; /* distribute items evenly items have equal space around them */ justify-content: stretch; /* distribute items evenly stretch 'auto'-sized items to fit the container */ /* overfl...
...ow alignment */ justify-content: safe center; justify-content: unsafe center; /* global values */ justify-content: inherit; justify-content: initial; justify-content: unset; values start the items are packed flush to each other toward the start edge of the alignment container in the main axis.
...And 11 more matches
justify-items - CSS: Cascading Style Sheets
flexbox layouts, this property is ignored (more about alignment in flexbox) in grid layouts, it aligns the items inside their grid areas on the inline axis (more about alignment in grid layouts) syntax /* basic keywords */ justify-items: auto; justify-items: normal; justify-items: stretch; /* positional alignment */ justify-items: center; /* pack items around the center */ justify-items: start; /* pack items from the start */ justify-items: end; /* pack items from the end */ justify-items: flex-start; /* equivalent to 'start'.
...*/ justify-items: self-start; justify-items: self-end; justify-items: left; /* pack items from the left */ justify-items: right; /* pack items from the right */ /* baseline alignment */ justify-items: baseline; justify-items: first baseline; justify-items: last baseline; /* overflow alignment (for positional alignment only) */ justify-items: safe center; justify-items: unsafe center; /* legacy alignment */ justify-items: legacy right; justify-items: legacy left; justify-items: legacy center; /* global values */ justify-items: inherit; justify-items: initial; justify-items: unset; this property can take one of four d...
... positional alignment: one of: center, start, end, flex-start, flex-end, self-start, self-end, left, or right.
...And 11 more matches
Autoplay guide for media and Web Audio APIs - Web media technologies
automatically starting the playback of audio (or videos with audio tracks) immediately upon page load can be an unwelcome surprise to users.
...this includes both the use of html attributes to autoplay media as well as the user of javascript code to start playback outside the context of handling user input.
...eans that both of the following are considered autoplay behavior, and are therefore subject to the browser's autoplay blocking policy: <audio src="/music.mp4" autoplay> and audioelement.play(); the following web features and apis may be affected by autoplay blocking: the html <audio> and <video> elements the web audio api from the user's perspective, a web page or app that spontaneously starts making noise without warning can be jarring, inconvenient, or off-putting.
...And 11 more matches
Populating the page: how browsers work - Web Performance
tcp's three way handshaking technique is often referred to as "syn-syn-ack"—or more accurately syn, syn-ack, ack—because there are three messages transmitted by tcp to negotiate and start a tcp session between two computers.
... tcp slow start / 14kb rule the first response packet will be 14kb.
... this is part of tcp slow start, an algorithm which balances the speed of a network connection.
...And 11 more matches
Index - Archive of obsolete content
ArchiveMozillaXULIndex
434 how to quit a xul application xul, xulrunner script can attempt to quit a xul application, or force the application to quit, using the nsiappstartup interface.
... 584 startediting xul methods, xul reference no summary!
... 585 startfind no summary!
...And 10 more matches
Additional Navigation - Archive of obsolete content
here is an example triple that we could use in the photos example: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="canal"/> </query> this new triple has a static value for the object attribute instead of a variable reference.
...to look closer, here is the data network after only the member has been evaluated: (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/palace.jpg) (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/canal.jpg) (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/obselisk.jpg) when evaluating the triple, the template builder will iterate over the three potential results found so far.
...the resulting data will look like the following: (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/canal.jpg) here is the example.
...And 10 more matches
Result Generation - Archive of obsolete content
and also because it is a graph, there is no real starting point or root node so you can just start anywhere.
...to navigate around, you could start at node a and navigate around the graph following the arrows to b, c or d.
... or you could start at b and go to a and then go to c and d, etc.
...And 10 more matches
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
you can also use this page to learn about extensions, and as a starting point if you plan to write a more complex extension.
...use other tutorials and articles to find out more—the main extensions page here is a good starting point.
... delete these two files: chrome.rdf overlays.rdf explanation: seamonkey automatically rebuilds these files the next time it starts.
...And 10 more matches
HTML text fundamentals - Learn web development
prerequisites: basic html familiarity, as covered in getting started with html.
... to answer this question, let's take a look at text-start.html—the starting point of our running example for this article (a nice hummus recipe).
...istener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the use...
...And 10 more matches
Looping code - Learn web development
he might use the following loop to achieve this: a loop usually has one or more of the following features: a counter, which is initialized with a certain value — this is the starting point of the loop ("start: i have no food", above).
... the standard for loop let's start exploring some specific loop constructs.
...here: the counter variable (sometimes known as an initializer or an iteration variable), i, starts at 0 (let i = 0).
...And 10 more matches
Object building practice - Learn web development
previous overview: objects next in previous articles we looked at all the essential javascript object theory and syntax details, giving you a solid base to start from.
... getting started to begin with, make local copies of our index.html, style.css, and main.js files.
... the first part of the script looks like so: const canvas = document.queryselector('canvas'); const ctx = canvas.getcontext('2d'); const width = canvas.width = window.innerwidth; const height = canvas.height = window.innerheight; this script gets a reference to the <canvas> element, then calls the getcontext() method on it to give us a context on which we can start to draw.
...And 10 more matches
Gecko info for Windows accessibility vendors
firefox (please use version 1.1 alpha builds or later) thunderbird (please use version 1.1 alpha builds or later) mozilla seamonkey (please use 1.8 alpha builds or later) how to find the content window and load the document screen readers need to find the content window so that they know where to start grabbing the msaa tree, in order to load the current document into a buffer in their own process.
...s: mozillauiwindowclass - root ui window, at the root of the window hierarchy mozillacontentwindowclass -- root document window mozillacontentframewindowclass - root of a subdocument created by a <frame> or <iframe> element mozillahiddenwindowclass - ignore these windows, they are used to help manage other windows mozillawindowclass - general filler window, a catch all starting in firefox 2, however, you should begin switching your code to use navrelation_embeds.
... event_scrollingstart is fired when the user has jumped to a named anchor within the page.
...And 10 more matches
DeferredTask.jsm
method overview bool ispending();obsolete since gecko 28 void start();obsolete since gecko 28 void flush();obsolete since gecko 28 void cancel();obsolete since gecko 28 void arm(); void disarm(); promise finalize(); attributes isarmed boolean indicates whether the task is currently requested to start again later, regardless of whether it is currently running.
... start obsolete since gecko 28 start (or postpone) task.
... void start(); flush obsolete since gecko 28 perform any postponed task immediately.
...And 10 more matches
Application Translation with Mercurial
by pressing the windows key and r on the keyboard or by calling the "run..." command from the windows "start" button, and then typing cmd and pressing the enter key.
...c:\mozilla\coding\buildtools\mozillabuild\start-shell-msvc2010.bat you can autocomplete the file path after typing a few characters and then pressing the tabulator key.
... if you launch the start-shell-l10n.bat, compiling features will be disabled.
...And 10 more matches
XPCOM changes in Gecko 2.0
starting in gecko 2, however, components are registered using manifest files, similarly to how chrome is registered.
...note: binary xpcom components must be recompiled for every new major release of firefox starting with firefox 4.
...category registration prior to gecko 2, extensions could listen for the xpcom-startup and app-startup notifications during startup, and perform actions during those.
...And 10 more matches
nsDependentString
methods constructors void nsdependentstring(const prunichar*, const prunichar*) - source constructors parameters prunichar* start prunichar* end void nsdependentstring(const prunichar*, pruint32) - source parameters prunichar* data pruint32 length void nsdependentstring(const prunichar*) - source parameters prunichar* data void nsdependentstring(const nsastring_internal&) - source parameters nsastring_internal& str void nsdependentstring() - source assertvalid void assertvalid() - source verify...
...parameters prunichar* data void rebind(const prunichar*, pruint32) - source parameters prunichar* data pruint32 length void rebind(const prunichar*, const prunichar*) - source parameters prunichar* start prunichar* end operator= nsstring& operator=(const nsstring&) - source parameters nsstring& str nsastring_internal& operator=(prunichar) - source parameters prunichar c nsastring_internal& operator=(const prunichar*) - source parameters prunichar* data nsastring_internal& operator=(const nsastring_internal&) - source parameters nsastring_internal& str nsastring_internal& operator=(const nssubstringtuple&) - source parameters nss...
... @param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...And 10 more matches
nsIAccessibleEvent
event_menu_start 0x0018 0x0015 a menu item on the menu bar has been selected.
... event_menupopup_start 0x001a 0x0017 a pop-up menu has been displayed.
... event_capture_start 0x001c 0x0019 a window has received mouse capture.
...And 10 more matches
AbstractRange - Web APIs
a range is an object that indicates the start and end points of a section of content within the document.
...a collapsed range is one whose start position and end position are the same, resulting in a zero-character-long range.
... startcontainer read only the dom node in which the beginning of the range, as specified by the startoffset property, is located.
...And 10 more matches
CanvasRenderingContext2D - Web APIs
canvasrenderingcontext2d.clearrect() sets all pixels in the rectangle defined by starting point (x, y) and size (width, height) to transparent black, erasing any previously drawn content.
... canvasrenderingcontext2d.strokerect() paints a rectangle which has a starting point at (x, y) and has a w width and an h height onto the canvas, using the current stroke style.
... canvasrenderingcontext2d.linedashoffset specifies where to start a dash array on a line.
...And 10 more matches
WindowOrWorkerGlobalScope.setInterval() - Web APIs
<!doctype html> <html> <head> <meta charset="utf-8" /> <title>javascript typewriter - mdn example</title> <script> function typewriter (sselector, nrate) { function clean () { clearinterval(nintervid); btyping = false; bstart = true; ocurrent = null; asheets.length = nidx = 0; } function scroll (osheet, npos, beraseandstop) { if (!osheet.hasownproperty('parts') || amap.length < npos) { return true; } var orel, bexit = false; if (amap.length === npos) { amap.push(0); } while (amap[npos] < osheet.parts.length) { orel = osheet.parts[amap[npos]]; scroll(orel, npos + 1, berasean...
...); } function sheet (onode) { this.ref = onode; if (!onode.haschildnodes()) { return; } this.parts = array.prototype.slice.call(onode.childnodes); for (var nchild = 0; nchild < this.parts.length; nchild++) { onode.removechild(this.parts[nchild]); this.parts[nchild] = new sheet(this.parts[nchild]); } } var nintervid, ocurrent = null, btyping = false, bstart = true, nidx = 0, spart = "", asheets = [], amap = []; this.rate = nrate || 100; this.play = function () { if (btyping) { return; } if (bstart) { var aitems = document.queryselectorall(sselector); if (aitems.length === 0) { return; } for (var nitem = 0; nitem < aitems.length; nitem++) { asheets.push(new sheet(aitems[nitem])); /* uncomment the f...
...ollowing line if you have previously hidden your elements via css: */ // aitems[nitem].style.visibility = "visible"; } bstart = false; } nintervid = setinterval(typewrite, this.rate); btyping = true; }; this.pause = function () { clearinterval(nintervid); btyping = false; }; this.terminate = function () { ocurrent.nodevalue += spart; spart = ""; for (nidx; nidx < asheets.length; scroll(asheets[nidx++], 0, false)); clean(); }; } /* usage: */ var otwexample1 = new typewriter(/* elements: */ '#article, h1, #info, #copyleft', /* frame rate (optional): */ 15); /* default frame rate is 100: */ var otwexample2 = new typewriter('#controls'); /* you can also change the frame rate value modifying the "rate" property; for example: */...
...And 10 more matches
place-items - CSS: Cascading Style Sheets
constituent properties this property is a shorthand for the following css properties: align-items justify-items syntax /* keyword values */ place-items: auto center; place-items: normal start; /* positional alignment */ place-items: center normal; place-items: start auto; place-items: end normal; place-items: self-start auto; place-items: self-end normal; place-items: flex-start auto; place-items: flex-end normal; place-items: left auto; place-items: right normal; /* baseline alignment */ place-items: baseline normal; place-items: first baseline auto; place-items: last baseline norm...
... normal the effect of this keyword is dependent of the layout mode we are in: in block-level layouts, the keyword is a synonym of start.
... in absolutely-positioned layouts, the keyword behaved like start on replaced absolutely-positioned boxes, and as stretch on all other absolutely-positioned boxes.
...And 10 more matches
Performance fundamentals - Web Performance
an app's startup performance matters just as much as its runtime performance.
... startup performance application startup is punctuated by three user-perceived events, generally speaking: the first is the application first paint — the point at which sufficient application resources have been loaded to paint an initial frame the second is when the application becomes interactive — for example, users are able to tap a button and the application responds the final event is fu...
...ll load — for example when all the user's albums have been listed in a music player the key to fast startup is to keep two things in mind: upp is all that matters, and there's a "critical path" to each user-perceived event above.
...And 10 more matches
d - SVG: Scalable Vector Graphics
WebSVGAttributed
absolute coordinates --> <path fill="none" stroke="red" d="m 10,10 l 90,90 v 10 h 50" /> <!-- lineto commands with relative coordinates --> <path fill="none" stroke="red" d="m 110,10 l 80,80 v -80 h -40" /> </svg> cubic bézier curve cubic bézier curves are smooth curve definitions using four points: starting point (current point) (po = {xo, yo}) end point (pn = {xn, yn}) start control point (pcs = {xcs, ycs}) (controls curvature near the start of the curve) end control point (pce = {xce, yce}) (controls curvature near the end of the curve) after drawing, the end point (pn) becomes the current point for the next command (po′).
...the start control point is specified by x1,y1 and the end control point is specified by x2,y2.
...the start control point is the current point (starting point of the curve) shifted by dx1 along the x-axis and dy1 along the y-axis.
...And 10 more matches
Useful string methods - Learn web development
previous overview: first steps next now that we've looked at the very basics of strings, let's move up a gear and start thinking about what useful operations we can do on strings with built-in methods, such as finding the length of a text string, joining and splitting strings, substituting one character in a string for another, and more.
... now, before your brain starts melting, don't worry!
... to retrieve the last character of any string, we could use the following line, combining this technique with the length property we looked at above: browsertype[browsertype.length-1]; the length of "mozilla" is 7, but because the count starts at 0, the character position is 6; using length-1 gets us the last character.
...And 9 more matches
Setting up your own test automation environment - Learn web development
we will cover writing and running selenium tests using node.js, as it is quick and easy to get started, and a more familiar environment for front end devs.
... setting up selenium in node to start with, set up a new npm project, as discussed in setting up node and npm in the last chapter.
... paste the following into the bottom of your file (updating the path as it actually is on your machine): #add webdriver browser drivers to path export path=$path:/users/bob save and close this file, then restart your terminal/command prompt to reapply your bash configuration.
...And 9 more matches
HTTP logging
using about:networking this is available starting with firefox 52.
... click on start logging.
... logging http activity by manually setting environment variables sometimes the about:networking approach won't work, for instance if your bug occurs during startup, or you're running on mobile, etc.
...And 9 more matches
Localizing with Koala
restart komodo when the installation is complete.
... you should see a new button in komodo's toolbar, with two options: startpage and management.
...if you're starting a new localization, you may not have a remote repository set up yet.
...And 9 more matches
nsIDOMWindowUtils
sendsimplegestureevent(in astring atype, in float ax, in float ay, in unsigned long adirection, in double adelta, in long amodifiers); void sendtextevent(in astring acompositionstring, in long afirstclauselength, in unsigned long afirstclauseattr, in long asecondclauselength, in unsigned long asecondclauseattr, in long athirdclauselength, in unsigned long athirdclauseattr, in long acaretstart, in long acaretlength); obsolete since gecko 26 boolean sendtouchevent(in astring atype, [array, size_is(count)] in pruint32 aidentifiers, [array, size_is(count)] in print32 axs, [array, size_is(count)] in print32 ays, [array, size_is(count)] in pruint32 arxs, [array, size_is(count)] in pruint32 arys, [array, size_is(count)] in float arotationangles, [array, size_is(count)] in float afor...
...ces, in pruint32 count, in long amodifiers, [optional] in boolean aignorerootscrollframe); void setcssviewport(in float awidthpx, in float aheightpx); void setdisplayport(in float axpx, in float aypx, in float awidthpx, in float aheightpx); void setresolution(in float axresolution, in float ayresolution); void startpccountprofiling(); void stoppccountprofiling(); void suppresseventhandling(in boolean asuppress); void suspendtimeouts(); nsidomfile wrapdomfile(nsifile afile); attributes attribute type description currentinnerwindowid unsigned long long the id of the window's current inner window.
... void sendcompositionevent( in astring atype, ); obsolete since gecko 9 parameters atype the event type: "compositionstart" or "compositionend".
...And 9 more matches
nsIHttpChannel
exceptions thrown ns_error_not_available if called before the response has been received (before onstartrequest()).
... exceptions thrown ns_error_not_available if called before the response has been received (before onstartrequest()).
... exceptions thrown ns_error_not_available if called before the response has been received (before onstartrequest()).
...And 9 more matches
nsITextInputProcessor
nverted_clause); tip.appendclausetopendingcomposition("bar".length, tip.attr_selected_clause); tip.appendclausetopendingcomposition("-buzz".length, tip.attr_converted_clause); // then, sets the caret if you need tip.setcaretinpendingcomposition("foo-bar".length); // finally, flush the pending composition on the focused editor if (!tip.flushpendingcomposition()) { return; // composition is not started } if there is no composition, flushpendingcomposition() starts composition with dispatching compositionstart event automatically.
...var dodefault = tip.keydown(keyevent); when you dispatch keyup event, just do this: var keyevent = new keyboardevent("", { key: "a", code: "keya", keycode: keyboardevent.dom_vk_a }); var dodefault = tip.keyup(keyevent); startcomposition(), flushpendingcomposition(), commitcomposition(), commitcompositionwith(), and cancelcomposition() can take a keyboardevent which causes modifying the composition state.
... in nsidomkeyevent adomkeyevent, [optional] in unsigned long akeyflags); boolean keyup([optional] in nsidomkeyevent adomkeyevent, [optional] in unsigned long akeyflags); void setcaretinpendingcomposition(in unsigned long aoffset); void setpendingcompositionstring(in domstring astring); void sharemodifierstateof(in nsitextinputprocessor aother); boolean startcomposition([optional] in nsidomkeyevent adomkeyevent, [optional] in unsigned long akeyflags); attributes attribute type description hascomposition boolean whether the instance has composition or not.
...And 9 more matches
Plug-in Basics - Plugins
a helper application is a separate, free-standing application that can be started from the browser.
... like a plug-in, the browser starts a helper application when the browser encounters a mime type that is mapped to it.
... when gecko starts, it looks for plugin modules in particular places on the system.
...And 9 more matches
Drag Operations - Web APIs
add a listener for the dragstart event.
... <p draggable="true" ondragstart="event.datatransfer.setdata('text/plain', 'this text may be dragged')"> this text <strong>may</strong> be dragged.
... starting a drag operation in this example, a listener is added for the dragstart event by using the ondragstart attribute.
...And 9 more matches
PerformanceResourceTiming - Web APIs
the interface's properties create a resource loading timeline with high-resolution timestamps for network events such as redirect start and end times, fetch start, dns lookup start and end times, response start and end times, etc..
... performanceentry.starttimeread only returns the timestamp for the time a resource fetch started.
... this value is equivalent to performanceentry.fetchstart.
...And 9 more matches
RTCRemoteOutboundRtpStreamStats.localId - Web APIs
example in this example, we have a pair of functions: the first, networkteststart(), captures an initial report, and the second, networkteststop(), captures a second report, then uses the two reports to output some information about the network conditions...
... networkteststart() this function simply calls the rtcpeerconnection method getstats() to request an rtcstatsreport and store it in the variable startreport.
... let startreport; async function networkteststart(pc) { if (pc) { startreport = await pc.getstats(); } } given an rtcpeerconnection, pc, this calls its getstats() method to obtain a statistics report object, which it stores in startreport for use once the end-of-test data has been collected by networkteststop().
...And 9 more matches
Using Touch Events - Web APIs
a multi-touch interaction starts when a finger (or stylus) first touches the contact surface.
...during this interaction, an application receives touch events during the start, move, and end phases.
... interfaces touch events consist of three interfaces (touch, touchevent and touchlist) and the following event types: touchstart - fired when a touch point is placed on the touch surface.
...And 9 more matches
Taking still photos with WebRTC - Web APIs
<div class="camera"> <video id="video">video stream not available.</video> <button id="startbutton">take photo</button> </div> this is straightforward, and we'll see how it ties together when we get into the javascript code.
... initialization we start by wrapping the whole script in an anonymous function to avoid global variables, then setting up various variables we'll be using.
... (function() { var width = 320; // we will scale the photo width to this var height = 0; // this will be computed based on the input stream var streaming = false; var video = null; var canvas = null; var photo = null; var startbutton = null; those variables are: width whatever size the incoming video is, we're going to scale the resulting image to be 320 pixels wide.
...And 9 more matches
align-content - CSS: Cascading Style Sheets
syntax /* basic positional alignment */ /* align-content does not take left and right values */ align-content: center; /* pack items around the center */ align-content: start; /* pack items from the start */ align-content: end; /* pack items from the end */ align-content: flex-start; /* pack flex items from the start */ align-content: flex-end; /* pack flex items from the end */ /* normal alignment */ align-content: normal; /* baseline alignment */ align-content: baseline; align-content: first baseline; align-content: last baseline; /* distributed ali...
...gnment */ align-content: space-between; /* distribute items evenly the first item is flush with the start, the last is flush with the end */ align-content: space-around; /* distribute items evenly items have a half-size space on either end */ align-content: space-evenly; /* distribute items evenly items have equal space around them */ align-content: stretch; /* distribute items evenly stretch 'auto'-sized items to fit the container */ /* overflow alignment */ align-content: safe center; align-content: unsafe center; /* global values */ align-content: inherit...
...; align-content: initial; align-content: unset; values start the items are packed flush to each other against the start edge of the alignment container in the cross axis.
...And 9 more matches
Drag and Drop - Archive of obsolete content
a user can start dragging by holding down the mouse button and moving the mouse.
...event handlers are called when the user starts and ends dragging, and at various points in-between.
...when a user requests to drag something that can be dragged, a drag session should be started.
...And 8 more matches
Third-party APIs - Learn web development
this typically involves first linking to a javascript library available on the server via a <script> element, as seen in our mapquest example: <script src="https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest.js"></script> <link type="text/css" rel="stylesheet" href="https://api.mqcdn.com/sdk/mapquest-js/v1.3.2/mapquest.css"/> you can then start using the objects available in that library.
...when the developer has registered for a key, they are then known to the api provider, and action can be taken if they start to do anything malicious with the api (such as tracking people's location or trying to spam the api with loads of requests to stop it working, for example).
... to start this section, make yourself a copy of the mapquest starter file, in a new directory.
...And 8 more matches
Handling common accessibility problems - Learn web development
i think it is more interesting than the last one.</p> in addition, your content should make logical sense in its source order — you can always place it where you want using css later on, but you should get the source order right to start with.
... chrome: install the web developer toolbar extension, then restart the browser.
... you can try this out using our native-keyboard-accessibility.html example (see the source code) — open this in a new tab, and try pressing the tab key; after a few presses, you should see the tab focus start to move through the different focusable elements; the focused elements are given a highlighted default style in every browser (it differs slightly between different browsers) so that you can tell what element is focused.
...And 8 more matches
Multiple Firefox profiles
windows windows xp click the start button.
... windows vista/7 click the start button.
...close all instances of firefox, or restart the computer, and then try again.
...And 8 more matches
HTML parser threading
the nsistreamlistener methods (onstartrequest, ondataavailable and onstoprequest) are called on the main thread.
... onstartrequest does all sorts of initialization on the main thread.
...preparing the parser thread for script execution when the parser thread sees that it has generated a tree op that attempts to execute a (non-async, non-defer) script, it starts speculating.
...And 8 more matches
Localizing without a specialized tool
from the create a new localization document, an interested localizer can follow a technical step-by-step process that starts the localization process by focusing on how to localize two of the primary types of localization files (dtd and properties) used in the mozilla source code.
...before we start, did you make sure to install mercurial and confirm that you have set up the proper build environment on your local machine?
...you are now ready to start translating!
...And 8 more matches
NS_ConvertASCIItoUTF16
@param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
... source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@param acount tells us how many iterations to make starting at the given offset.
...And 8 more matches
NS_ConvertUTF16toUTF8
@param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...meters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@param acount tells us how many iterations to make starting at the given offset.
...And 8 more matches
NS_ConvertUTF8toUTF16
@param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
... source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@param acount tells us how many iterations to make starting at the given offset.
...And 8 more matches
NS_LossyConvertUTF16toASCII
@param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...meters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@param acount tells us how many iterations to make starting at the given offset.
...And 8 more matches
nsAdoptingCString
@param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...meters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@param acount tells us how many iterations to make starting at the given offset.
...And 8 more matches
nsAdoptingString
@param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
... source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@param acount tells us how many iterations to make starting at the given offset.
...And 8 more matches
nsAutoString
@param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
... source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@param acount tells us how many iterations to make starting at the given offset.
...And 8 more matches
nsCAutoString
@param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...r* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@param acount tells us how many iterations to make starting at the given offset.
...And 8 more matches
nsCString
@param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...meters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@param acount tells us how many iterations to make starting at the given offset.
...And 8 more matches
nsFixedCString
@param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...meters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@param acount tells us how many iterations to make starting at the given offset.
...And 8 more matches
nsFixedString
@param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
... source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@param acount tells us how many iterations to make starting at the given offset.
...And 8 more matches
nsPromiseFlatCString
@param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...meters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@param acount tells us how many iterations to make starting at the given offset.
...And 8 more matches
nsPromiseFlatString
@param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
... source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@param acount tells us how many iterations to make starting at the given offset.
...And 8 more matches
nsString
@param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
... source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@param acount tells us how many iterations to make starting at the given offset.
...And 8 more matches
nsXPIDLCString
@param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
...meters char* astring prbool aignorecase print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@param acount tells us how many iterations to make starting at the given offset.
...And 8 more matches
nsXPIDLString
@param astring is substring to be sought in this @param aignorecase selects case sensitivity @param aoffset tells us where in this string to start searching @param acount tells us how far from the offset we are to search.
... source parameters prunichar* astring print32 aoffset print32 acount rfind print32 rfind(const nscstring&, prbool, print32, print32) const - source this methods scans the string backwards, looking for the given string @param astring is substring to be sought in this @param aignorecase tells us whether or not to do caseless compare @param aoffset tells us where in this string to start searching.
...@param acount tells us how many iterations to make starting at the given offset.
...And 8 more matches
IAccessibleEditableText
the substrings used with this interface are specified as follows: if startoffset is less than endoffset, the substring starts with the character at startoffset and ends with the character just before endoffset.
... if endoffset is lower than startoffset, the result is the same as a call with the two arguments exchanged.
...method overview hresult copytext([in] long startoffset, [in] long endoffset ); hresult cuttext([in] long startoffset, [in] long endoffset ); hresult deletetext([in] long startoffset, [in] long endoffset ); hresult inserttext([in] long offset, [in] bstr text ); hresult pastetext([in] long offset ); hresult replacetext([in] long startoffset, [in] long endoffset, [in] bstr text ); hresult setattributes([in] long startoffset, [in] long ...
...And 8 more matches
about:debugging (before Firefox 68) - Firefox Developer Tools
at the moment it supports three main sorts of targets: restartless add-ons, tabs, and workers.
... add-ons the add-ons section in about:debugging only supports restartless add-ons, including basic bootstrapped extensions, add-on sdk add-ons, and webextensions.
... this page enables you to do two things: load an add-on temporarily from disk connect 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).
...And 8 more matches
Background Tasks API - Web APIs
window.requestidlecallback = window.requestidlecallback || function(handler) { let starttime = date.now(); return settimeout(function() { handler({ didtimeout: false, timeremaining: function() { return math.max(0, 50.0 - (date.now() - starttime)); } }); }, 1); } if window.requestidlecallback is undefined, we create it here.
...</p> <div class="container"> <div class="label">decoding quantum filament tachyon emissions...</div> <progress id="progress" value="0"></progress> <div class="button" id="startbutton"> start </div> <div class="label counter"> task <span id="currenttasknumber">0</span> of <span id="totaltaskcount">0</span> </div> </div> <div class="logbox"> <div class="logheader"> log </div> <div id="log"> </div> </div> the progress box uses a <progress> element to show the progress, along with a label with sections that are changed to present numeric informat...
...in addition, there's a "start" button (creatively given the id "startbutton"), which the user will use to start the data processing.
...And 8 more matches
HTMLTextAreaElement - Web APIs
this is "forward" if selection was performed in the start-to-end direction of the current locale, or "backward" for the opposite direction.
...on being set, the control behaves as if setselectionrange() had been called with this as the second argument, and selectionstart as the first argument.
... selectionstart unsigned long: returns / sets the index of the beginning of selected text.
...And 8 more matches
Using Service Workers - Web APIs
this article provides information on getting started with service workers, including basic architecture, registering a service worker, the install and activation process for a new service worker, updating your service worker, cache control and custom responses, all in the context of a simple app with offline functionality.
...if however you find that demo code is not working in your installed versions, you might need to enable a pref: firefox nightly: go to about:config and set dom.serviceworkers.enabled to true; restart browser.
... chrome canary: go to chrome://flags and turn on experimental-web-platform-features; restart browser (note that some features are now enabled by default in chrome.) opera: go to opera://flags and enable support for serviceworker; restart browser.
...And 8 more matches
SpeechRecognition - Web APIs
speechrecognition.start() starts the speech recognition service listening to incoming audio with intent to recognize grammars associated with the current speechrecognition.
... audiostart fired when the user agent has started to capture audio.
... also available via the onaudiostart property.
...And 8 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
connecting to a remote peer the start() function shown here can be called by either of the two end-points that want to talk to one another.
... async function start() { try { const stream = await navigator.mediadevices.getusermedia(constraints); for (const track of stream.gettracks()) { pc.addtrack(track, stream); } selfvideo.srcobject = stream; } catch(err) { console.error(err); } } this isn't appreciably different from older webrtc connection establishment code.
... we add an unmute event handler to the track, because the track will become unmuted once it starts receiving packets.
...And 8 more matches
Controlling multiple parameters with ConstantSourceNode - Web APIs
<div class="controls"> <div class="left"> <div id="playbutton" class="button"> ▶️ </div> </div> <div class="right"> <span>volume: </span> <input type="range" min="0.0" max="1.0" step="0.01" value="0.8" name="volume" id="volumecontrol"> </div> </div> <p>use the button above to start and stop the tones, and the volume control to change the volume of the notes e and g in the chord.</p> css .controls { width: 400px; position: relative; vertical-align: middle; height: 44px; } .button { font-size: 32px; cursor: pointer; user-select: none; -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; -o-user-select: none; } .right { width: ...
... setting up let's start by looking at the global variable initialization.
...eategain(); gainnode1.gain.value = 0.5; gainnode2 = context.creategain(); gainnode3 = context.creategain(); gainnode2.gain.value = gainnode1.gain.value; gainnode3.gain.value = gainnode1.gain.value; volumecontrol.value = gainnode1.gain.value; constantnode = context.createconstantsource(); constantnode.connect(gainnode2.gain); constantnode.connect(gainnode3.gain); constantnode.start(); gainnode1.connect(context.destination); gainnode2.connect(context.destination); gainnode3.connect(context.destination); } window.addeventlistener("load", setup, false); first, we get access to the window's audiocontext, stashing the reference in context.
...And 8 more matches
Color picker tool - CSS: Cascading Style Sheets
entlistener('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; 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); }); var slideend = function slideend(e) { document.removeeventlistener("mousemove", slidermotion); document.body.style.cursor = "auto"; slider.style.cursor = "pointer"; }; var slidermotion = function slidermotion(e) { slider.style.cursor = "e-resize"; var delta = (e.clientx - startx) / obj.sensivity | 0; var value = delta * obj.step + start_value; setvalue(obj.topic, value); }; return slider; }; var inputslider = function(node) { var min = parsefloat(node.getattribute('data-min')); var max = parsefloat(node.getattribute('data-max')); var step = parsefloat(node.getattribute('data-step')); var value = parsefloat(node.getattribute('data-value')); var topic = node.getattribute('data-topic'...
...=== get dom element by id ==========*/ function getelembyid(id) { return document.getelementbyid(id); } function allowdropevent(e) { e.preventdefault(); } /*========== make an element resizable relative to it's parent ==========*/ var uicomponent = (function uicomponent() { function makeresizable(elem, axis) { var valuex = 0; var valuey = 0; var action = 0; var resizestart = function resizestart(e) { e.stoppropagation(); e.preventdefault(); if (e.button !== 0) return; valuex = e.clientx - elem.clientwidth; valuey = e.clienty - elem.clientheight; document.body.setattribute('data-resize', axis); document.addeventlistener('mousemove', mousemove); document.addeventlistener('mouseup', resizeend); }; var mousemove = function ...
...And 8 more matches
place-content - CSS: Cascading Style Sheets
constituent properties this property is a shorthand for the following css properties: align-content justify-content syntax /* positional alignment */ /* align-content does not take left and right values */ place-content: center start; place-content: start center; place-content: end left; place-content: flex-start center; place-content: flex-end center; /* baseline alignment */ /* justify-content does not take baseline values */ place-content: baseline center; place-content: first baseline space-evenly; place-content: last baseline right; /* distributed alignment */ place-content: space-between space-evenly; place-content: s...
... values start the items are packed flush to each other toward the start edge of the alignment container in the appropriate axis.
... flex-start the items are packed flush to each other toward the edge of the alignment container depending on the flex container's main-start or cross-start side.
...And 8 more matches
transition-timing-function - CSS: Cascading Style Sheets
syntax /* keyword values */ transition-timing-function: ease; transition-timing-function: ease-in; transition-timing-function: ease-out; transition-timing-function: ease-in-out; transition-timing-function: linear; transition-timing-function: step-start; transition-timing-function: step-end; /* function values */ transition-timing-function: steps(4, jump-end); transition-timing-function: cubic-bezier(0.1, 0.7, 1.0, 0.1); /* steps function keywords */ transition-timing-function: steps(4, jump-start); transition-timing-function: steps(10, jump-end); transition-timing-function: steps(20, jump-none); transition-timing-function: steps(5, jump-both)...
...; transition-timing-function: steps(6, start); transition-timing-function: steps(8, end); /* multiple timing functions */ transition-timing-function: ease, step-start, cubic-bezier(0.1, 0.7, 1.0, 0.1); /* global values */ transition-timing-function: inherit; transition-timing-function: initial; transition-timing-function: unset; values <timing-function> each <timing-function> represents the timing function to link to the corresponding property to transition, as defined in transition-property.
... ease-in equal to cubic-bezier(0.42, 0, 1.0, 1.0), starts off slowly, with the transition speed increasing until complete.
...And 8 more matches
<input type="email"> - HTML: Hypertext Markup Language
WebHTMLElementinputemail
for example, let's say you're building a page for employees of best startup ever, inc.
...t's see how: body { font: 16px sans-serif; } .emailbox { padding-bottom: 20px; } .messagebox { padding-bottom: 20px; } label { line-height: 22px; } label::after { content: ":"; } <form> <div class="emailbox"> <label for="emailaddress">your e-mail address</label><br> <input id="emailaddress" type="email" size="64" maxlength="64" required placeholder="username@beststartupever.com" pattern=".+@beststartupever.com" title="please provide only a best startup ever corporate e-mail address"> </div> <div class="messagebox"> <label for="message">request</label><br> <textarea id="message" cols="80" rows="8" required placeholder="my shoes are too tight, and i have forgotten how to dance."></textarea> </div> <input type="submit" value="se...
... an appropriate placeholder is provided—username@beststartupever.com—to demonstrate what constitutes a valid entry.
...And 8 more matches
Chapter 6: Firefox extensions and XUL applications - Archive of obsolete content
starting up select “javascript debugger” from the tools menu.
... fixme: figure 3: inserting a breakpoint start debugger type in some text into the quicknote screen, and then select save current tab from the menu.
... this should halt the program at the spot where you inserted the breakpoint with venkman, and start the debugger.
...And 7 more matches
Search Extension Tutorial (Draft) - Archive of obsolete content
the simplest, which works only for traditional, non-restartless add-ons, is to add the preference changes to a file in an extension's defaults/preferences/ directory.
...pref("browser.search.defaultenginename", "data:text/plain,browser.search.defaultenginename=example engine"); in the case or restartless extensions, the preferences need to be changed manually, and reverted when the extension is disabled if they have not been changed in the meantime.
... while changes to default preference values will not persist across sessions, restartless extensions must nevertheless restore them for the balance of the session after they have been disabled.
...And 7 more matches
Using the Editor from XUL - Archive of obsolete content
it does some getting of window.arguments (which is a way callers can pass parameters to new windows -- we use this to get the url to be loaded), then it calls editorstartup(), where the real work happens.
... the important stuff in editorstartup() begins where we get or create an editorshell.
...for command state maintenance, starting and stopping the throbber etc.).
...And 7 more matches
Handling different text directions - Learn web development
once you start to look at css layout, and in particular the newer layout methods, this idea of block and inline becomes very important.
...instead they will talk about start and end along with this idea of inline and block.
... don't worry too much about that right now, but keep these ideas in mind as you start to look at layout; you will find it really helpful in your understanding of css.
...And 7 more matches
Grids - Learn web development
this article will give you all you need to know to get started with page layout.
... the following video provides a nice visual explanation of using css grid: defining a grid as a starting point, download and open the starting point file in your text editor and browser (you can also see it live here).
...our grid always has lines, which lines start at 1 and relate to the writing mode of the document.
...And 7 more matches
How to build custom form controls - Learn web development
design, structure, and semantics before building a custom control, you should start by figuring out exactly what you want.
...to do this, it's good to start with an existing control whose states and behavior are well known, so that you can simply mimic those as much as possible.
...let's start by defining how the control reaches each state: the control is in its normal state when: the page loads.
...And 7 more matches
Aprender y obtener ayuda - Learn web development
this is the opposite of focus — you let your brain wander around the wider landscape, searching around for connections you didn't have before, touching on new things (or new combinations of things) that you can then focus on later, to strengthen them and start to really understand what they mean.
... interactive code playgrounds you might be the kind of person that prefers minimal instructions and would prefer to jump straight in and start playing with code.
... a goal statement it sounds silly, but why not start with a single sentence that says what you want to achieve?
...And 7 more matches
Working with Svelte stores - Learn web development
code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/06-stores or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/06-stores remember to run npm install && npm run dev to start your app in development mode.
... repl to code along with us using the repl, start at https://svelte.dev/repl/d1fa84a5a4494366b179c87395940039?version=3.23.2 dealing with our app state we have already seen how our components can communicate with each other using props, two-way data binding, and events.
... creating a store let's start by creating a writable store.
...And 7 more matches
Eclipse CDT
system requirements eclipse will use a lot of memory to fully index the mozilla source tree to provide code assistance features (easily 4 gb of ram, although this will drop to just over 1 gb if you restart after indexing is complete).
...rerun it (and then rebuild the index) once a week or so, or as necessary when you start to notice unusual code assistance issues that aren't fixed by rebuilding the index alone.
... to get a list of autocomplete options in an editor tab, start typing the name of an identifier and then type ctrl-space.
...And 7 more matches
Downloads.jsm
the downloads.jsm javascript code module provides a single entry point to interact with the downloading capabilities of the platform, including starting new downloads, controlling ongoing downloads, and retrieving download-related configuration.
...resource://gre/modules/downloads.jsm"); method overview promise<download> createdownload(object aproperties); promise<void> fetch(asource, atarget, [optional] object aoptions); promise<downloadlist> getlist(atype); promise<downloadsummary> getsummary(atype); constants constant description public work on downloads that were not started from a private browsing window.
... private work on downloads that were started from a private browsing window.
...And 7 more matches
NSS Sample Code Sample1
the primary host unwraps the key using the rsa key each time // access to the key is required, such as at server startup.
...// the secondary host may store the wrapped value that was received // from the primary in a file, and unwrap it each time the key is required // (such as at server startup).
...(the admin should verify this.) // // in this example, the server must be started to perform // this function (see start()) int exportkeys(secitem *pubkey, secitem **wrappedenckey, secitem **wrappedmackey); // import the keys received from another server in the // cluster.
...And 7 more matches
nsIDownloadManager
to get the service, use: var downloadmanager = components.classes["@mozilla.org/download-manager;1"] .getservice(components.interfaces.nsidownloadmanager); method overview nsidownload adddownload(in short adownloadtype, in nsiuri asource, in nsiuri atarget, in astring adisplayname, in nsimimeinfo amimeinfo, in prtime astarttime, in nsilocalfile atempfile, in nsicancelable acancelable, in boolean aisprivate); void addlistener(in nsidownloadprogresslistener alistener); void canceldownload(in unsigned long aid); void cleanup(); void endbatchupdate(); obsolete since gecko 1.9.1 void flush(); obsolete since gecko 1.8 nsidownload getdownload(in unsigned long aid); ...
...ed long aid); void removedownload(in unsigned long aid); void removedownloadsbytimeframe(in long long abegintime, in long long aendtime); void removelistener(in nsidownloadprogresslistener alistener); void resumedownload(in unsigned long aid); void retrydownload(in unsigned long aid); void savestate(); obsolete since gecko 1.8 void startbatchupdate(); obsolete since gecko 1.9.1 attributes attribute type description activedownloadcount long the number of files currently being downloaded.
... constants constant value description download_notstarted -1 the download has not been started yet.
...And 7 more matches
nsIResumableChannel
inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void asyncopenat(in nsistreamlistener listener, in nsisupports ctxt, in unsigned long startpos, in nsiresumableentityid entityid); obsolete since gecko 1.8 void resumeat(in unsigned long long startpos, in acstring entityid); attributes attribute type description entityid acstring the entity id for this uri.
... available after onstartrequest.
... methods asyncopenat() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) open this channel, and read starting at the specified offset.
...And 7 more matches
Applying styles and colors - Web APIs
linedashoffset = value specifies where to start a dash array on a line.
... note also that only start and final endpoints of a path are affected: if a path is closed with closepath(), there's no start and final endpoint; instead, all endpoints in the path are connected to their attached previous and next segment using the current setting of the linejoin style, whose default value is miter, with the effect of automatically extending the outer borders of the connected segments to their intersection...
...each of these lines starts and ends exactly on these guides.
...And 7 more matches
HTML Drag and Drop API - Web APIs
dragstart ondragstart …the user starts dragging an item.
... (see starting a drag operation.) drop ondrop …an item is dropped on a valid drop target.
... (see performing a drop.) note: neither dragstart nor dragend events are fired when dragging a file into the browser from the os.
...And 7 more matches
Key Values - Web APIs
moves to the start of content.
...historically, the escape character was used to signal the start of a special control sequence of characters called an "escape sequence." vk_escape (0x1b) kvk_escape (0x35) gdk_key_escape (0xff1b) qt::key_escape (0x01000000) keycode_escape (111) "execute" the execute key.
... common ime keys keyboardevent.key value description virtual keycode windows mac linux android "allcandidates" the all candidates key, which starts multi-candidate mode, in which multiple candidates are displayed for the ongoing input.
...And 7 more matches
Capabilities, constraints, and settings - Web APIs
this isn't always necessary, since any that aren't known will simply be ignored when you specify them—but if you have any that you can't get by without, you can start by checking to be sure they're on the list.
... below all of that, you'll see the video itself.</p> <p>click the "start" button to begin.</p> <h3>constrainable properties available:</h3> <ul id="supportedconstraints"> </ul> <div id="startbutton" class="button"> start </div> <div class="wrapper"> <div class="trackrow"> <div class="leftside"> <h3>requested video constraints:</h3> <textarea id="videoconstrainteditor" cols=32 rows=8></textarea> </div> <div class="rightside"> <h3>actu...
... function getcurrentsettings() { if (videotrack) { videosettingstext.value = json.stringify(videotrack.getsettings(), null, 2); } if (audiotrack) { audiosettingstext.value = json.stringify(audiotrack.getsettings(), null, 2); } } this gets called after the stream first starts up, as well as any time we've applied updated constraints, as you'll see below.
...And 7 more matches
Resource Timing API - Web APIs
the interface's properties create a resource loading timeline with high-resolution timestamps for network events such as redirect start and end times, dns lookup start and end times, request start, response start and end times, etc.
...the first property in the processing model is starttime which returns the timestamp immediately before the resource loading process begins.
... the fetchstart timestamps follows and redirect processing (if applicable) and preceeds dns lookup.
...And 7 more matches
Touch events - Web APIs
a multi-touch interaction starts when a finger (or stylus) first touches the contact surface.
...during this interaction, an application receives touch events during the start, move, and end phases.
...</canvas> <br> log: <pre id="log" style="border: 1px solid #ccc;"></pre> setting up the event handlers when the page loads, the startup() function shown below will be called.
...And 7 more matches
Basic Concepts of grid layout - CSS: Cascading Style Sheets
it all starts by creating a grid in your grid container.
... if we want to start making this more grid-like we need to add column tracks.
... in the following example i am placing the first two items on our three column track grid, using the grid-column-start, grid-column-end, grid-row-start and grid-row-end properties.
...And 7 more matches
align-items - CSS: Cascading Style Sheets
syntax /* basic keywords */ align-items: normal; align-items: stretch; /* positional alignment */ /* align-items does not take left and right values */ align-items: center; /* pack items around the center */ align-items: start; /* pack items from the start */ align-items: end; /* pack items from the end */ align-items: flex-start; /* pack flex items from the start */ align-items: flex-end; /* pack flex items from the end */ /* baseline alignment */ align-items: baseline; align-items: first baseline; align-items: last baseline; /* overflow alignment (for positional alignment only) */ align-items: safe center; align-ite...
...ms: unsafe center; /* global values */ align-items: inherit; align-items: initial; align-items: unset; values normal the effect of this keyword is dependent of the layout mode we are in: in absolutely-positioned layouts, the keyword behaves like start on replaced absolutely-positioned boxes, and as stretch on all other absolutely-positioned boxes.
... for grid items, this keyword leads to a behavior similar to the one of stretch, except for boxes with an aspect ratio or an intrinsic sizes where it behaves like start.
...And 7 more matches
animation-timing-function - CSS: Cascading Style Sheets
syntax /* keyword values */ animation-timing-function: ease; animation-timing-function: ease-in; animation-timing-function: ease-out; animation-timing-function: ease-in-out; animation-timing-function: linear; animation-timing-function: step-start; animation-timing-function: step-end; /* function values */ animation-timing-function: cubic-bezier(0.1, 0.7, 1.0, 0.1); animation-timing-function: steps(4, end); /* steps function keywords */ animation-timing-function: steps(4, jump-start); animation-timing-function: steps(10, jump-end); animation-timing-function: steps(20, jump-none); animation-timing-function: steps(5, jump-both); animation-...
...timing-function: steps(6, start); animation-timing-function: steps(8, end); /* multiple animations */ animation-timing-function: ease, step-start, cubic-bezier(0.1, 0.7, 1.0, 0.1); /* global values */ animation-timing-function: inherit; animation-timing-function: initial; animation-timing-function: unset; timing functions may be specified on individual keyframes in a @keyframes rule.
... ease-in equal to cubic-bezier(0.42, 0, 1.0, 1.0), starts off slowly, with the speed of the transition of the animating properting increasing until complete.
...And 7 more matches
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
border-block-start-color and border-block-end-color with these, you can set the color used to draw the borders which are closest to the start and end of the block the border surrounds.
... in a left-to-right writing mode (such as the way english is written), the block start border is the top edge and the block end is the bottom.
... this differs from the inline start and end, which are the left and right edges (corresponding to where each line of text in the box begins and ends).
...And 7 more matches
String.prototype.substr() - JavaScript
the substr() method returns a portion of the string, starting at the specified index and extending for a given number of characters afterwards.
... syntax str.substr(start[, length]) parameters start the index of the first character to include in the returned substring.
... description substr() extracts length characters from a str, counting from the start index.
...And 7 more matches
SVG documentation index - SVG: Scalable Vector Graphics
WebSVGIndex
16 svg event attributes advanced, attribute, draft, landing, needsupdate, svg event attributes always have their name starting with "on" followed by the name of the event for which they are intended.
...it defines the start and end points of a line of text as used by the text-anchor and inline-size properties.
... 130 marker-start svg, svg attribute the marker-start attribute defines the arrowhead or polymarker that will be drawn at the first vertex of the given shape.
...And 7 more matches
Adding preferences to an extension - Archive of obsolete content
startup() the stockwatcher.startup() function is called when our extension is first loaded.
... its job is to start up the observer to watch for changes to our preferences, instantiate an object to use to manage our preferences, and install an interval routine to update the stock information periodically.
... var stockwatcher = { prefs: null, tickersymbol: "", // initialize the extension startup: function() { // register to receive notifications of preference changes this.prefs = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice) .getbranch("extensions.stockwatcher2."); this.prefs.addobserver("", this, false); this.tickersymbol = this.prefs.getcharpref("symbol").touppercase(); this.refreshinformation(); window.setinterval(this.refreshinformation, 10*60*1000); } }, our object has two member variables.
...And 6 more matches
Repackaging Firefox - Archive of obsolete content
important legal considerations before you get started, it is very important to know and abide by the legal requirements for distributing firefox.
... getting started now, on to the technical details.
... the following diagram represents an overview of the process and the pieces involved: you will need the following to get started: a macintosh computer (even for repackaging windows or linux only); it may be either powerpc or intel based.
...And 6 more matches
Accessing Files - Archive of obsolete content
because string paths are not used, references to files in a file object are made relative to some starting directory.
... a number of starting directories may be used, for instance, the user's home directory, the desktop, the system's temporary folder, and so forth.
... once one of these starting directories is determined, a file reference may be created relative to this.
...And 6 more matches
RDF Modifications - Archive of obsolete content
when the rdf parser loads rdf/xml, it starts with a new empty datasource, and as the parser parses the input data, it calls the datasource's assert function to add each found triple.
...let's assume we have single query with as follows: <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/description" object="?description"/> </query> these query statements will cause any photos with both a title and a description to be...
...there is a container 'http://www.xulplanet.com/rdf/myphotos', so the ?start variable will be filled in with this value.
...And 6 more matches
Simple Example - Archive of obsolete content
this will be the starting point of the navigation.
... <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> </query> the seed is set in a similar manner as the previous examples, effectively creating a single result with the ?start variable set to the reference resource 'http://www.xulplanet.com/rdf/myphotos'.
... the same starting variable is used in this example, but you can of course use any variable you wish.
...And 6 more matches
Custom toolbar button - Archive of obsolete content
you can also use this page to learn about extensions, and as a starting point if you plan to write a more complex extension.
...use other tutorials and articles to find out more—the main extensions page here is a good starting point.
... testing your new button restart the application.
...And 6 more matches
Mobile touch controls - Game development
pure javascript approach we could implement touch events on our own — setting up event listeners and assigning relevant functions to them would be quite straightforward: var el = document.getelementsbytagname("canvas")[0]; el.addeventlistener("touchstart", handlestart); el.addeventlistener("touchmove", handlemove); el.addeventlistener("touchend", handleend); el.addeventlistener("touchcancel", handlecancel); this way, touching the game's <canvas> on the mobile screen would emit events, and thus we could manipulate the game in any way we want (for example, moving the space ship around).
... the events are as follows: touchstart is fired when the user puts a finger on the screen.
... we will use two events: touchstart and,touchmove both handled by one function.
...And 6 more matches
What is accessibility? - Learn web development
overview: accessibility next this article starts the module off with a good look at what accessibility is — this overview includes what groups of people we need to consider and why, what tools different people use to interact with the web, and how we can make accessibility part of our web development workflow.
...the key lesson here is to think beyond your own computer and how you use the web, and start learning about how others use it — you are not your users.
... you have only started to consider accessibility and uncovered related issues in the late stages of a project.
...And 6 more matches
Flexbox - Learn web development
to get started, you should make a local copy of the first starter file — flexbox0.html from our github repo — load it in a modern browser (like firefox or chrome), and have a look at the code in your code editor.
... specifying what elements to lay out as flexible boxes to start with, we need to select which elements are to be laid out as flexible boxes.
...as rows across the page, or columns down the page.) the start and end of this axis are called the main start and main end.
...And 6 more matches
Video and audio content - Learn web development
previous overview: multimedia and embedding next now that we are comfortable with adding simple images to a webpage, the next step is to start adding video and audio players to your html documents!
... prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, familiarity with html fundamentals (as covered in getting started with html) and images in html.
... video and audio on the web web developers have wanted to use video and audio on the web for a long time, ever since the early 2000s when we started to have bandwidth fast enough to support any kind of video (video files are much larger than text or even images.) in the early days, native web technologies such as html didn't have the ability to embed video and audio on the web, so proprietary (or plugin-based) technologies like flash (and later, silverlight) became popular for handling such content.
...And 6 more matches
Object-oriented JavaScript for beginners - Learn web development
object-oriented programming — the basics to start with, let's give you a simplistic, high-level view of what object-oriented programming (oop) is.
... to start this off, we could return to our person object type from our first objects article, which defines the generic data and functionality of a person.
...for example: in the rest of the article, we'll start to look at how oop theory can be put into practice in javascript.
...And 6 more matches
Introduction to client-side frameworks - Learn web development
overview: client-side javascript frameworks next we begin our look at frameworks with a general overview of the area, looking at a brief history of javascript and frameworks, why frameworks exist and what they give us, how to start thinking about choosing a framework to learn, and what alternatives there are to client-side frameworks.
... ember ember was initially released in december 2011 as a continuation of work that started in the sproutcore project.
... start learning ember angular angular is an open-source web application framework led by the angular team at google and by a community of individuals and corporations.
...And 6 more matches
React interactivity: Events and state - Learn web development
previous overview: client-side javascript frameworks next with our component plan worked out, it's now time to start updating our app from a completely static ui to one that actually allows us to interact and change things.
... objective: to learn about handling events and state in react, and use those to start making the case study app interactive.
... let's apply this to our app, starting in the form.js component.
...And 6 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
previous overview: client-side javascript frameworks next now that we have our markup and styles ready we can start developing the required features for our svelte to-do list app.
... code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/03-adding-dynamic-behavior or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/03-adding-dynamic-behavior remember to run npm install && npm run dev to start your app in development mode.
... repl to code along with us using the repl, start at https://svelte.dev/repl/c862d964d48d473ca63ab91709a0a5a0?version=3.23.2 working with todos our todos.svelte component is currently just displaying static markup; let's start making it a bit more dynamic.
...And 6 more matches
Strategies for carrying out testing - Learn web development
previous overview: cross browser testing next this article starts the module off by providing an overview of the topic of (cross) browser testing, answering questions such as "what is cross-browser testing?", "what are the most common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" prerequisites: familiarity with the core html, css, and javascript languages; an idea of the high level principles of cross-browser testing.
... when doing cross-browser testing, you need to work out a list of browsers you will need to test on to start with.
...your site should now be ready to start reporting analytics data.
...And 6 more matches
Gecko Profiler FAQ
it only knows what function was executed and what line this function starts at.
... how to profile startup code that regresses just a little (<10-15ms ts_paint/tpaint) [mstange] we currently don’t have a good way to do that.
...to stop the profiler from gathering more samples after the “startup end” marker that you’re interested in, you can call services.profiler.pause(); or you can insert a marker with a special string and then write a script that filters out all samples that were gathered after your marker.
...And 6 more matches
NSS functions
sl_optionsetdefault mxr 3.2 and later ssl_peercertificate mxr 3.2 and later ssl_preencryptedfiletostream mxr 3.2 and later ssl_preencryptedstreamtofile mxr 3.2 and later ssl_rehandshake mxr 3.2 and later ssl_rehandshakewithtimeout mxr 3.11.4 and later ssl_resethandshake mxr 3.2 and later ssl_restarthandshakeaftercertreq mxr 3.2 and later ssl_restarthandshakeafterservercert mxr 3.2 and later ssl_revealcert mxr 3.2 and later ssl_revealpinarg mxr 3.2 and later ssl_revealurl mxr 3.2 and later ssl_securitystatus mxr 3.2 and later ssl_setmaxservercachelocks mxr 3.4 and later ssl_setpkcs11pinarg...
...removecertlistnode mxr 3.6 and later cert_rfc1485_escapeandquote mxr 3.2 and later cert_savesmimeprofile mxr 3.2 and later cert_setsloptime mxr 3.2 and later cert_setocspfailuremode mxr 3.11.7 and later cert_setocsptimeout mxr 3.12 and later cert_setusepkixforvalidation mxr 3.12 and later cert_startcertextensions mxr 3.5 and later cert_startcertificaterequestattributes mxr 3.10 and later cert_startcrlentryextensions mxr 3.10 and later cert_startcrlextensions mxr 3.10 and later cert_uncachecrl mxr 3.10 and later cert_verifycertname mxr 3.2 and later cert_verifycacertforusage mxr 3.6 and later ...
... sec_asn1decoderclearfilterproc mxr 3.2 and later sec_asn1decoderclearnotifyproc mxr 3.2 and later sec_asn1decoderfinish mxr 3.2 and later sec_asn1decodersetfilterproc mxr 3.2 and later sec_asn1decodersetnotifyproc mxr 3.2 and later sec_asn1decoderstart mxr 3.2 and later sec_asn1decoderupdate mxr 3.2 and later sec_asn1encode mxr 3.2 and later sec_asn1encodeinteger mxr 3.2 and later sec_asn1encodeitem mxr 3.2 and later sec_asn1encoderabort mxr 3.9 and later sec_asn1encoderclearnoti...
...And 6 more matches
imgIDecoderObserver
void ondiscard(in imgirequest arequest); void onimageisanimated(in imgirequest arequest); void onstartcontainer(in imgirequest arequest, in imgicontainer acontainer); void onstartdecode(in imgirequest arequest); void onstartframe(in imgirequest arequest, in unsigned long aframe); void onstartrequest(in imgirequest arequest); void onstopcontainer(in imgirequest arequest, in imgicontainer acontainer); void onstopdecode(in imgirequest arequest, in nsresul...
... onstartcontainer() this load notification is called once enough data has been loaded from the network that we were able to parse the width and height from the image.
...void onstartcontainer( in imgirequest arequest, in imgicontainer acontainer ); parameters arequest the request on which data is available, or null if being called for an imgidecoder object.
...And 6 more matches
nsIAppShellService
boolean createstartupstate(in long awindowwidth, in long awindowheight); obsolete since gecko 1.8 nsixulwindow createtoplevelwindow(in nsixulwindow aparent, in nsiuri aurl, in pruint32 achromemask, in long ainitialwidth, in long ainitialheight, in nsiappshell aappshell); nsiwebnav createwindowlessbrowser (in bool aischrome) void destroyhiddenwindow(); void doprofilestartup(in nsi...
... createstartupstate() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) creates the initial state of the application by launching tasks specfied by "general.startup.*" prefs.
... boolean createstartupstate( in long awindowwidth, in long awindowheight ); parameters awindowwidth the width to make the initial window(s) opened.
...And 6 more matches
Component; nsIPrefBranch
for example, if this object is created with the root "browser.startup.", the preferences "browser.startup.page", "browser.startup.homepage", and "browser.startup.homepage_override" can be accessed by simply passing "page", "homepage", or "homepage_override" to the various get/set methods.
... method overview void addobserver(in string adomain, in nsiobserver aobserver, in boolean aholdweak); void clearuserpref(in string aprefname); void deletebranch(in string astartingat); boolean getboolpref(in string aprefname, requires gecko 54 [optional] in boolean adefaultvalue); string getcharpref(in string aprefname,requires gecko 54 [optional] in string adefaultvalue); requires gecko 58 utf8tring getstringpref(in string aprefname, [optional] in utf8string adefaultvalue); void getchildlist(in string astartingat, [optional] out unsigned long acount, [array, size_is(acount), retval] out string achildarray); void getcomplexvalue(in string aprefname, in nsiidref atype, [iid_is(atype), retval] out nsqiresult avalue); ...
...g getintpref(in string aprefname,requires gecko 54 [optional] in long adefaultvalue); long getpreftype(in string aprefname); void lockpref(in string aprefname); boolean prefhasuservalue(in string aprefname); boolean prefislocked(in string aprefname); void removeobserver(in string adomain, in nsiobserver aobserver); void resetbranch(in string astartingat); void setboolpref(in string aprefname, in long avalue); void setcharpref(in string aprefname, in string avalue); requires gecko 58 void setstringpref(in string aprefname, in utf8string avalue); void setcomplexvalue(in string aprefname, in nsiidref atype, in nsisupports avalue); void setintpref(in string aprefname, in long avalue); void u...
...And 6 more matches
Network request list - Firefox Developer Tools
starting in firefox 76 you can double-click a column divider to resize the column to the left of it to fit its contents.
... (starting in firefox 80) on the right edge of the file column, a turtle icon appears if the server waiting time exceeds a threshhold (default: 500 ms).
...starting with firefox 68, the transferred column lists either "cached (raced)" or "[size] (raced)" depending on the faster source.
...And 6 more matches
Range - Web APIs
WebAPIRange
range.collapsed read only returns a boolean indicating whether the range's start and end points are at the same position.
... range.commonancestorcontainer read only returns the deepest node that contains the startcontainer and endcontainer nodes.
... range.startcontainer read only returns the node within which the range starts.
...And 6 more matches
Multi-touch interaction - Web APIs
example this example demonstrates using the touchstart, touchmove, touchcancel, and touchend) touch events for the following gestures: single touch, two (simultaneous) touches, more than two simultaneous touches, 1-finger swipe, and 2-finger move/pinch/swipe.
... function set_handlers(name) { // install event handlers for the given element var el=document.getelementbyid(name); el.ontouchstart = start_handler; el.ontouchmove = move_handler; // use same handler for touchcancel and touchend el.ontouchcancel = end_handler; el.ontouchend = end_handler; } function init() { set_handlers("target1"); set_handlers("target2"); set_handlers("target3"); set_handlers("target4"); } move/pinch/zoom handler this function provides very basic support for 2-touch horizontal move/pinch/zoom ha...
...function handle_pinch_zoom(ev) { if (ev.targettouches.length == 2 && ev.changedtouches.length == 2) { // check if the two target touches are the same ones that started // the 2-touch var point1=-1, point2=-1; for (var i=0; i < tpcache.length; i++) { if (tpcache[i].identifier == ev.targettouches[0].identifier) point1 = i; if (tpcache[i].identifier == ev.targettouches[1].identifier) point2 = i; } if (point1 >=0 && point2 >= 0) { // calculate the difference between the start and move coordinates var diff1 = math.abs(tpcache[poi...
...And 6 more matches
WebGLRenderingContext.makeXRCompatible() - Web APIs
this is useful if you have an application which can start out being presented on a standard 2d display but can then be transitioned to a 3d immersion system.
... examples this example demonstrates code logic you might find in a game that starts up using webgl to display menus and other ui, and uses webgl to render gameplay, but has a button on its main menu that offers an option to start the game in webxr mode.
... html the html for the buttons looks lke this: <button class="green button" type="button">start game</button> <button class="blue button use-webxr" type="button">start game (vr mode)</button> the first button starts the game, continuing to present the game onscreen as usual.
...And 6 more matches
Example and tutorial: Simple synth keyboard - Web APIs
it starts off empty, since there are none playing yet.
...this will be used by the handler for events triggering keys on the keyboard to start playing the appropriate notes.
... function playtone(freq) { let osc = audiocontext.createoscillator(); osc.connect(mastergainnode); let type = wavepicker.options[wavepicker.selectedindex].value; if (type == "custom") { osc.setperiodicwave(customwaveform); } else { osc.type = type; } osc.frequency.value = freq; osc.start(); return osc; } playtone() begins by creating a new oscillatornode by calling the audiocontext.createoscillator() method.
...And 6 more matches
align-self - CSS: Cascading Style Sheets
syntax /* keyword values */ align-self: auto; align-self: normal; /* positional alignment */ /* align-self does not take left and right values */ align-self: center; /* put the item around the center */ align-self: start; /* put the item at the start */ align-self: end; /* put the item at the end */ align-self: self-start; /* align the item flush at the start */ align-self: self-end; /* align the item flush at the end */ align-self: flex-start; /* put the flex item at the start */ align-self: flex-end; /* put the flex item at the end */ /* baseline alignment */ align-self: baseline; align-self: first baseline; a...
... normal the effect of this keyword is dependent of the layout mode we are in: in absolutely-positioned layouts, the keyword behaves like start on replaced absolutely-positioned boxes, and as stretch on all other absolutely-positioned boxes.
... for grid items, this keyword leads to a behavior similar to the one of stretch, except for boxes with an aspect ratio or an intrinsic sizes where it behaves like start.
...And 6 more matches
grid-area - CSS: Cascading Style Sheets
WebCSSgrid-area
if four <grid-line> values are specified, grid-row-start is set to the first value, grid-column-start is set to the second value, grid-row-end is set to the third value, and grid-column-end is set to the fourth value.
... when grid-column-end is omitted, if grid-column-start is a <custom-ident>, grid-column-end is set to that <custom-ident>; otherwise, it is set to auto.
... when grid-row-end is omitted, if grid-row-start is a <custom-ident>, grid-row-end is set to that <custom-ident>; otherwise, it is set to auto.
...And 6 more matches
A re-introduction to JavaScript (JS tutorial) - JavaScript
it's useful to start with an overview of the language's history.
... let's start off by looking at the building blocks of any language: the types.
...however, starting with ecmascript 2015, let and const declarations allow you to create block-scoped variables.
...And 6 more matches
jpm - Archive of obsolete content
see also jpm tutorial for getting started.
...note that unlike cfx, jpm is available in every command prompt you start, as long as you installed it with the --global flag.
... command reference jpm supports the following commands: jpm init create a skeleton add-on as a starting point for your add-on.
...And 5 more matches
Miscellaneous - Archive of obsolete content
r firefox version 2.0.0.1 retrieving the version of an extension as specified in the extension's install.rdf components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("extension-guid@example.org", function(addon) { // this is an asynchronous callback function that might not be called immediately alert("my extension's version is " + addon.version); }); restarting firefox/thunderbird/seamonkey_2.0 for firefox 3 see onwizardfinish around here: http://mxr.mozilla.org/seamonkey/sou...pdates.js#1639 for firefox 2 see around here: http://mxr.mozilla.org/mozilla1.8/so...pdates.js#1631 bug 338039 tracks improving this situation by providing a simple method to restart the application.
... example for firefox: services.startup.quit(services.startup.eforcequit|services.startup.erestart); mouse and keyboard detecting mouse wheel events when scrolling the mouse wheel on an element, the dommousescroll event fires.
... addeventlistener("blur", function(e) {onblurinput(e);}, false); } } function onfocusinput(focusevent) { focusedcontrol = focusevent.originaltarget; } function onblurinput(blurevent) { focusedcontrol = null; } or var element = document.commanddispatcher.focusedelement; inserting text at the cursor function inserttext(element, snippet) { var selectionend = element.selectionstart + snippet.length; var currentvalue = element.value; var beforetext = currentvalue.substring(0, element.selectionstart); var aftertext = currentvalue.substring(element.selectionend, currentvalue.length); element.value = beforetext + snippet + aftertext; element.focus(); //put the cursor after the inserted text element.setselectionrange(selectionend, selectionend); } inserttext(do...
...And 5 more matches
Appendix A: Add-on Performance - Archive of obsolete content
startup this is the area where add-ons have the most noticeable impact.
...an add-on can normally add a few hundred milliseconds to startup time because of the load handler, and it's not hard to figure out what having several add-ons will do.
... luckily, minimizing your startup time is easy, if you follow these guidelines: do not load or run code before it’s needed.
...And 5 more matches
Index of archived content - Archive of obsolete content
cross-domain content scripts interacting with page scripts loading content scripts reddit example port self contributor's guide classes and inheritance content processes getting started modules private properties firefox compatibility module structure of the sdk porting the library detector program id sdk api lifecycle sdk and xul comparison testing the add-on sdk two types of scripts workin...
... creating annotations displaying annotations implementing the widget overview storing annotations chrome authority creating event targets creating reusable modules developing for firefox mobile display a popup getting started (jpm) getting started (cfx) list open tabs listen for page load listening for load and unload localization logging modifying web pages based on url modifying the page hosted by a tab open a web page troubleshooting unit testing u...
... extension etiquette extension library extension packaging extension samples extension theming guidelines extension versioning, update and compatibility extensions support in seamonkey 2 firefox addons developer guide hiding browser chrome hotfix extension how to convert an overlay extension to restartless inline options install manifests installing extensions and themes from web pages interaction between privileged and non-privileged pages jetpack processes legacy add-ons legacy extensions for firefox for android api accounts.jsm ...
...And 5 more matches
JXON - Archive of obsolete content
note: if you are interested to address only some parts of an xml document (and are not starting in javascript/json for templating purposes), use xpath instead of converting the whole document into json.
...vvalue : new vvalue.constructor(vvalue); } var atmpels = []; // loaded element nodes cache function getjxontree (oxmlparent) { var sprop, vcontent, vresult, nlength = 0, nlevelstart = atmpels.length, nchildren = oxmlparent.haschildnodes() ?
...atmpels.length, vbuiltval = parsetext(scollectedtxt); if (oparentnode.hasattributes && oxmlparent.hasattributes()) { vresult = objectify(vbuiltval); for (nlength; nlength < oxmlparent.attributes.length; nlength++) { oattrib = oxmlparent.attributes.item(nlength); vresult["@" + oattrib.name.tolowercase()] = parsetext(oattrib.value.trim()); } } else if (nlevelend > nlevelstart) { vresult = objectify(vbuiltval); } for (var nelid = nlevelstart; nelid < nlevelend; nelid++) { sprop = atmpels[nelid].nodename.tolowercase(); vcontent = getjxontree(atmpels[nelid]); if (vresult.hasownproperty(sprop)) { if (vresult[sprop].constructor !== array) { vresult[sprop] = [vresult[sprop]]; } vresult[sprop].push(vcontent); } else { vresult[sprop] = vcontent; n...
...And 5 more matches
MMgc - Archive of obsolete content
the garbage collector is aware of "roots", which are starting points from which all "live" application data should be reachable.
... the collector starts scanning objects, starting at the roots and fanning outwards.
...now we have one pass where marks are cleared during sweep so clear marks isn't needed at the start.
...And 5 more matches
textbox (Toolkit autocomplete) - Archive of obsolete content
it is used to create a textbox with a popup containing a list of possible completions for what the user has started to type.
...lumn, size, tabindex, tabscrolling, timeout, type, value properties accessibletype, completedefaultindex, controller, crop, disableautocomplete, disablekeynavigation, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, label, maxlength, maxrows, minresultsforpopup, open, popup, popupopen, searchcount, searchparam, selectionend, selectionstart, showcommentcolumn, showimagecolumn,size, tabindex, tabscrolling, textlength, textvalue, timeout, type, value methods getsearchat, onsearchcomplete, ontextentered, ontextreverted, select, setselectionrange examples <textbox type="autocomplete" autocompletesearch="history"/> attributes accesskey type: character this should be set to a character that is used as a shortcut key.
... timeout type: integer for autocomplete textboxes, the number of milliseconds before the textbox starts searching for completions.
...And 5 more matches
Textbox (XPFE autocomplete) - Archive of obsolete content
it is used to create a textbox with a popup containing a list of possible completions for what the user has started to type.
... accessible, alwaysopenpopup, autofill, autofillaftermatch, completedefaultindex, crop, disableautocomplete, disabled, editable, focused, forcecomplete, highlightnonmatches, ignoreblurwhilesearching, inputfield, issearching, iswaiting, label, maxlength, maxrows, minresultsforpopup, nomatch, open, popup, popupopen, resultspopup, searchcount, searchparam, searchsessions, selectionend, selectionstart, sessioncount, showcommentcolumn, showpopup, size, tabindex, tabscrolling, textlength, textvalue, timeout, type, useraction, value methods addsession, clearresults, getdefaultsession, getresultat, getresultcount, getresultvalueat, getsession, getsessionbyname, getsessionresultat, getsessionstatusat, getsessionvalueat, removesession, select, setselectionrange, syncsessions example...
... timeout type: integer for autocomplete textboxes, the number of milliseconds before the textbox starts searching for completions.
...And 5 more matches
textbox - Archive of obsolete content
ewlines, onblur, onchange, onfocus, oninput, placeholder, preference, readonly, rows, searchbutton, size, spellcheck, tabindex, timeout, type, value, wrap, wraparound properties accessibletype, clickselectsall, decimalplaces, decimalsymbol, defaultvalue, disabled, editor, emptytext, increment, inputfield, label, max, maxlength, min, placeholder, readonly, searchbutton, selectionend, selectionstart, size, spinbuttons, tabindex, textlength, timeout, type, value, valuenumber, wraparound methods decrease, increase, reset, select, setselectionrange style classes plain examples <vbox> <label control="your-name" value="enter your name:"/> <textbox id="your-name" value="john"/> </vbox> attributes cols type: integer for multiline textboxes, the number of columns to disp...
...if the user presses enter, a new line is started.
... timeout type: integer for autocomplete textboxes, the number of milliseconds before the textbox starts searching for completions.
...And 5 more matches
calICalendarViewController - Archive of obsolete content
interface code [scriptable, uuid(1f783898-f4c2-4b2d-972e-360e0de38237)] interface calicalendarviewcontroller : nsisupports { void createnewevent (in calicalendar acalendar, in calidatetime astarttime, in calidatetime aendtime); void modifyoccurrence (in caliitemoccurrence aoccurrence, in calidatetime anewstarttime, in calidatetime anewendtime); void deleteoccurrence (in caliitemoccurrence aoccurrence); }; methods createnewevent void createnewevent (in calicalendar acalendar, in calidatetime astarttime, in calidatetime aendtime); ...
...the calidatetime parameters are optional, but aendtime cannot be included without astarttime.
... if astarttime is specified, then the calievent is meant to be created 'silently', that is, without a more detailed dialog appearing.
...And 5 more matches
Building a Theme - Archive of obsolete content
if you don't know css, it's going to be a steep learning curve, and you may want to try some html-based tutorials to start with.
... the browser ui has absolutely no styling on its own - if you try to start up with an empty theme, firefox will be unusable, as the button elements will be drawn as plain text.
... pick the first document with a web page title, like "firefox start page" and select it.
...And 5 more matches
Building up a basic demo with the PlayCanvas engine - Game development
environment setup to start developing with playcanvas, you don't need much.
... you should start off by: making sure you are using a modern browser with good webgl support, such as the latest firefox or chrome.
... playcanvas application to begin developing our game we have to create the playcanvas application first (using the given <canvas> element), and then start the update loop.
...And 5 more matches
Legacy layout methods - Learn web development
a two column layout let's start with the simplest possible example — a two column layout.
... start out by making a local copy of our sample simple-grid.html file, which contains the following markup in its body.
... updating our grid to get started in this section, make a new copy of your previous example page, or make a local copy of our simple-grid-finished.html code to use as a starting point.
...And 5 more matches
Practical positioning examples - Learn web development
to start with, we'd like you to make a local copy of the starting html file — info-box-start.html.
...first, add the following rule at the bottom of your css to remove the default padding-left and margin-top from the unordered list: .info-box ul { padding-left: 0; margin-top: 0; } note: we are using descendant selectors with .info-box at the start of the chain throughout this example — this is so that we can insert this feature into a page with other content already on it, without fear of interfering with the styles applied to other parts of the page.
... as a starting point, you can use your completed example from the first section of the article, or make a local copy of info-box.html from our github repo.
...And 5 more matches
Web fonts - Learn web development
the syntax required looks something like this: first of all, you have a @font-face block at the start of the css, which specifies the font file(s) to download: @font-face { font-family: "myfont"; src: url("myfont.woff"); } below this you can then use the font family name specified inside @font-face to apply your custom font to anything you like, as normal: html { font-family: "myfont", "bitstream vera serif", serif; } the syntax does get a bit more complex than this; we'll go into more ...
... you should use the web-font-start.html and web-font-start.css files as a starting point to add your code to (see the live example).
...in the web-font-start.css file, you'll find some minimal css to deal with the basic layout and typesetting of the example.
...And 5 more matches
Learn to style HTML using CSS - Learn web development
cascading stylesheets — or css — is the first technology you should start learning after html.
... get started prerequisites you should learn the basics of html before attempting any css.
...in that module, you will learn about: css, starting with the introduction to css module more advanced html modules javascript, and how to use it to add dynamic functionality to web pages once you understand the fundamentals of html, we recommend that you learn html and css at the same time, moving back and forth between the two topics.
...And 5 more matches
The web and web standards - Learn web development
after that other technologies followed such as css and javascript, and the web started to look more like the web we know today.
... "open" standards one of the key aspects of web standards, which timbl and the w3c agreed on from the start, is that the web (and web technologies) should be free to both contribute and use, and not encumbered by patents/licensing.
...as you go through the learning material presented here, you'll start to learn how this is made possible with some very clever design and implementation work.
...And 5 more matches
Creating hyperlinks - Learn web development
prerequisites: basic html familiarity, as covered in getting started with html.
... active learning: creating your own example link create an html document using your local code editor and our getting started template.
... for a start, it's easier to scan your code — relative urls are generally shorter than absolute urls, which makes reading code much easier.
...And 5 more matches
Test your skills: Loops - Learn web development
a good starting place is our manipulating documents tutorial.
... loops 1 in our first looping task we want you start by creating a simple loop that goes through all the items in the provided myarray and prints them out on the screen inside list items (i.e., <li> elements), which are appended to the provided list.
... download the starting point for this task to work in your own editor or in an online editor.
...And 5 more matches
Manipulating documents - Learn web development
active learning: basic dom manipulation to start learning about dom manipulation, let's begin with a practical example.
...inside your script element, add the following line: const link = document.queryselector('a'); now we have the element reference stored in a variable, we can start to manipulate it using properties and methods available to it (these are defined on interfaces like htmlanchorelement in the case of <a> element, its more general parent interface htmlelement, and node — which represents all nodes in a dom).
... going back to the current example, let's start by grabbing a reference to our <section> element — add the following code at the bottom of your existing script (do the same with the other lines too): const sect = document.queryselector('section'); now let's create a new paragraph using document.createelement() and give it some text content in the same way as before: const para = document.createelement('p'); para.textcontent = 'we hope...
...And 5 more matches
Test your skills: Strings - Learn web development
strings 1 in our first strings task, we start off small.
... you already have half of a famous quote inside a variable called quotestart; we would like you to: look up the other half of the quote, and add it to the example inside a variable called quoteend.
...can you fix the problem with quotestart, so that the full quote displays correctly?
...And 5 more matches
Server-side web frameworks - Learn web development
exact, case-insensitive, greater than, etc.), and can support complex statements (for example, you can specify a search on u11 teams that have a team name that starts with "fr" or ends with "al").
...with so many choices, it can become difficult to work out what framework provides the best starting point for your new web application.
...if you're starting from absolutely no programming experience then consider django (it is one of the easiest to learn based on the above criteria).
...And 5 more matches
Ember app structure and componentization - Learn web development
to start with, delete the contents of application.hbs and replace them with the following: <section class="todoapp"> <h1>todos</h1> <input class="new-todo" aria-label="what needs to be done?" placeholder="what needs to be done?" autofocus > </section> note: aria-label provides a label for assistive technology to make use of — for example, for a screenreader to read out.
... when you save application.hbs, the development server you started earlier will automatically rebuild the app and refresh the browser.
... before we start adding any component code, let’s create the scaffolding for the other components.
...And 5 more matches
Componentizing our Svelte app - Learn web development
previous overview: client-side javascript frameworks next in the last article we started developing our todo list app.
... code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/04-componentizing-our-app or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/04-componentizing-our-app remember to run npm install && npm run dev to start your app in development mode.
... repl to code along with us using the repl, start at https://svelte.dev/repl/99b9eb228b404a2f8c8959b22c0a40d3?version=3.23.2 breaking the app into components in svelte, an application is composed from one or more components.
...And 5 more matches
Deployment and next steps - Learn web development
code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/08-next-steps or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/08-next-steps remember to run npm install && npm run dev to start your app in development mode.
...it also starts a development server and watches for changes, recompiling the app and refreshing the page when a change occurs.
... in the file package.json you can see that the dev and start scripts are just calling rollup: "scripts": { "build": "rollup -c", "dev": "rollup -c -w", "start": "sirv public" }, in the dev script we are passing the -w argument, which tells rollup to watch files and rebuild on changes.
...And 5 more matches
Advanced Svelte: Reactivity, lifecycle, accessibility - Learn web development
previous overview: client-side javascript frameworks next in the last article we added more features to our to-do list and started to organize our app into components.
... code along with us git clone the github repo (if you haven't already done it) with: git clone https://github.com/opensas/mdn-svelte-tutorial.git then to get to the current app state, run cd mdn-svelte-tutorial/05-advanced-concepts or directly download the folder's content: npx degit opensas/mdn-svelte-tutorial/05-advanced-concepts remember to run npm install && npm run dev to start your app in development mode.
... repl to code along with us using 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.
...And 5 more matches
Introduction to cross browser testing - Learn web development
overview: cross browser testing next this article starts the module off by providing an overview of the topic of (cross) browser testing, answering questions such as "what is cross browser testing?", "what are the most common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" prerequisites: familiarity with the core html, css, and javascript languages.
...to start with, when we talk about sites "working cross browser", we are really saying that they should provide an acceptable user experience across different browsers.
... once you've got an idea of the required featureset, and what technologies you will likely build these features with, you should start exploring the target audience — what browsers, devices, etc.
...And 5 more matches
Command line crash course - Learn web development
this is why we are providing this chapter — to help you get started in this seemingly unfriendly environment.
... the next images show the command prompts available in windows — there’s a good range of options from the "cmd" program to "powershell" — which can be run from the start menu by typing the program name.
...technically, a terminal is software that starts and connects to a shell.
...And 5 more matches
Debugging on Windows
ways to start the debugger first of all, it's necessary to install a visual studio extension to be able to follow child processes as they are created.
... firefox, in general, and even in non-e10s mode, does not start the main process directly, it starts it via a launcher process.
...you can click "start" button to run firefox then, already attached in the debugger.
...And 5 more matches
How to get a stacktrace with WinDbg
debugging to begin debugging, ensure that firefox is not already running and open windbg from the start menu.
... (start->all programs->debugging tools for windows->windbg) next, open the "file" menu and choose "open executable...".
...before debugging can start, several commands must be entered into the one-line input box at the bottom of the command window.
...And 5 more matches
InstallListener
method overview void onnewinstall(in addoninstall install) void ondownloadstarted(in addoninstall install) void ondownloadprogress(in addoninstall install) void ondownloadended(in addoninstall install) void ondownloadcancelled(in addoninstall install) void ondownloadfailed(in addoninstall install) void oninstallstarted(in addoninstall install) void oninstallended(in addoninstall install, in addon addon) void oninstallcancelled(in addoninstall install) void oninstallfailed(in addoninstall install) voi...
...d onexternalinstall(in addon install, in addon existingaddon, in boolean needsrestart) methods onnewinstall() called when a new instance of addoninstall is created, primarily so ui can display some kind of progress for all installs.
... void onnewinstall( in addoninstall install ) parameters install the addoninstall representing the install ondownloadstarted() called when downloading begins for an add-on install.
...And 5 more matches
Bootstrapping a new locale
/dom/locales/ ab-cd/dom cp -r mozilla-1.9.x/editor/locales/ ab-cd/editor cp -r mozilla-1.9.x/extensions/reporter/locales/chrome ab-cd/extensions cp -r mozilla-1.9.x/netwerk/locales/ ab-cd/netwerk cp -r mozilla-1.9.x/other-licenses/branding/firefox/locales/ ab-cd/other-licenses cp -r mozilla-1.9.x/security/manager/locales/ ab-cd/security cp -r mozilla-1.9.x/toolkit/locales/ ab-cd/toolkit getting started change your directory to the new working directory so you are in the ~/[your working directory]/[ab-cd]/ path and can start localizing.
... directories to localize if you're starting from scratch, you should have just downloaded: mozilla-1.9.x/browser/locales/ mozilla-1.9.x/dom/locales/ mozilla-1.9.x/netwerk/locales/ mozilla-1.9.x/other-licenses/branding/firefox/locales/en-us mozilla-1.9.x/security/manager/locales/ mozilla-1.9.x/toolkit/locales/ and then copied them so that the files for localization end up in the following directories: ab-cd/browser/ ab-cd/dom/ ab-cd/n...
...etwerk/ ab-cd/other-licenses/branding/firefox/ ab-cd/security/manager/ ab-cd/toolkit/ translating to start editing, you will need a text editing application.
...And 5 more matches
DMD
the button won't be present in non-dmd builds, and will be grayed out in dmd builds if dmd isn't enabled at start-up.
...(if you are familiar with the recommended "--es env0" method for setting environment variables when launching fennec, note that you cannot use this method here because those are processed too late in the startup process.
...since you cannot mark files in /sdcard/ as executable, we will use /data/local/tmp for this purpose: adb push dmd_fennec /data/local/tmp adb shell cd /data/local/tmp chmod 755 dmd_fennec the final step is to make android use the above wrapper script while launching fennec, so that the environment variable is present when fennec starts up.
...And 5 more matches
Profiling with Xperf
to see your xperf version, either run 'xperf' on a command line with no arguments, or start 'xperfview' and look at help -> about performance analyzer.
... for 64-bit windows 7 or vista, you'll need to do a registry tweak and then restart to enable stack walking: reg add "hklm\system\currentcontrolset\control\session manager\memory management" -v disablepagingexecutive -d 0x1 -t reg_dword -f symbol server setup with the latest versions of the windows performance toolkit, you can modify the symbol path directly from within the program via the trace menu.
...(again, make sure that the directories exist; if they don't, it's a silent error.) quick start all these tools will live, by default, in c:\program files\microsoft windows performance toolkit.
...And 5 more matches
sslfnc.html
initializing multi-processing with a shared ssl server cache to start a multi-processing application, the initial parent process calls ssl_configmpserversidcache, and then creates child processes, by one of these methods: call fork and then exec (unix) call createprocess (win32) call pr_createprocess (both unix and win32) it is essential that the parent allow the child to inherit the file descriptors.
... for examples of the callback functions listed here, see chapter 2, "getting started with ssl." ssl_authcertificatehook specifies a certificate authentication callback function called to authenticate an incoming certificate.
... see also for examples of certificate authentication callback functions, see the sample code referenced from chapter 2, "getting started with ssl." ssl_authcertificate default callback function used to authenticate certificates received from the remote end of an ssl connection if the application has not previously called ssl_authcertificatehook to specify its own certificate authentication callback function.
...And 5 more matches
amIInstallTrigger
introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview boolean enabled(); boolean install(in nsivariant aargs, [optional] in amiinstallcallback acallback); boolean installchrome(in pruint32 atype, in astring aurl, in astring askin); deprecated since gecko 2.0 boolean startsoftwareupdate(in astring aurl, [optional] in print32 aflags); deprecated since gecko 2.0 boolean updateenabled(); deprecated since gecko 2.0 constants retained for backwards compatibility.
... return value install() starts a new installation of a set of add-ons.
... return value true if the installations were successfully started.
...And 5 more matches
Mozilla
command line options command line options are used to specify various startup options for mozilla applications.this page describes the commonly used options and how to use them.
... creating a spell check dictionary add-on this page describes how to package a hunspell spell check dictionary as a firefox add-on, or how to update your existing add-on, so that it can be installed, uninstalled and updated without a restart.
... creating sandboxed http connections starting with gecko 1.8.1 (firefox 2), it is possible to create sandboxed http connections which don't affect the user's cookies.
...And 5 more matches
FileReader - Web APIs
filereader.onloadstart a handler for the loadstart event.
... this event is triggered each time the reading is starting.
... filereader.readasarraybuffer() starts reading the contents of the specified blob, once finished, the result attribute contains an arraybuffer representing the file's data.
...And 5 more matches
Using the Gamepad API - Web APIs
the value must be relative to the navigationstart attribute of the performancetiming interface.
... to start with, we declare some variables: the gamepadinfo paragraph that the connection info is written into, the ball that we want to move, the start variable that acts as the id for requestanimation frame, the a and b variables that act as position modifiers for moving the ball, and the shorthand variables that will be used for the requestanimationframe() and cancelanimationframe() cross browser forks.
... var gamepadinfo = document.getelementbyid("gamepad-info"); var ball = document.getelementbyid("ball"); var start; var a = 0; var b = 0; next we use the gamepadconnected event to check for a gamepad being connected.
...And 5 more matches
GlobalEventHandlers - Web APIs
globaleventhandlers.onanimationstart an eventhandler called when an animationstart event is sent, indicating that a css animation has started playing.
... globaleventhandlers.ondragstart is an eventhandler representing the code to be called when the dragstart event is raised.
... globaleventhandlers.onloadend is an eventhandler representing the code to be called when the loadend event is raised (when progress has stopped on the loading of a resource.) globaleventhandlers.onloadstart is an eventhandler representing the code to be called when the loadstart event is raised (when progress has begun on the loading of a resource.) globaleventhandlers.onlostpointercapture is an eventhandler representing the code to be called when the lostpointercapture event type is raised.
...And 5 more matches
performance.measure() - Web APIs
the measure() method creates a named timestamp in the browser's performance entry buffer between marks, the navigation start time, or the current time.
... when measuring between two marks, there is a start mark and end mark, respectively.
... starttime - set to the start mark timestamp.
...And 5 more matches
Using readable streams - Web APIs
return new readablestream({ start(controller) { return pump(); function pump() { return reader.read().then(({ done, value }) => { // when no more data needs to be consumed, close the stream if (done) { controller.close(); return; } // enqueue the next data chunk into our target stream controller.enqueue(value); return pump(...
... // enqueue the next data chunk into our target stream controller.enqueue(value); return pump(); this is the standard pattern you’ll see when using stream readers: you write a function that starts off by reading the stream.
... the generic syntax skeleton looks like this: const stream = new readablestream({ start(controller) { }, pull(controller) { }, cancel() { }, type, autoallocatechunksize }, { highwatermark, size() }); the constructor takes two objects as parameters.
...And 5 more matches
Lifetime of a WebRTC session - Web APIs
it’s so big that years ago, smart people saw how big it was, how fast it was growing, and the limitations of the 32-bit ip addressing system, and realized that something had to be done before we ran out of addresses to use, so they started working on designing a new 64-bit addressing system.
...-- more coming up ice restart sometimes, during the lifetime of a webrtc session, network conditions change.
...when this happens, the ice agent may choose to perform ice restart.
...And 5 more matches
Using DTMF with WebRTC - Web APIs
these will be initialized when the call starts up, in our connectanddial() function, as shown in starting the connection process below.
...this gets figured out in connectanddial(), as shown in starting the connection process.
... mediaconstraints an object conforming to the mediaconstraints dictionary specifying the constraints to use when starting the connection.
...And 5 more matches
Using the Web Animations API - Web APIs
this article will start you off in the right direction with fun demos and tutorials featuring alice in wonderland.
... writing css animations with the web animations api one of the more familiar ways to approach learning the web animations api is to start with something most web developers have played with before: css animations.
... currently, there should be at least two keyframes specified (representing the starting and ending states of the animation sequence).
...And 5 more matches
Using Web Workers - Web APIs
the port connection needs to be started either implicitly by use of the onmessage event handler or explicitly with the start() method before any messages can be posted.
... calling start() is only needed if the message event is wired up via the addeventlistener() method.
... note: when using the start() method to open the port connection, it needs to be called from both the parent thread and the worker thread if two-way communication is needed.
...And 5 more matches
Window - Web APIs
WebAPIWindow
window.mozanimationstarttime the time in milliseconds since epoch at which the current animation cycle began.
... use animation.starttime instead.
... windoworworkerglobalscope.fetch() starts the process of fetching a resource from the network.
...And 5 more matches
Architecture - Accessibility
this allows at's to find its position within that text, because the hyperlink interface exposes a start and end index.
... in fact, the end index will always be 1 larger than the start index, because the object is always represented by a single '\xfffc' character.
... otherwise, use iahyperlink::getstartindex() to find the index in parent.
...And 5 more matches
Border-image generator - CSS: Cascading Style Sheets
entlistener('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; 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); }); var slideend = function slideend(e) { document.removeeventlistener("mousemove", slidermotion); document.body.style.cursor = "auto"; slider.style.cursor = "pointer"; }; var slidermotion = function slidermotion(e) { slider.style.cursor = "e-resize"; var delta = (e.clientx - startx) / obj.sensivity | 0; var value = delta * obj.step + start_value; setvalue(obj.topic, value); }; return slider; }; var inputslider = function(node) { var min = parsefloat(node.getattribute('data-min')); var max = parsefloat(node.getattribute('data-max')); var step = parsefloat(node.getattribute('data-step')); var value = parsefloat(node.getattribute('data-value')); var topic = node.getattribute('data-topic'...
...ad", function() { borderimage.init(); }); var borderimage = (function borderimage() { var getelembyid = document.getelementbyid.bind(document); var subject; var preview; var guidelines = []; var positions = ['top', 'right', 'bottom', 'left']; var makedraggable = function makedraggable(elem) { var offsettop; var offsetleft; elem.setattribute('data-draggable', 'true'); var dragstart = function dragstart(e) { if (e.target.getattribute('data-draggable') !== 'true' || e.target !== elem || e.button !== 0) return; offsetleft = e.clientx - elem.offsetleft; offsettop = e.clienty - elem.offsettop; document.addeventlistener('mousemove', mousedrag); document.addeventlistener('mouseup', dragend); }; var dragend = function dragend(e) { if (e.button !== 0...
...And 5 more matches
CSS Box Alignment - CSS: Cascading Style Sheets
instead we describe alignment in terms of the start and end of the particular dimension we are working with.
... center start end self-start self-end flex-start for flexbox only flex-end for flexbox only left right other than the physical values of left and right, which relate to physical attributes of the screen, all of the other values are logical values and relate to the writing mode of the content.
... for example, when working in css grid layout, if you are working in english and set justify-content to start this will move the items in the inline dimension to the start, which will be the left as sentences in english start on the left.
...And 5 more matches
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
i have also set the align-self property on box1 so it will override the default and stretch to the height of the container and on box2 so it aligns to the start of the flex container.
...; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } <div class="wrapper"> <div class="box1">one</div> <div class="box2">two</div> <div class="box3">three</div> </div> .wrapper { display: flex; align-items: flex-end; min-height: 200px; } .box1 { align-self: stretch; } .box2 { align-self: flex-start; } alignment in css grids this second example uses a grid to create the same layout.
...so we align to start and end rather than flex-start and flex-end.
...And 5 more matches
Logical properties for floating and positioning - CSS: Cascading Style Sheets
logical property or value physical property or value float: inline-start float: left float: inline-end float: right clear: inline-start clear: left clear: inline-end clear: right inset-inline-start left inset-inline-end right inset-block-start top inset-block-end bottom text-align: start text-align: left text-align: end text-align: right in addition to...
...the logical properties specification defines the values inline-start and inline-end as mappings for left and right.
... in the example below i have two boxes — the first has the box floated with float: left, the second with float: inline-start.
...And 5 more matches
Logical properties for margins, borders and padding - CSS: Cascading Style Sheets
the inline direction therefore runs horizontally — left to right — and margin-inline-start would be equivalent to margin-left.
... if you were using a horizontal-tb writing mode with a right-to-left text direction then margin-inline-start would be the same as margin-right, and in a vertical writing mode it would be the same as using margin-top.
... logical property physical property border-block-end border-bottom border-block-end-color border-bottom-color border-block-end-style border-bottom-style border-block-end-width border-bottom-width border-block-start border-top border-block-start-color border-top-color border-block-start-style border-top-style border-block-start-width border-top-width border-inline-end border-right border-inline-end-color border-right-color border-inline-end-style border-right-style border-inline-end-width border-right-width border-inline-start border-left border-inline-start-color border-left-color border-inline-start-sty...
...And 5 more matches
linear-gradient() - CSS: Cascading Style Sheets
syntax /* a gradient tilted 45 degrees, starting blue and finishing red */ linear-gradient(45deg, blue, red); /* a gradient going from the bottom right to the top left corner, starting blue and finishing red */ linear-gradient(to left top, blue, red); /* color stop: a gradient going from the bottom to top, starting blue, turning green at 40% of its length, and finishing red */ linear-gradient(0deg, blue, green 40%, red); /* color...
... hint: a gradient going from the left to right, starting red, getting to the midpoint color 10% of the way across the length of the gradient, taking the rest of the 90% of the length to change to blue */ linear-gradient(.25turn, red, 10%, blue); /* multi-position color stop: a gradient tilted 45 degrees, with a red bottom-left half and a blue top-right half, with a hard line where the gradient changes from red to blue */ linear-gradient(45deg, red 0 50%, blue 50% 100%); values <side-or-corner> the position of the gradient line's starting point.
...the colors of the gradient are determined by two or more points: the starting point, the ending point, and, in between, optional color-stop points.
...And 5 more matches
place-self - CSS: Cascading Style Sheets
constituent properties this property is a shorthand for the following css properties: align-self justify-self syntax /* keyword values */ place-self: auto center; place-self: normal start; /* positional alignment */ place-self: center normal; place-self: start auto; place-self: end normal; place-self: self-start auto; place-self: self-end normal; place-self: flex-start auto; place-self: flex-end normal; place-self: left auto; place-self: right normal; /* baseline alignment */ place-self: baseline normal; place-self: first baseline auto; place-self: last baseline normal; place-se...
... normal the effect of this keyword is dependent of the layout mode we are in: in absolutely-positioned layouts, the keyword behaves like start on replaced absolutely-positioned boxes, and as stretch on all other absolutely-positioned boxes.
... for grid items, this keyword leads to a behavior similar to the one of stretch, except for boxes with an aspect ratio or an intrinsic sizes where it behaves like start.
...And 5 more matches
Cross-browser audio basics - Developer guides
autoplay specifying autoplay will cause the audio to start playing as soon as possible and without any user interaction — in short, the audio will autoplay.
... loop the loop attribute will ensure that upon getting to the end of the audio clip, the audio clip will loop back to the beginning and start playing again.
...</audio> muted if you want the audio to start muted (no volume), add the muted attribute.
...And 5 more matches
Audio and Video Delivery - Developer guides
this article is intended as a starting point for exploring the various delivery mechanisms of web based media and compatibility with popular browsers.
...st(); request.open("get","http://jplayer.org/audio/mp3/riomez-01-sleep_together.mp3",true); request.responsetype = "arraybuffer"; request.onload = function() { context.decodeaudiodata(request.response, function(buffer) { source = context.createbuffersource(); source.buffer = buffer; source.connect(context.destination); // auto play source.start(0); // start was previously noteon }); }; request.send(); } catch(e) { alert('web audio api not supported'); } in this example we retrieve an mp3 file via xhr, load it into a source and play it (try it for yourself).
... the main mechanism is outlined below: navigator.mediadevices.getusermedia({audio:true}) .then(function onsuccess(stream) { var recorder = new mediarecorder(stream); var data = []; recorder.ondataavailable = function(e) { data.push(e.data); }; recorder.start(); recorder.onerror = function(e) { throw e.error || new error(e.name); // e.name is ff non-spec } recorder.onstop = function(e) { var audio = document.createelement('audio'); audio.src = window.url.createobjecturl(new blob(data)); } settimeout(function() { rec.stop(); }, 5000); }) .catch(function onerror(error) { console.log(error.message);...
...And 5 more matches
<audio>: The Embed Audio element - HTML: Hypertext Markup Language
WebHTMLElementaudio
if the audio's metadata isn't available yet—thereby preventing you from knowing the media's start time or duration—currenttime instead indicates, and can be used to change, the time at which playback will begin.
...other audio may have a media timeline that doesn't start at 0 seconds, so setting currenttime to a time before that would fail.
... for example, if the audio's media timeline starts at 12 hours, setting currenttime to 3600 would be an attempt to set the current playback position well before the beginning of the media, and would fail.
...And 5 more matches
<video>: The Video Embed element - HTML: Hypertext Markup Language
WebHTMLElementvideo
if the media has not started playing yet, the time offset at which it will begin is returned.
...other media may have a media timeline that doesn't start at 0 seconds, so setting currenttime to a time before that would fail.
... the getstartdate() method can be used to determine the beginning point of the media timeline's reference frame.
...And 5 more matches
Indexed collections - JavaScript
remember, javascript array indexes are 0-based: they start at 0, not 1.
... let myarray = new array('1', '2', '3') myarray.unshift('4', '5') // myarray becomes ["4", "5", "1", "2", "3"] slice(start_index, upto_index) extracts a section of an array and returns a new array.
... let myarray = new array('a', 'b', 'c', 'd', 'e') myarray = myarray.slice(1, 4) // starts at index 1 and extracts all elements // until index 3, returning [ "b", "c", "d"] splice(index, count_to_remove, addelement1, addelement2, ...) removes elements from an array and (optionally) replaces them.
...And 5 more matches
Array.prototype.copyWithin() - JavaScript
syntax arr.copywithin(target[, start[, end]]) parameters target zero-based index at which to copy the sequence to.
...if target is positioned after start, the copied sequence will be trimmed to fit arr.length.
... start optional zero-based index at which to start copying elements from.
...And 5 more matches
String.prototype.substring() - JavaScript
the substring() method returns the part of the string between the start and end indexes, or to the end of the string.
... syntax str.substring(indexstart[, indexend]) parameters indexstart the index of the first character to include in the returned substring.
... description substring() extracts characters from indexstart up to but not including indexend.
...And 5 more matches
TypedArray.prototype.fill() - JavaScript
the fill() method fills all the elements of a typed array from a start index to an end index with a static value.
... syntax typedarray.fill(value[, start = 0[, end = this.length]]) parameters value value to fill the typed array with.
... start optional.
...And 5 more matches
async function - JavaScript
examples async functions and execution order function resolveafter2seconds() { console.log("starting slow promise") return new promise(resolve => { settimeout(function() { resolve("slow") console.log("slow promise is done") }, 2000) }) } function resolveafter1second() { console.log("starting fast promise") return new promise(resolve => { settimeout(function() { resolve("fast") console.log("fast promise is done") }, 1000) }) } async function ...
...sequentialstart() { console.log('==sequential start==') // 1.
...} async function concurrentstart() { console.log('==concurrent start with await=='); const slow = resolveafter2seconds() // starts timer immediately const fast = resolveafter1second() // starts timer immediately // 1.
...And 5 more matches
Web Performance
resource timings are detailed network timing measurements regarding the loading of an application's resources.optimizing startup performanceregardless of platform, it's always a good idea to start up as quickly as possible.
...instead, we're going to look at a more important issue when building web apps: starting up as asynchronously as possible.
... that means not running all your startup code in a single event handler on the app's main thread.performance budgetsa performance budget is a limit to prevent regressions.
...And 5 more matches
begin - SVG: Scalable Vector Graphics
WebSVGAttributebegin
the interpretation of a list of start times is detailed in the smil specification in "evaluation of begin and end time lists".
...the element's animation start time is defined relative to the begin or active end of another animation.
...the animation start time is defined relative to the time that the specified event is fired.
...And 5 more matches
Tutorials
whether you are just starting out, learning the basics, or are an old hand at web development, you can find helpful resources here for best practices.
... for complete beginners to the web getting started with the web getting started with the web is a concise series introducing you to the practicalities of web development.
...this module gets you started with creating the client-side parts of forms.
...And 5 more matches
jspage - Archive of obsolete content
})(); },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){return true;}if(c===false){return false;}return($type(this)!="document"&&c!=this&&c.prefix!="xul"&&!this.haschild(c)); };elem...
...uration); this.set(this.compute(this.from,this.to,b));}else{this.set(this.compute(this.from,this.to,1));this.complete();}},set:function(a){return a;},compute:function(c,b,a){return fx.compute(c,b,a); },check:function(){if(!this.timer){return true;}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments)); return false;}return false;},start:function(b,a){if(!this.check(b,a)){return this;}this.from=b;this.to=a;this.time=0;this.transition=this.gettransition(); this.starttimer();this.onstart();return this;},complete:function(){if(this.stoptimer()){this.oncomplete();}return this;},cancel:function(){if(this.stoptimer()){this.oncancel(); }return this;},onstart:function(){this.fireevent("start",this.subject);},oncomplete:function(){this.fi...
...reevent("complete",this.subject);if(!this.callchain()){this.fireevent("chaincomplete",this.subject); }},oncancel:function(){this.fireevent("cancel",this.subject).clearchain();},pause:function(){this.stoptimer();return this;},resume:function(){this.starttimer(); return this;},stoptimer:function(){if(!this.timer){return false;}this.time=$time()-this.time;this.timer=$clear(this.timer);return true;},starttimer:function(){if(this.timer){return false; }this.time=$time()-this.time;this.timer=this.step.periodical(math.round(1000/this.options.fps),this);return true;}});fx.compute=function(c,b,a){return(b-c)*a+c; };fx.durations={"short":250,normal:500,"long":1000};fx.css=new class({extends:fx,prepare:function(d,e,b){b=$splat(b);var c=b[1];if(!$chk(c)){b[1]=b[0]; b[0]=d.getstyle(e);}var a=b.map(this.parse...
...And 4 more matches
Actions - Archive of obsolete content
<vbox datasources="http://www.xulplanet.com/ds/sample.rdf" ref="http://www.xulplanet.com/rdf/a"> <template> <query> <content uri="?start"/> <triple subject="?start" predicate="http://www.xulplanet.com/rdf/relateditem" object="?relateditem"/> </query> <action> <button uri="?relateditem" label="?relateditem"/> </action> </template> </vbox> in this example, we omit the <xul:rule> element around the <xul:action> as it is optional when we want to generate content unconditionally.
...in this example, there's only one variable to use, ?relateditem, since ?start is the starting point and the start and end points cannot be the same.
...let's look at the results again: (?start = http://www.xulplanet.com/rdf/a, ?relateditem = http://www.xulplanet.com/rdf/b) (?start = http://www.xulplanet.com/rdf/a, ?relateditem = http://www.xulplanet.com/rdf/c) (?start = http://www.xulplanet.com/rdf/a, ?relateditem = http://www.xulplanet.com/rdf/d) the builder will start with the first result.
...And 4 more matches
Recursive Generation - Archive of obsolete content
after generating a result's content, the builder starts again using a new parent and starting point.
... naturally, the parent will be the new result's content, rather than the outer containing element, and the starting point will be the endpoint of the previous iteration.
...here is the content that was generated after one iteration: <vbox datasources="http://www.xulplanet.com/ds/sample.rdf" ref="http://www.xulplanet.com/rdf/a"> <template> <query> <content uri="?start"/> <triple subject="?start" predicate="http://www.xulplanet.com/rdf/relateditem" object="?relateditem"/> </query> <action> <hbox uri="?relateditem"> <button label="?start"/> <button label="?relateditem"/> </hbox> </action> </template> <hbox id="http://www.xulplanet.com/rdf/b"> <button label="http://www.xulplanet.com...
...And 4 more matches
XULRunner tips - Archive of obsolete content
tensions.properties"); pref("extensions.getmoreextensionsurl", "chrome://mozapps/locale/extensions/extensions.properties"); pref("extensions.getmorethemesurl", "chrome://mozapps/locale/extensions/extensions.properties"); if your application is based on gecko 2.0, you need to register a component through the new component registration because the extension manager uses fuel, namely application.restart(), to restart your xulrunner-based application after any change (installation, removal, enabling, disabling) in the extensions' list: copy files fuelapplication.js and fuelapplication.manifest from browser/fuel/src for instance into your components/ directory tweak the line #include ../../../toolkit/components/exthelper/extapplication.js in your copy of fuelapplication.js as needed make sure...
... theme manager chrome://mozapps/content/extensions/extensions.xul?type=themes extension:manager-themes javascript console chrome://global/content/console.xul global:console about:config chrome://global/content/config.xul developer extensions venkman need a custom build or a compatible extension need to edit compatibility in needs a method to start venkman (usually by overlaying the main xul file, similar to existing code for firefox, suite, etc.) the function toopenwindowbytype() needs to be defined.
...th the same name as the dom inspector id (inspector@mozilla.org) containing one line of text -- the exact path to the root directory of dom inspector (where the install.rdf is) like this one: /home/username/.mozilla/firefox/numbersandletters/extensions/inspector@mozilla.org/ now create a javascript file with the following code and include it in the main window of your application: function startdomi() { // load the window datasource so that browser windows opened subsequent to dom // inspector show up in the dom inspector's window list.
...And 4 more matches
Sunbird Theme Tutorial - Archive of obsolete content
note: if the <tt>extensions</tt> directory is empty, you are in the wrong place—start again and follow the instructions more carefully.
...="a test theme for sunbird" em:homepageurl="http://developer.mozilla.org/" em:version="0.1" em:internalname="testing" em:type="4" > <em:targetapplication><!-- sunbird --> <description em:id="{718e30fb-e89b-41dd-9da7-e25a45638b28}" em:minversion="0.2.9" em:maxversion="0.4" /> </em:targetapplication> </description> </rdf> in the line that starts <tt>em:id</tt>, paste your identifier between the double-quote characters, replacing the identifier that is there now.
...note: if you do not know where the program directory is, look at the properties of the shortcut or launcher icon that you use to start sunbird.
...And 4 more matches
Table Reflow Internals - Archive of obsolete content
overview review of reflow table frames table reflow intro to paginated reflow table paginated reflow review of reflow reflow process starts when an html document starts loading (the frame tree contains only viewport, scroll(s), canvas, html, body).
... review of reflow reflow starts with pres shell which reflows the reflow root (usually the viewport frame), which reflows it children, etc.
... ususally it starts when the pres shell processes its queue of reflow commands.
...And 4 more matches
Index - Game development
16 building up a basic demo with a-frame 3d, a-frame, vr, virtual reality, web, webgl the webxr and webgl apis already enable us to start creating virtual reality (vr) experiences inside web browsers, but the community is still waiting for tools and libraries to appear, to make this easier.
... 22 explaining basic 3d theory 3d, coordinates, textures, basics, fragment, lighting, primitives, rendering, theory, vertex, vertices this article explains all of the basic theory that's useful to know when you are getting started working with 3d.
...in gecko, async compilation allows the javascript engine to compile the asm.js off the main thread when the game is loading and cache the generated machine code so that the game doesn't need to be compiled on subsequent loads (starting in firefox 28).
...And 4 more matches
Buttons - Game development
instead of starting the game right away we can leave that decision to the player by adding a start button they can press.
...add these lines below your other variable definitions: var playing = false; var startbutton; loading the button spritesheet we can load the button spritesheet the same way we loaded the ball's wobble animation.
...add the following lines to the bottom of your create() function: startbutton = game.add.button(game.world.width*0.5, game.world.height*0.5, 'button', startgame, this, 1, 0, 2); startbutton.anchor.set(0.5); the button() method's parameters are as follows: the button's x and y coordinates the name of the graphic asset to be displayed for the button a callback function that will be executed when the button is pressed a reference to this to specify the execution...
...And 4 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
headers are case-insensitive, begins at the start of a line and are immediately followed by a ':' and a value depending of the header itself.
...the rationale behind the mobile-first approach is to provide users with good user experiences at all screen sizes—by starting with creating a user experience that works well on small screens, and then building on top of that to further enrich the user experience as the screen size increases.
... 313 page load time glossary, timings, web performance, metrics, page load time page load time is the time it takes for a page to load, measured from navigation start to the start of the load event 314 page prediction glossary, security, web performance, page prediction page prediction is a browser feature or script which, when enabled, tells the browser to download resources the user is likely to visit before the user requests the content.
...And 4 more matches
Cascade and inheritance - Learn web development
let's start by taking a quick look at the key things we are dealing with, then we'll look at each in turn and see how they interact with each other and your css.
...it can sometimes seem a little bit complicated, but you will start to remember them as you get more experienced with css, and you can always look up the details if you forget!
... the below video shows how you can use the firefox devtools to inspect a page's cascade, specificity, and more: understanding inheritance we'll start with inheritance.
...And 4 more matches
Test your skills: Selectors - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
...And 4 more matches
Styling lists - Learn web development
there are three properties you should know about to start with, which can be set on <ul> or <ol> elements: list-style-type: sets the type of bullets to use for the list, for example, square or circle bullets for an unordered list, or numbers, letters or roman numerals for an ordered list.
... list-style-position: sets whether the bullets appear inside the list items, or outside them before the start of each item.
... bullet position the list-style-position property sets whether the bullets appear inside the list items, or outside them before the start of each item.
...And 4 more matches
JavaScript basics - Learn web development
previous overview: getting started with the web next javascript is a programming language that adds interactivity to your website.
...this article helps you get started with javascript and furthers your understanding of what is possible.
...you may have to start small, and progress gradually.
...And 4 more matches
From object to iframe — other embedding technologies - Learn web development
prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, familiarity with html fundamentals (as covered in getting started with html) and the previous articles in this module.
...ner('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the...
...we are not expecting you to understand all of this content perfectly the first time; we just want to make you aware of this concern, and provide a reference to come back to as you get more experienced and start considering using <iframe>s in your experiments and work.
...And 4 more matches
Responsive images - Learn web development
the content images have been set so that if the body element becomes smaller than the image, the images start to shrink so that they always stay inside the body, rather than overflowing it.
... however, issues arise when you start to view the site on a narrow screen device.
... the header below looks ok, but it's starting to take up a lot of the screen height for a mobile device.
...And 4 more matches
Client-side storage - Learn web development
we'll start off by creating references to all the html features we need to manipulate in this example — we'll create them all as constants, as these references do not need to change in the lifecycle of the app.
...in this section, we'll really only scratch the surface of what it is capable of, but we will give you enough to get started.
... getting started first of all, make local copies of our index.html, style.css, and index-start.js files into a new directory on your local machine.
...And 4 more matches
Video and Audio APIs - Learn web development
our finished example will look (and function) something like the following: getting started to get started with this example, download our media-player-start.zip and unzip it into a new directory on your hard drive.
... if you downloaded our examples repo, you'll find it in javascript/apis/video-audio/start/ at this point, if you load the html you should see a perfectly normal html5 video player, with the native controls rendered.
...first of all, notice the .controls styling: .controls { visibility: hidden; opacity: 0.5; width: 400px; border-radius: 10px; position: absolute; bottom: 20px; left: 50%; margin-left: -200px; background-color: black; box-shadow: 3px 3px 5px black; transition: 1s all; display: flex; } .player:hover .controls, player:focus .controls { opacity: 1; } we start off with the visibility of the custom controls set to hidden.
...And 4 more matches
Arrays - Learn web development
try this: shopping[0] = 'tahini'; shopping; // shopping will now return [ "tahini", "milk", "cheese", "hummus", "noodles" ] note: we've said it before, but just as a reminder — computers start counting from 0!
...so for example: let sequence = [1, 1, 2, 3, 5, 8, 13]; for (let i = 0; i < sequence.length; i++) { console.log(sequence[i]); } you'll learn about loops properly later on (in our looping code article), but briefly, this code is saying: start looping at item number 0 in the array.
...in this line we currently have i <= 0, which is a conditional test that causes the for loop to only run once, because it is saying "stop when i is no longer less than or equal to 0", and i starts at 0.
...And 4 more matches
Basic math in JavaScript — numbers and operators - Learn web development
before you start to get worried about your brain melting, stop right there!
... for a start, we are just going to stick to decimal numbers throughout this course; you'll rarely come across a need to start thinking about other types, if ever.
...for a start, note that you can't apply these directly to a number, which might seem strange, but we are assigning a variable a new updated value, not operating on the value itself.
...And 4 more matches
Git and GitHub - Learn web development
overview vcses are essential for software development: it is rare that you will work on a project completely on your own, and as soon as you start working with other people you start to run the risk of conflicting with each other's work — this is when both of you try to update the same piece of code at the same time.
...you might have started doing this in your own work by creating different versions of the same file, e.g.
... get started prerequisites to use git and github, you need: a desktop computer with git installed on it (see the git downloads page).
...And 4 more matches
CustomizableUI.jsm
the lifetime of your widget should be identical to the lifetime of the add-on - it's process-global, so if you call createwidget on bootstrap's "startup" and destroywidget on bootstrap's "shutdown", that's enough.
... oncustomizestart(awindow) fired when opening customize mode in awindow.
...swidgetremovable(awidgetnodeorwidgetid); bool canwidgetmovetoarea(awidgetid); void getlocalizedproperty(awidget, aprop, aformatargs, adef); void hidepanelfornode(anode); bool isspecialwidget(awidgetid); void addpanelcloselisteners(apanel); void removepanelcloselisteners(apanel); void onwidgetdrag(awidgetid, aarea); void notifystartcustomizing(awindow); void notifyendcustomizing(awindow); void dispatchtoolboxevent(aevent, adetails, awindow); bool isareaoverflowable(aareaid); void settoolbarvisibility(atoolbarid, aisvisible); string getplaceforitem(aelement); bool isbuiltintoolbar(atoolbarid); methods addlistener() add a listener object that will get fired for var...
...And 4 more matches
Index
this is particularly important for applications that might need to close a database and reinitialize nss using a different one, without restarting.
...an arena is requested once processing of a task starts, and all memory allocations that are logically associated to that task are requested from the associated arena.
...new certificate authorities enter the global pki market, and in order to get started with their business, they might make deals with established cas and receive so-called cross-signing-certificates.
...And 4 more matches
Gecko events
is supported: no event_menu_start a menu item on the menu bar has been selected.
... is supported: yes event_menupopup_start a pop-up menu has been displayed.
... is supported: yes event_capture_start a window has received mouse capture.
...And 4 more matches
nsIDBChangeListener
this can be used to filter out events that you yourself started.
...this can be used to filter out events that you yourself started.
...this can be used to filter out events that you yourself started.
...And 4 more matches
nsIDragService
eregion aregion, in unsigned long aactiontype, in nsidomnode aimage, in long aimagex, in long aimagey, in nsidomdragevent adragevent, in nsidomdatatransfer adatatransfer); void invokedragsessionwithselection(in nsiselection aselection, in nsisupportsarray atransferablearray, in unsigned long aactiontype, in nsidomdragevent adragevent, in nsidomdatatransfer adatatransfer); void startdragsession( ) ; void suppress(); void unsuppress(); constants constant value description dragdrop_action_none 0 no action.
... invokedragsession() starts a modal drag session with an array of transferables void invokedragsession( in nsidomnode adomnode, in nsisupportsarray atransferables, in nsiscriptableregion aregion, in unsigned long aactiontype ); parameters adomnode the source node on which the drag gesture was started.
... invokedragsessionwithimage() starts a modal drag session using an image.
...And 4 more matches
nsIMsgCloudFileProvider
void init(in string aaccountkey); parameters uploadfile() starts a file upload for this account.
... acallback the nsirequestobserver callback to receive request start and stop notices.
... acallback the nsirequestobserver for monitoring the start and stop states of the refresh operation.
...And 4 more matches
Thunderbird Configuration Files
some preferences may require that you restart thunderbird in order to take effect.
...to use it, click start > run...
...the path examples above refers to the default profile that is automatically created when you start thunderbird for the first time.
...And 4 more matches
Index - Firefox Developer Tools
16 dom property viewer dom, tools, web development the dom property viewer lets you inspect the properties of the dom as an expandable tree structure, starting from the window object of the current page or the selected iframe.
... 42 dominators view starting in firefox 46, the memory tool includes a new view called the dominators view.
...element is shown overlaid on the page: 65 inspect and select colors guide, inspector, 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: 66 open the inspector guide, inspector, tools there are two main ways to open the inspector: 67 reposition elements in the page starting in firefox 48 you can move absolutely positioned elements by dragging them around the page.
...And 4 more matches
AudioBufferSourceNode - Web APIs
an audiobuffersourcenode can only be played once; after each call to start(), you have to create a new node if you want to play the same sound again.
...indeed, you can use these nodes in a "fire and forget" manner: create the node, call start() to begin playing the sound, and don't even bother to hold a reference to it.
... audiobuffersourcenode.loopstart optional a floating-point value indicating the time, in seconds, at which playback of the audiobuffer must begin when loop is true.
...And 4 more matches
AudioParam.setTargetAtTime() - Web APIs
the settargetattime() method of the audioparam interface schedules the start of a gradual change to the audioparam value.
... syntax var paramref = param.settargetattime(target, starttime, timeconstant); parameters target the value the parameter will start to transition towards at the given start time.
... starttime the time that the exponential transition will begin, in the same time coordinate system as audiocontext.currenttime.
...And 4 more matches
console - Web APIs
WebAPIConsole
however, unlike group() this starts with the inline group collapsed requiring the use of a disclosure button to expand it.
... console.profile() starts the browser's built-in profiler (for example, the firefox performance tool).
... console.time() starts a timer with a name specified as an input parameter.
...And 4 more matches
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.
... this method updates the htmlinputelement.selectionstart, selectionend, and selectiondirection properties in one call.
... note that accordingly to the whatwg forms spec selectionstart, selectionend properties and setselectionrange method apply only to inputs of types text, search, url, tel and password.
...And 4 more matches
Using IndexedDB - Web APIs
start a transaction and make a request to do some database operation, like adding or retrieving data.
...such and such feature will not be available."); } opening a database we start the whole process like this: // let us open our database var request = window.indexeddb.open("mytestdatabase", 3); see that?
... the open request doesn't open the database or start the transaction right away.
...And 4 more matches
PerformanceNavigationTiming - Web APIs
performanceentry.starttime read only returns a domhighrestimestamp with a value of "0".
... performanceentry.duration read only returns a timestamp that is the difference between the performancenavigationtiming.loadeventend and performanceentry.starttime properties.
... performancenavigationtiming.domcontentloadedeventstart read only a domhighrestimestamp representing the time value equal to the time immediately before the user agent fires the domcontentloaded event at the current document.
...And 4 more matches
TouchEvent - Web APIs
touchevent.targettouchesread only a touchlist of all the touch objects that are both currently in contact with the touch surface and were also started on the same element that is the target of the event.
... touchstart sent when the user places a touch point on the touch surface.
... the event's target is the same element that received the touchstart event corresponding to the touch point, even if the touch point has moved outside that element.
...And 4 more matches
Adding 2D content to a WebGL context - Web APIs
« previousnext » once you've successfully created a webgl context, you can start rendering into it.
... a simple thing we can do is draw a simple square untextured plane, so let's start there, by building code to draw a square plane.
... drawing the scene the most important thing to understand before we get started is that even though we're only rendering a square plane object in this example, we're still drawing in 3d space.
...And 4 more matches
WebGL model view projection - Web APIs
to start playing with this idea the previous example can be modified to allow for the use of the w component.
... divide by w an easy way to start getting some perspective on our model of the cube is to take the z coordinate and copy it over to the w coordinate.
...start with the identity matrix: var identity = [ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, ]; mdn.multiplypoint(identity, [2, 3, 4, 1]); //> [2, 3, 4, 1] then move the last column's 1 up one space.
...And 4 more matches
Using the Web Speech API - Web APIs
chrome support as mentioned earlier, chrome currently supports speech recognition with prefixed properties, therefore at the start of our code we include these lines to feed the right objects to chrome, and any future implementations that might support the features without a prefix: var speechrecognition = speechrecognition || webkitspeechrecognition var speechgrammarlist = speechgrammarlist || webkitspeechgrammarlist var speechrecognitionevent = speechrecognitionevent || webkitspeechrecognitionevent the grammar the next ...
...we also set a few other properties of the recognition instance before we move on: speechrecognition.continuous: controls whether continuous results are captured (true), or just a single result each time recognition is started (false).
...but it is not needed for this simple demo, so we are just specifying one (which is actually the 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 4 more matches
Using CSS gradients - CSS: Cascading Style Sheets
we'll start by introducing linear gradients, then introduce features that are supported in all gradient types using linear gradients as the example, then move on to radial, conic and repeating gradients using linear gradients a linear gradient creates a band of colors that progress in a straight line.
...if you specify the location as a percentage, 0% represents the starting point, while 100% represents the ending point; however, you can use values outside that range if necessary to get the effect you want.
... example: closest-side for ellipses this example uses the closest-side size value, which means the size is set by the distance from the starting point (the center) to the closest side of the enclosing box.
...And 4 more matches
box-pack - CSS: Cascading Style Sheets
WebCSSbox-pack
/* keyword values */ box-pack: start; box-pack: center; box-pack: end; box-pack: justify; /* global values */ box-pack: inherit; box-pack: initial; box-pack: unset; the direction of layout depends on the element's orientation: horizontal or vertical.
... values start the box packs contents at the start, leaving any extra space at the end.
... center the box packs contents in the center, dividing any extra space equally between the start and the end.
...And 4 more matches
grid-column - CSS: Cascading Style Sheets
the grid-column css shorthand property specifies a grid item's size and location within a grid column by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start and inline-end edge of its grid area.
... constituent properties this property is a shorthand for the following css properties: grid-column-end grid-column-start syntax this property is specified as one or two <grid-line> values.
...the grid-column-start longhand is set to the value before the slash, and the grid-column-end longhand is set to the value after the slash.
...And 4 more matches
grid-row - CSS: Cascading Style Sheets
WebCSSgrid-row
the grid-row css shorthand property specifies a grid item’s size and location within the grid row by contributing a line, a span, or nothing (automatic) to its grid placement, thereby specifying the inline-start and inline-end edge of its grid area.
... if two <grid-line> values are specified, the grid-row-start longhand is set to the value before the slash, and the grid-row-end longhand is set to the value after the slash.
... constituent properties this property is a shorthand for the following css properties: grid-row-end grid-row-start syntax /* keyword values */ grid-row: auto; grid-row: auto / auto; /* <custom-ident> values */ grid-row: somegridarea; grid-row: somegridarea / someothergridarea; /* <integer> + <custom-ident> values */ grid-row: somegridarea 4; grid-row: 4 somegridarea / 6; /* span + <integer> + <custom-ident> values */ grid-row: span 3; grid-row: span somegridarea; grid-row: 5 somegridarea span; grid-row: span 3 / 6; grid-row: span somegridarea / span someothergridarea; grid-row: 5 somegridarea span / 2 span; /* global values */ grid-row: inherit; grid-row: initial; grid-row: unset; values auto is a keyword indicating that the property contributes nothing to the grid item’s p...
...And 4 more matches
text-align - CSS: Cascading Style Sheets
syntax /* keyword values */ text-align: left; text-align: right; text-align: center; text-align: justify; text-align: justify-all; text-align: start; text-align: end; text-align: match-parent; /* character-based alignment in a table column */ text-align: "."; text-align: "." center; /* block alignment values (non-standard syntax) */ text-align: -moz-center; text-align: -webkit-center; /* global values */ text-align: inherit; text-align: initial; text-align: unset; the text-align property is specified in one of the following ways: usin...
...g the keyword values start, end, left, right, center, justify, justify-all, or match-parent.
... values start the same as left if direction is left-to-right and right if direction is right-to-left.
...And 4 more matches
HTTP Messages - HTTP
WebHTTPMessages
http requests, and responses, share similar structure and are composed of: a start-line describing the requests to be implemented, or its status of whether successful or a failure.
... this start-line is always a single line.
...the presence of the body and its size is specified by the start-line and http headers.
...And 4 more matches
Array.prototype.fill() - JavaScript
the fill() method changes all elements in an array to a static value, from a start index (default 0) to an end index (default array.length).
... syntax arr.fill(value[, start[, end]]) parameters value value to fill the array with.
... (note all elements in the array will be this exact value.) start optional start index, default 0.
...And 4 more matches
Setting Up a Development Environment - Archive of obsolete content
build system let's start by downloading the project used to build the second version of hello world, from the exercise in the last section.
... in the "start in" textbox you should choose %p (directory path of active project).
...if firefox is open at the time you run "make install", you'll have to restart it in order to see the changes.
...And 3 more matches
Tabbed browser - Archive of obsolete content
tabopen", exampletabadded, false); container.addeventlistener("tabmove", exampletabmoved, false); container.addeventlistener("tabclose", exampletabremoved, false); // when no longer needed container.removeeventlistener("tabopen", exampletabadded, false); container.removeeventlistener("tabmove", exampletabmoved, false); container.removeeventlistener("tabclose", exampletabremoved, false); note: starting in gecko 1.9.1, there's an easy way to listen on progress events on all tabs.
... notification when a tab's attributes change requires gecko 2.0(firefox 4 / thunderbird 3.3 / seamonkey 2.1) starting in gecko 2.0, you can detect when a tab's attributes change by listening for the tabattrmodified event.
...hat's changed on the tab } // during initialization var container = gbrowser.tabcontainer; container.addeventlistener("tabattrmodified", exampletabattrmodified, false); // when no longer needed container.removeeventlistener("tabattrmodified", exampletabattrmodified, false); notification when a tab is pinned or unpinned requires gecko 2.0(firefox 4 / thunderbird 3.3 / seamonkey 2.1) starting in gecko 2.0, tabs can be "pinned"; that is, they become special application tabs ("app tabs"), which are pinned to the beginning of the tab bar, and show only the favicon.
...And 3 more matches
Creating a Firefox sidebar extension - Archive of obsolete content
introduction this article is a quick start for the creation of a new sidebar for firefox.
...the goal is creating an empty sidebar that can be used as start for new sidebar applications.
... pre-requisites this article is a quick start, it won't explain all elements of xul, packaging and xpi's.
...And 3 more matches
Creating regular expressions for a microsummary generator - Archive of obsolete content
urls 101 urls for auction item pages on ebay, like those on many other sites, usually start with the string "http://" and contain a domain name, a file path, and some query parameters.
... matching from the start of the url while this expression matches the url, it also matches other urls that contain this url in their query parameters, for example: http://www.example.com/redirect.php?url=http://cgi.ebay.com/ws/ebayisapi.dll?viewitem&item=280018439106 that's probably not what we want, since urls that contain our example url probably aren't auction item pages themselves.
... in order to restrict our regular expression to urls that start with our example url, we prepend a caret (^) to the regular expression: ^http://cgi\.ebay\.com/ws/ebayisapi\.dll\?viewitem&item=280018439106 when a caret is the first character of a regular expression, it signifies that the expression must be found at the beginning of the string being matched.
...And 3 more matches
Drag and Drop Example - Archive of obsolete content
this buttons will respond to the draggesture event and start a drag.
... <vbox> <button label="button" elem="button" ondraggesture="nsdraganddrop.startdrag(event, listobserver)"/> <button label="check box" elem="checkbox" ondraggesture="nsdraganddrop.startdrag(event, listobserver)"/> <button label="text box" elem="textbox" ondraggesture="nsdraganddrop.startdrag(event, listobserver)"/> </vbox> the nsdraganddrop object will be called to do most of the work.
...first, the listobserver which needs a function to handle the start of the drag.
...And 3 more matches
Filtering - Archive of obsolete content
this method will remove all of the existing generated content, delete all of the internal information pertaining to the results, and start again as if the template were just being examined for the first time.
...you might wonder what the ref attribute or starting point should be set to since there is no container for the countries.
... actually, we can just use the type as the starting point.
...And 3 more matches
Manifest Files - Archive of obsolete content
the manifest files in the chrome directory will be examined when a mozilla application starts up to see what packages are installed.
... note: starting in gecko 2.0, only the file named chrome.manifest is read automatically; if you need to read multiple manifest files, use the manifest command in that file to import additional manifests.
...of course, you will need to restart the browser for the changes to take effect.
...And 3 more matches
Creating a Windows Inno Setup installer for XULRunner applications - Archive of obsolete content
the tutorial here uses the my app example from the article getting started with xulrunner.
...if you want to edit scripts, you should get the quickstart pack (which includes istool, the script editor.
... however, if you don't get the quickstart pack, you can later get istool from inno setup third-party files.
...And 3 more matches
Debugging a XULRunner Application - Archive of obsolete content
console to enable a console on windows, start xulrunner with the -console argument.
... to output dump calls instead to a file, set browser.dom.window.dump.file to the file destination where the log should be created and restart the application.
... javascript console to enable the js console, start xulrunner with the -jsconsole argument.
...And 3 more matches
SAX - Archive of obsolete content
starting with firefox 2, a sax parser is available to xul applications and extensions.
... quick start the sax parser functionality is available through the xml reader component.
...after the parsing process is started, handlers receive a series of callbacks for the content of xml being parsed.
...And 3 more matches
Common causes of memory leaks in extensions - Extensions
problems in bootstrapped (restartless) add-ons bootstrapped extensions use a bootstrap.js compartment.
...if a bootstrapped (restartless) extension fails to clean up event listeners when disabled or removed, the listeners will still reference the enclosing scope — usually the bootstrap.js sandbox — and therefore keep that scope (and its enclosing compartment) alive until the window is unloaded.
...it is part of edward lee's restartless boilerplate.
...And 3 more matches
Building up a basic demo with Babylon.js - Game development
environment setup to start developing with babylon.js, you don't need much.
... you should start off by: making sure you are using a modern browser with good webgl support, such as the latest firefox or chrome.
... initialising the babylon.js engine we have to create a babylon.js engine instance first (passing it the <canvas> element to render on) before we start developing our game.
...And 3 more matches
Building up a basic demo with PlayCanvas editor - Game development
creating an account the playcanvas editor is free — all you have to do to begin with is register your account and login: when you first sign up, you are taken straight into the editor and given a simple starter tutorial involving editing a 3d rolling ball game.
... creating a new project start a brand new project by clicking on the new button: the resulting dialog box will show a few different options.
... there are starter kits available, but we don't want to load models or start a platform game.
...And 3 more matches
Desktop gamepad controls - Game development
if(gamepadapi.active) { if(!this.textgamepad.visible) { this.textgamepad.visible = true; } gamepadapi.update(); if(gamepadapi.buttons.pressed('start')) { // start the game } if(gamepadapi.buttons.pressed('x')) { // turn on/off the sounds } if(gamepadapi.buttons.pressed('y','hold')) { if(!this.screengamepadhelp.visible) { this.screengamepadhelp.visible = true; } } else { if(this.screengamepadhelp.visible) { ...
... this.screengamepadhelp.visible = false; } } } } when pressing the start button the relevant function will be called to begin the game, and the same approach is used for turning the audio on and off.
... on-screen instructions when the game is started, some introductory text is shown that shows you available controls — we are already detecting if the game is launched on desktop or mobile then showing a relevant message for the device, but we can go even further, to allow for the presence of a gamepad: create() { // ...
...And 3 more matches
Visual-js game engine - Game development
more texture downloads 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 ?
...manual start from cmd : server_folder/node editor.js after starting on-page-editor open browser icon to open internet browser in editor mode .
... see video explanation : if you use editor.js to visual create game object method , you must start ***node build_from_editor_to_visual_js_file.js*** on the end of work.
...And 3 more matches
Visual typescript game engine - Game development
*/ private appusebroadcaster: boolean = false; /** * possible variant by default : * "register", "login" */ private startuphtmlform: string = "register"; private gamelist: any[]; /** * implement default gameplay variable's */ private defaultgameplaylevelname: string = "level1"; private autostartgameplay: boolean = true; start the dependency system from app.ts the first game template is platformer.
...class gameplay extends platformer, it good for start.
... class starter is base class for my canvas part and matter.ts (matter.js) implementation.
...And 3 more matches
Test your skills: Grid Layout - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... grid layout three there are four direct children in this grid; the starting point has them displayed using auto-placement.
...And 3 more matches
How CSS is structured - Learn web development
in the getting started with css, we linked an external stylesheet to our web page.
...we have already discovered a variety of selectors in the getting started with css tutorial.
... each css rule starts with a selector—or a list of selectors—in order to tell the browser which element or elements the rules should apply to.
...And 3 more matches
Fundamental text and font styling - Learn web development
overview: styling text next in this article we'll start you on your journey towards mastering text styling with css.
...it starts at the top left of the content area (or the top right, in the case of rtl language content), and flows towards the end of the line.
... p { font-family: "trebuchet ms", verdana, sans-serif; } in such a case, the browser starts at the beginning of the list and looks to see if that font is available on the machine.
...And 3 more matches
Front-end web developer - Learn web development
prerequisites you don't need any previous knowledge to start this course.
... if you are not sure if front-end web development is for you, and/or you want a gentle introduction before starting a longer and more complete course, work through our getting started with the web module first.
... let's get started.
...And 3 more matches
Advanced text formatting - Learn web development
prerequisites: basic html familiarity, as covered in getting started with html.
...ner('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the...
...ner('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the...
...And 3 more matches
What’s in the head? Metadata in HTML - Learn web development
prerequisites: basic html familiarity, as covered in getting started with html.
...let's get started.
...h1> element appears on the page when loaded in the browser — generally this should be used once per page, to mark up the title of your page content (the story title, or news headline, or whatever is appropriate to your usage.) the <title> element is metadata that represents the title of the overall html document (not the document's content.) active learning: inspecting a simple example to start off this active learning, we'd like you to go to our github repo and download a copy of our title-example.html page.
...And 3 more matches
Test your skills: Arrays - Learn web development
arrays 1 let's start off with some basic array practice.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
...And 3 more matches
Ember interactivity: Events, classes and state - Learn web development
previous overview: client-side javascript frameworks next at this point we'll start adding some interactivity to our app, providing the ability to add and display new todo items.
... using the service from our header component now that we've defined a way to add todos, we can interact with this service from the header.js input component to actually start adding them.
...replace it with the following: this.todos.add(text); if we try this out in the todo app in our browser (npm start, go to localhost:4200), it will look like nothing happens after hitting the enter key (although the fact that the app builds without any errors is a good sign).
...And 3 more matches
Beginning our React todo list - Learn web development
make sure you’re starting in the app's root directory!
... if you stopped your server to do the terminal tasks mentioned above, you’ll have to start it again using npm start.
... project starter code as a starting point for this project, we're going to provide two things: an app() function to replace the one you have now, and some css to style your app.
...And 3 more matches
Introducing a complete toolchain - Learn web development
let's start working on these, beginning with our development environment.
... start off by opening your terminal, and navigating to a place that you'll be able to find and get to easily.
... making sure you are inside the root of the will-it-miss directory, enter the following command to start git’s source control functionality working on the directory: git init this means that you'll now be able to start storing revisions to the folder's contents, saving it to a remote repository, etc.
...And 3 more matches
Package management basics - Learn web development
using the package ecosystem let’s run through an example to get you started with using a package manager and registry to install a command line utility.
... version: the starting version number for the app: again, just press return to accept the default 1.0.0.
...for a start, there is now a local web server running at http://localhost:1234.
...And 3 more matches
Learn web development
this set of articles aims to provide complete beginners to web development with all that they need to start coding websites.
... the aim of this area of mdn is not to take you from "beginner" to "expert" but to take you from "beginner" to "comfortable." from there, you should be able to start making your way, learning from the rest of mdn, and other intermediate to advanced resources that assume a lot of previous knowledge.
...we have started keeping learning area release notes to show what has changed — keep checking back frequently!
...And 3 more matches
Debugging Table Reflow
l> <col width="50%"> <col width="1*"> <col> </colgroup> <tr> <td style="width:80px">cell 1</td> <td>cell 2</td> <td>cell 3</td> <td>cell 4</td> </tr> </table> rendering: <colgroup><col><col width="50%"><col width="1*"><col></colgroup>cell 1cell 2cell 3cell 4 it will produce the following log at the entrance of assignnonpctcolwidths: assignnonpctcolwidths en max=4500 count=0 ***start table dump*** mcolwidths=-1 -1 -1 -1 col frame cache -> 0=00b93138 1=00b931f0 2=024dd728 3=024dd780 **start col dump** colindex=0 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 **end col dump** **start col dump** colindex=1 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 **end col dump** **start col dump** colindex=2 isanonymous=0 constraint=0 widths=...
...-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 **end col dump** **start col dump** colindex=3 isanonymous=0 constraint=0 widths=-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 **end col dump** ***end table dump*** the en stands for entrance (ex for leaving a routine).
...leaving assignnonpctcolwidths shows that already to all columns a width of 360 twips has been assigned assignnonpctcolwidths ex ***start table dump*** mcolwidths=360 360 360 360 col frame cache -> 0=00b93138 1=00b931f0 2=024dd728 3=024dd780 **start col dump** colindex=0 isanonymous=0 constraint=0 widths=360 540 1230 -1 -1 -1 -1 -1 -1 360 **end col dump** **start col dump** colindex=1 isanonymous=0 constraint=0 widths=360 540 -1 -1 -1 -1 -1 -1 -1 360 **end col dump** **start col dump** colindex=2 isanonymous=0 constraint...
...And 3 more matches
Debugging on Mac OS X
instead, add the following to your $home/.lldbinit: # this automatically sources the mozilla project's .lldbinit as soon as lldb # starts or attaches to a mozilla app (that's in an object directory).
... (xcode always runs lldb from "/", # regardless of what directory xcode was started from, and regardless of the # value of the "custom working directory" field in the scheme's run options.
... # therefore setting `settings set target.load-cwd-lldbinit true` can't help us # without xcode providing that functionality.) # # the following works by setting a one-shot breakpoint to break on a function # that we know will both run early (which we want when we start first start the # app) and run frequently (which we want so that it will trigger asap if we # attach to an already running app).
...And 3 more matches
The Firefox codebase: CSS Guidelines
boilerplate make sure each file starts with the standard copyright header (see license boilerplate).
... using variables use the variable according to its naming do this: xul|tab:hover { background-color: var(--in-content-box-background-hover); } not this: #certificateerrordebuginformation { background-color: var(--in-content-box-background-hover); } localization text direction for margins, padding and borders, use inline-start/inline-end rather than left/right.
... example: use margin-inline-start: 3px; instead of margin-left: 3px.
...And 3 more matches
Gecko Logging
example usage code sample #include "mozilla/logging.h" using mozilla::loglevel; static mozilla::lazylogmodule slogger("example_logger"); static void dostuff() { moz_log(slogger, loglevel::info, ("doing stuff.")); int i = 0; int start = time::nowms(); moz_log(slogger, loglevel::debug, ("starting loop.")); while (i++ < 10) { moz_log(slogger, loglevel::verbose, ("i = %d", i)); } // only calculate the elapsed time if the warning level is enabled.
... if (moz_log_test(slogger, loglevel::warning)) { int elapsed = time::nowms() - start; if (elapsed > 1000) { moz_log(slogger, loglevel::warning, ("loop took %dms!", elapsed)); } } if (i != 10) { moz_log(slogger, loglevel::error, ("i should be 10!")); } } enabling logging the log level for a module is controlled by setting an environment variable before launching the application.
... set moz_log="example_logger:3" in the windows command prompt (cmd.exe), don't use quotes: set moz_log=example_logger:3 if you want this on geckoview example, use the following adb command to launch process: adb shell am start -n org.mozilla.geckoview_example/.geckoviewactivity --es env0 "moz_log=example_logger:3" there are special module names to change logging behavior.
...And 3 more matches
Obsolete Build Caveats and Tips
this note below seems redundant as this is true by default https://msdn.microsoft.com/en-us/library/dh8che7s%28v=vs.110%29.aspx note: starting with gecko 7.0, you should no longer include "-zc:wchar_t-" in the command line when building on windows.
...to get this code, do the following: # pull the mozilla source to the folder 191src/ - may take a while # as hundreds of megabytes of history is downloaded to .hg hg clone https://hg.mozilla.org/releases/mozilla-1.9.1/ 191src cd 191src note: starting with gecko 5.0, you can actually build firefox without a .mozconfig file.
... starting with gecko 12.0, this sdk is necessary.
...And 3 more matches
Contributing to the Mozilla code base
if you have any difficulties getting involved or finding answers to your questions, please come and ask your questions in our chatroom, where we can help you get started.
... we know even before you start contributing that getting set up to work on firefox and finding a bug that's a good fit for your skills can be a challenge.
... perhaps you do not know programming yet, but you want to start learning?
...And 3 more matches
How Mozilla determines MIME Types
similar handling happens for <a href="..." type="foo/bar">, starting in mozilla 1.6alpha.
...however, starting in mozilla 1.7alpha, mozilla does do content sniffing, like this: when the content-type sent by the server is one of (case-sensitively) text/plain text/plain; charset=iso-8859-1 text/plain; charset=iso-8859-1 and the server did not send a content-encoding header, mozilla will sniff the first block of data it gets and check for non-text bytes.
... unknown decoder located at netwerk/streamconv/converters/nsunknowndecoder.cpp, the interesting part starts at line 287, the ssnifferentries array together with the determinecontenttype function.
...And 3 more matches
Addon
for some add-ons this will change immediately based on the appdisabled and userdisabled properties; for others it will only change after an application restart.
...operations are generally deferred when a restart is necessary to accomplish them.
... pendingupgrade read only addon if this add-on will be replaced on the next restart, this property will hold the new addon object.
...And 3 more matches
JNI.jsm
working with arrays creating/preallocating a typed array methods cdata .get(number aindex); cdata .getelements(number astart, number alength); void .set(number aindex, cdata avalue); void .setelements(number astart, [array, size_is(arr.length > number anynumber > 0)] in cdata avalsarray); .get() gets the value of the element in the array at given aindex.
... .getelements() returns a new cdata object of the section of the array specified by astart and ending at position astart + alength.
... void setelements(number astart, number alength); parameters astart the position to start setting elements of the array in.
...And 3 more matches
OS.File for the main thread
using os.file from a jsm to import os.file into your chrome code, add the following line at the start of your script: components.utils.import("resource://gre/modules/osfile.jsm") promises before using os.file from the main thread, you need some understanding of the promise library.
...starting with gecko 27, you may use the append flag instead.
...when you are done with it, like in shutdown of restartless add-on, you should close the file so it becomes editable again.
...And 3 more matches
PKCS11 Implement
general-purpose functions c_initialize the nss calls c_initialize on startup or when it loads a new module.
... c_getfunctionlist the nss calls c_getfunctionlist on startup or when it loads a new module.
... c_getinfo the nss calls c_getinfo on startup or when it loads a new module.
...And 3 more matches
Setting up an update server
on macos, you can get the exact size of your mar by running the command: stat -f%z <filename> or on linux, the same command would be: stat --format "%s" <filename> starting your update server now, start an update server to serve the update files on port 8000.
...remember to navigate to the correct directory before starting the server.
... this is the python2 command: python -m simplehttpserver 8000 or, this is the python3 command: python3 -m http.server 8000 if you aren't sure that you started the server correctly, try using a web browser to navigate to http://127.0.0.1:8000/update.xml and make sure that you get the xml file you created earlier.
...And 3 more matches
Animated PNG graphics
MozillaTechAPNG
a decoder which detects an error before the animation has started should display the default image.
... byte offset field name field type description 0 sequence_number unsigned int sequence number of the animation chunk, starting with 0.
... byte offset field name field type description 0 sequence_number unsigned int sequence number of the animation chunk, starting from 0.
...And 3 more matches
Finishing the Component
the component will be recognized by xpcom and registered with the category manager so that it starts up when xpcom initializes.
... when the component starts up, it populates a list of urls read in from a file stored next to the gecko binary on the local system.
...you have already registered as a category to receive startup notification.
...And 3 more matches
nsDependentCSubstring
methods constructors void nsdependentcsubstring(const nsacstring_internal&, pruint32, pruint32) - source parameters nsacstring_internal& str pruint32 startpos pruint32 length void nsdependentcsubstring(const char*, const char*) - source parameters char* start char* end void nsdependentcsubstring(const nsreadingiterator<char>&, const nsreadingiterator<char>&) - source parameters nsreadingiterator<char>& start nsreadingiterator<char>& end void nsdependentcsubstring() - source rebind void rebind(const nsacstring_internal&, pruint3...
...2, pruint32) - source parameters nsacstring_internal& <anonymous> pruint32 startpos pruint32 length void rebind(const char*, const char*) - source parameters char* start char* end beginreading char* beginreading() const - source reading iterators nsreadingiterator<char>& beginreading(nsreadingiterator<char>&) const - source deprecated reading iterators parameters nsreadingiterator<char>& iter char*& beginreading(const char*&) const - source parameters char*& iter endreading char* endreading() const - source nsreadingiterator<char>& endreading(nsreadingiterator<char>&) const - source parameters nsreadingiterator<char>& iter char*& endreading(const char*&) const - source parameters char*& iter beginwriting char* beginwriting() - source writ...
...rnal& operator=(const nsacstring_internal&) - source parameters nsacstring_internal& str nsacstring_internal& operator=(const nscsubstringtuple&) - source parameters nscsubstringtuple& tuple adopt void adopt(char*, pruint32) - source parameters char* data pruint32 length replace void replace(pruint32, pruint32, char) - source buffer manipulation parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint32, const nsacstring_internal&) - source parameters pruint32 cutstart pruint32 cutlength nsacstring_internal& str void replace(pruint32, pruint32, const nscsubstringtuple&) - source param...
...And 3 more matches
nsDependentSubstring
methods constructors void nsdependentsubstring(const nsastring_internal&, pruint32, pruint32) - source parameters nsastring_internal& str pruint32 startpos pruint32 length void nsdependentsubstring(const prunichar*, const prunichar*) - source parameters prunichar* start prunichar* end void nsdependentsubstring(const nsreadingiterator<short unsigned int>&, const nsreadingiterator<short unsigned int>&) - source parameters nsreadingiterator<short unsigned int>& start nsreadingiterator<short unsigned int>& end void nsdependentsubstring...
...() - source rebind void rebind(const nsastring_internal&, pruint32, pruint32) - source parameters nsastring_internal& <anonymous> pruint32 startpos pruint32 length void rebind(const prunichar*, const prunichar*) - source parameters prunichar* start prunichar* end beginreading prunichar* beginreading() const - source reading iterators nsreadingiterator<short unsigned int>& beginreading(nsreadingiterator<short unsigned int>&) const - source deprecated reading iterators parameters nsreadingiterator<short unsigned int>& iter prunichar*& beginreading(const prunichar*&) const - source parameters prunichar*& iter endreading prunichar* endreading() const - source nsreadingiterator<short unsigned int>& endreading(nsreadingiterator<short unsigned int>&) const...
...ator=(const nsastring_internal&) - source parameters nsastring_internal& str nsastring_internal& operator=(const nssubstringtuple&) - source parameters nssubstringtuple& tuple adopt void adopt(prunichar*, pruint32) - source parameters prunichar* data pruint32 length replace void replace(pruint32, pruint32, prunichar) - source buffer manipulation parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length void replace(pruint32, pruint32, const nsastring_internal&) - source parameters pruint32 cutstart pruint32 cutlength nsastring_internal& str void replace(pruint32, pruint32, const nssubstringtuple&) - so...
...And 3 more matches
IAccessibleTable
caption([out] iunknown accessible ); [propget] hresult childindex([in] long rowindex, [in] long columnindex, [out] long cellindex ); [propget] hresult columndescription([in] long column, [out] bstr description ); [propget] hresult columnextentat([in] long row, [in] long column, [out] long ncolumnsspanned ); [propget] hresult columnheader([out] iaccessibletable accessibletable, [out] long startingrowindex ); [propget] hresult columnindex([in] long cellindex, [out] long columnindex ); [propget] hresult iscolumnselected([in] long column, [out] boolean isselected ); [propget] hresult isrowselected([in] long row, [out] boolean isselected ); [propget] hresult isselected([in] long row, [in] long column, [out] boolean isselected ); [propget] hresult modelchange([out] ia2tablemodelcha...
...wcolumnextentsatindex([in] long index, [out] long row, [out] long column, [out] long rowextents, [out] long columnextents, [out] boolean isselected ); [propget] hresult rowdescription([in] long row, [out] bstr description ); [propget] hresult rowextentat([in] long row, [in] long column, [out] long nrowsspanned ); [propget] hresult rowheader([out] iaccessibletable accessibletable, [out] long startingcolumnindex ); [propget] hresult rowindex([in] long cellindex, [out] long rowindex ); hresult selectcolumn([in] long column ); [propget] hresult selectedchildren([in] long maxchildren, [out, size_is(,maxchildren), length_is(, nchildren)] long children, [out] long nchildren ); [propget] hresult selectedcolumns([in] long maxcolumns, [out, size_is(,maxcolumns), length_is(, ncolumns)] long ...
...[propget] hresult columnheader( [out] iaccessibletable accessibletable, [out] long startingrowindex ); parameters accessibletable the column header.
...And 3 more matches
mozITXTToHTMLConv
last changed in gecko 1.8.1 (firefox 2 / thunderbird 2 / seamonkey 1.1) inherits from nsistreamconverter implemented by @mozilla.org/txttohtmlconv;1 as a service: var ios = components.classes["@mozilla.org/txttohtmlconv;1"] .getservice(components.interfaces.mozitxttohtmlconv); method overview unsigned long citeleveltxt(in wstring line, out unsigned long loglinestart) void findurlinplaintext(in wstring text, in long alength, in long apos, out long astartpos, out long aendpos) wstring scanhtml(in wstring text, in unsigned long whattodo) wstring scantxt(in wstring text, in unsigned long whattodo) constants conversion control attributes these bits allow you to control the conversion of text into html.
... unsigned long citeleveltxt( in wstring line, out unsigned long loglinestart ); parameters line the original line of text, which may begin with one or more cite characters such as ">".
... loglinestart on output, this parameter is set to indicate the offset into the string of the first non-cite character.
...And 3 more matches
nsIChannel
setting contenttype after onstartrequest has been fired or after open() is called will override the type determined by the channel.
... setting contenttype between the time that asyncopen() is called and the time when onstartrequest is fired has undefined behavior at this time.
... this flag 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).
...And 3 more matches
nsIDOMMozNetworkStatsManager
you can test for the presence of the service as follows, for example: if ("moznetworkstats" in navigator) { /* networkstats is available */ } else { alert("i'm sorry, but networkstats services are not supported."); } method overview nsidomdomrequest getsamples(in nsisupports network, in jsval start, in jsval end, [optional] in jsval options /* networkstatsgetoptions */); nsidomdomrequest addalarm(in nsisupports network, in long threshold, [optional] in jsval options /* networkstatsalarmoptions */); nsidomdomrequest getallalarms([optional] in nsisuppor...
... nsidomdomrequest getsamples(in nsisupports network, in jsval start, in jsval end, [optional] in jsval options /* networkstatsgetoptions */); parameters network the origin of the data.
... start a date object representing the beginning of data measurement.
...And 3 more matches
nsIDOMSimpleGestureEvent
mozmagnifygesturestart - generated when the user begins the magnify ("pinch") gesture.
...the "delta" value represents the movement since the last mozmagnifygesturestart or mozmagnifygestureupdate event.
...if you only want to receive a single event when the magnify gesture is complete, you only need to hook this event and can safely ignore the mozmagnifygesturestart and the mozmagnifygestureupdate events.
...And 3 more matches
nsIDocShell
setting this will make it take effect starting with the next document loaded in the docshell.
... note: starting in gecko 8.0, isactive is false for documents in minimized windows.
... busy_flags_before_page_load 2 returned by the busyflags attribute when the nsidocshell has started loading a document from the network, but no data has been received yet.
...And 3 more matches
nsIWindowsRegKey
nsiwindowsregkey openchild(in astring relpath, in unsigned long mode); acstring readbinaryvalue(in astring name); unsigned long long readint64value(in astring name); unsigned long readintvalue(in astring name); astring readstringvalue(in astring name); void removechild(in astring relpath); void removevalue(in astring name); void startwatching(in boolean recurse); void stopwatching(); void writebinaryvalue(in astring name, in acstring data); void writeint64value(in astring name, in unsigned long long data); void writeintvalue(in astring name, in unsigned long data); void writestringvalue(in astring name, in astring data); attributes attribute type description ...
...this method will always return false if startwatching() was not called.
...iswatching() this method returns true if the key is being watched for changes (that is, if startwatching() was called).
...And 3 more matches
Storage
getting started this document covers the storage api and some peculiarities of sqlite.
... binding multiple sets of parameters starting in gecko 1.9.2 (firefox 3.6), there's a new, more convenient way to bind multiple sets of parameters at once prior to executing your statement asynchronously.
... executing a statement you may execute statements either synchronously (which is supported in firefox gecko 1.8 and 1.9) or asynchronously (starting in gecko 1.9.1).
...And 3 more matches
Mail composition back end
nsimsgsendlistener the following describes the methods of the nsimsgsendlistener interface: onstartsending the onstartsending interface is called when the sending operation has begun.
... ns_imethod onstartsending(const char *amsgid, - the message id for the message being sent pruint32 amsgsize) = 0; - the total message size for the message being sent onprogress the onprogress interface is called with progress notification on the send operation.
... onstartcopy the onstartcopy interface is called when the copy operation has begun.
...And 3 more matches
Add to iPhoto
choose it, and iphoto will start up (if it's not already running) and import the image.
... hooking up to the context menu on startup, we find the content area's context menu and add an event listener to it that will be called when the context menu is displayed.
... var elemname = node.localname.touppercase(); if (elemname == "img") { return node; } // nope, return null return null; } this starts by getting the node the popup was opened from.
...And 3 more matches
Using COM from js-ctypes
this started out with dynamic data exchange (dde), which was superseded by object linking and embedding (ole) and later by the component object model (com), automation objects, activex controls, and the .net framework.
... speech synthesis example let's start with following c++ code, which invokes microsoft speech api and says "hello, firefox!" with system default voice, then wait until the speaking done.
... #include <sapi.h> struct myispvoicevtbl; struct myispvoice { struct myispvoicevtbl* lpvtbl; }; struct myispvoicevtbl { /* start inherit from iunknown */ void* queryinterface; void* addref; ulong (__stdcall *release)(struct myispvoice*); /* end inherit from iunknown */ /* start inherit from ispnotifysource */ void* setnotifysink; void* setnotifywindowmessage; void* setnotifycallbackfunction; void* setnotifycallbackinterface; void* setnotifywin32event; void* waitfornotifyevent; ...
...And 3 more matches
All keyboard shortcuts - Firefox Developer Tools
starting in firefox 71.
... end end end expand currently selected node right arrow right arrow right arrow collapse currently selected node left arrow left arrow left arrow (when a node is selected) move inside the node so you can start stepping through attributes.
... enter return enter step forward through the attributes of a node tab tab tab step backward through the attributes of a node shift + tab shift + tab shift + tab (when an attribute is selected) start editing the attribute enter return enter hide/show the selected node h h h focus on the search box in the html pane ctrl + f cmd + f ctrl + f edit as html f2 f2 f2 stop editing html f2 / ctrl +enter f2 / cmd + return f2 / ctrl + enter copy the selected node's outer html ctrl + c cmd + c ctrl + c scroll the selected node into view s s s find the next match in the markup, when searching is active enter return enter ...
...And 3 more matches
about:debugging - Firefox Developer Tools
at the moment it supports three main sorts of targets: restartless add-ons, tabs, and workers.
... to start a debugging session, first open the page that you wish to debug and then click connect next to the device name to open a connection to it.
... starting in firefox 78, the url bar is editable, so that you can change the url used by the browser on the remote device, by typing in firefox for desktop.
...And 3 more matches
AudioBufferSourceNode.loopEnd - Web APIs
the loopend property of the audiobuffersourcenode interface specifies is a floating point number specifying, in seconds, at what offset into playing the audiobuffer playback should loop back to the time indicated by the loopstart property.
... syntax audiobuffersourcenode.loopend = endoffsetinseconds; var endoffsetinseconds = audiobuffersourcenode.loopend; value a floating-point number indicating the offset, in seconds, into the audio buffer at which each loop will loop return to the beginning of the loop (that is, the current play time gets reset to audiobuffersourcenode.loopstart).
...buttons are provided to play and stop the audio playback, and slider controls are used to change the playbackrate, loopstart and loopend properties on the fly.
...And 3 more matches
Using the CSS Painting API - Web APIs
to programmatically create an image used by a css stylesheet we need to work through a few steps: define a paint worklet using the registerpaint() function register the worklet include the paint() css function to elaborate over these steps, we're going to start by creating a half-highlight background, like on this header: css paint worklet in an external script file, we employ the registerpaint() function to name our css paint worklet.
... registerpaint('headerhighlight', class { static get inputproperties() { return ['--highcolour']; } static get contextoptions() { return {alpha: true}; } paint(ctx, size, props) { /* set where to start the highlight & dimensions */ const x = 0; const y = size.height * 0.3; const blockwidth = size.width * 0.33; const highlightheight = size.height * 0.85; const color = props.get('--highcolour'); ctx.fillstyle = color; ctx.beginpath(); ctx.moveto( x, y ); ctx.lineto( blockwidth, y ); ctx.lineto( blockwidth + highlightheight, highlightheight ); ctx.lineto( x, highlig...
...htheight ); ctx.lineto( x, y ); ctx.closepath(); ctx.fill(); /* create the dashes */ for (let i = 0; i < 4; i++) { let start = i * 2; ctx.beginpath(); ctx.moveto( (blockwidth) + (start * 10) + 10, y ); ctx.lineto( (blockwidth) + (start * 10) + 20, y ); ctx.lineto( (blockwidth) + (start * 10) + 20 + (highlightheight), highlightheight ); ctx.lineto( (blockwidth) + (start * 10) + 10 + (highlightheight), highlightheight ); ctx.lineto( (blockwidth) + (start * 10) + 10, y ); ctx.closepath(); ctx.fill(); } } // paint }); we can then create a little html that will accept this image as backgrounds: <h1 class="fancy">largest header</h1> <h3 class="fancy">medium size header</h3> <h6 class="fancy">smallest header</h6> we give each header a different value for t...
...And 3 more matches
GlobalEventHandlers.onanimationiteration - Web APIs
example let's create an animation which automatically pauses at the end of each iteration, allowing the user to choose whether or not to start the next iteration.
...that's because we don't want the box to start animating right away.
... we'll add the animation style later to start animating the box.
...And 3 more matches
HTMLElement: transitionrun event - Web APIs
bubbles yes cancelable no interface transitionevent event handler property ontransitionrun examples this code adds a listener to the transitionrun event: el.addeventlistener('transitionrun', () => { console.log('transition is running but hasn\'t necessarily started transitioning yet'); }); the same, but using the ontransitionrun property instead of addeventlistener(): el.ontransitionrun = () => { console.log('transition started running, and will start transitioning when the transition delay has expired'); }; live example in the following example, we have a simple <div> element, styled with a transition that includes a delay: <div class="transition...
...">hover over me</div> <div class="message"></div> .transition { width: 100px; height: 100px; background: rgba(255,0,0,1); transition-property: transform, background; transition-duration: 2s; transition-delay: 1s; } .transition:hover { transform: rotate(90deg); background: rgba(255,0,0,0); } to this, we'll add some javascript to indicate where the transitionstart and transitionrun events fire.
... const el = document.queryselector('.transition'); const message = document.queryselector('.message'); el.addeventlistener('transitionrun', function() { message.textcontent = 'transitionrun fired'; }); el.addeventlistener('transitionstart', function() { message.textcontent = 'transitionstart fired'; }); el.addeventlistener('transitionend', function() { message.textcontent = 'transitionend fired'; }); the difference is that: transitionrun fires when the transition is created (i.e.
...And 3 more matches
Intersection Observer API - Web APIs
, sans-serif; position: absolute; margin: 0; background-color: rgba(255, 255, 255, 0.7); border: 1px solid rgba(0, 0, 0, 0.7); width: 3em; height: 18px; padding: 2px; text-align: center; } .topleft { left: 2px; top: 2px; } .topright { right: 2px; top: 2px; } .bottomleft { bottom: 2px; left: 2px; } .bottomright { bottom: 2px; right: 2px; } let observers = []; startup = () => { let wrapper = document.queryselector(".wrapper"); // options for the observers let observeroptions = { root: null, rootmargin: "0px", threshold: [] }; // an array of threshold sets for each of the boxes.
...oxid = "box" + (i+1); template.queryselector(".samplebox").id = boxid; wrapper.appendchild(document.importnode(template, true)); // set up the observer for this box observeroptions.threshold = thresholdsets[i]; observers[i] = new intersectionobserver(intersectioncallback, observeroptions); observers[i].observe(document.queryselector("#" + boxid)); } // scroll to the starting position document.scrollingelement.scrolltop = wrapper.firstelementchild.getboundingclientrect().top + window.scrolly; document.scrollingelement.scrollleft = 750; } intersectioncallback = (entries) => { entries.foreach((entry) => { let box = entry.target; let visiblepct = (math.floor(entry.intersectionratio * 100)) + "%"; box.queryselector(".topleft").innerhtml = visiblepc...
...t; box.queryselector(".topright").innerhtml = visiblepct; box.queryselector(".bottomleft").innerhtml = visiblepct; box.queryselector(".bottomright").innerhtml = visiblepct; }); } startup(); clipping and the intersection rectangle the browser computes the final intersection rectangle as follows; this is all done for you, but it can be helpful to understand these steps in order to better grasp exactly when intersections will occur.
...And 3 more matches
OfflineAudioContext - Web APIs
event handlers offlineaudiocontext.oncomplete is an eventhandler called when processing is terminated, that is when the complete event (of type offlineaudiocompletionevent) is raised, after the event-based version of offlineaudiocontext.startrendering() is used.
... offlineaudiocontext.startrendering() starts rendering the audio, taking into account the current connections and the current scheduled changes.
...after the offline audio graph is set up, you need to render it to an audiobuffer using offlineaudiocontext.startrendering.
...And 3 more matches
Path2D - Web APIs
WebAPIPath2D
path2d.closepath() causes the point of the pen to move back to the start of the current sub-path.
... it tries to draw a straight line from the current point to the start.
... path2d.moveto() moves the starting point of a new sub-path to the (x, y) coordinates.
...And 3 more matches
Streams API concepts - Web APIs
there are two types of underlying source: push sources constantly push data at you when you’ve accessed them, and it is up to you to start, pause, or cancel access to the stream.
... only one reader can read a stream at a time; when a reader is created and starts reading a stream (an active reader), we say it is locked to it.
... if you want another reader to start reading your stream, you typically need to cancel the first reader before you do anything else (although you can tee streams, see the teeing section below) note that there are two different types of readable stream.
...And 3 more matches
Using bounded reference spaces - Web APIs
because bounded-floor is a floor-bound reference space, the user starts out on the floor of the space, which is sensible given the real-world implications otherwise.
...you can create a session that supports a bounded-floor 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.
... once the session has been created, our startsessionanimation() function can try to establish a bounded-floor reference space, and if it fails to do so it can then fall back to requesting a local-floor reference space instead (in which we will have to handle boundaries ourselves).
...And 3 more matches
Rendering and the WebXR frame animation callback - Web APIs
preparing the renderer once the xr session has been set up, with the webgl framebuffer connected and webgl primed with the data it needs in order to render the scene, you can set up the renderer to start running.
... this begins with getting the reference space in which you want to draw, with its origin and orientation set at the viewer's starting position and viewing direction.
... kicking off the renderer thus looks like this: let worldrefspace; async function runxr(xrsession) { worldrefspace = await xrsession.requestreferencespace("immersive-vr"); if (worldrefspace) { viewerrefspace = worldrefspace.getoffsetreferencespace( new xrrigidtransform(viewerstartposition, viewerstartorientation)); animationframerequestid = xrsession.requestanimationframe(mydrawframe); } } after getting a reference space for the immersive world, this creates an offset reference space representing the position and orientation of the viewer by creating an xrrigidtransform representing that position and orientation, then calling the xrreferencespace method getoffsetre...
...And 3 more matches
Web Audio API best practices - Web APIs
the audio will start playing when the browser determines it can load the rest of the file before playing finishes.
... autoplay policy browsers have started to implement an autoplay policy, which in general can be summed up as: "create or resume context from inside a user gesture".
...browser vendors decided that web audio contexts should not be allowed to automatically play audio; they should instead be started by a user.
...And 3 more matches
XRSession: selectend event - Web APIs
bubbles yes cancelable no interface xrinputsourceevent event handler property onselectend for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources.
... examples the following example uses addeventlistener() to establish handlers for the selection events: selectstart, selectend, and select.
... if the target ray pose was fetched successfully, the code then uses the value of event property type to route control to an appropriate function to handle the event which arrived: for selectstart events, a mybegintracking() function is called with the target ray pose's matrix.
...And 3 more matches
XRSession: squeezeend event - Web APIs
bubbles yes cancelable no interface xrinputsourceevent event handler property onsqueezeend for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources.
... examples the following example uses addeventlistener() to establish handlers for the squeezeion events: squeezestart, squeezeend, and squeeze.
... if the target ray pose was fetched successfully, the code then uses the value of event property type to route control to an appropriate function to handle the event which arrived: for squeezestart events, a mybegintracking() function is called with the target ray pose's matrix.
...And 3 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
there's a very good chance they won't ask for more than the events marked [important]: event_system_sound event_system_alert [can be important, to have auto-speaking for newly created role_alerts] event_system_foreground event_system_menustart [important] event_system_menuend [important] event_system_menupopupstart [important] event_system_menupopupend [important] event_system_capturestart event_system_captureend event_system_movesizestart event_system_movesizeend event_system_contexthelpstart event_system_contexthelpend event_system_dragdropstart event_system_dragdropend event_system_dia...
...logstart event_system_dialogend event_system_scrollingstart event_system_scrollingend [possibly important, talk to at vendor] event_system_switchstart event_system_switchend event_system_minimizestart event_system_minimizeend event_object_create [don't implement, watching system generated versions of this event causes assistive technology crashes] event_object_destroy [don't implement, watching system generated versions of this event causes assistive technology crashes] event_object_show [can be important, depending on project] event_object_hide [can be important, depending on project] event_object_reorder [important for mutating docs] event_object_focus [important] event_object_selection [important] event_object_selectionadd [important...
...fire event_object_statechange for a window/client/pane object when it starts to load a new document.
...And 3 more matches
Cross-browser Flexbox mixins - CSS: Cascading Style Sheets
values: flex-start (default) | flex-end | center | space-between | space-around spec: https://drafts.csswg.org/css-flexbox/#justify-content-property @mixin justify-content($value: flex-start) { @if $value == flex-start { -webkit-box-pack: start; -moz-box-pack: start; -ms-flex-pack: start; } @else if $value == flex-end { -webkit-box-pack: end; -moz-box-pack: end; -ms-flex-pack: end; ...
...(for anonymous flex items, align-self always matches the value of align-items on their associated flex container.) values: flex-start | flex-end | center | baseline | stretch (default) spec: https://drafts.csswg.org/css-flexbox/#align-items-property @mixin align-items($value: stretch) { @if $value == flex-start { -webkit-box-align: start; -moz-box-align: start; -ms-flex-align: start; } @else if $value == flex-end { -webkit-box-align: end; -moz-box-align: end; -ms-flex-align: end; } @else { ...
...-webkit-box-align: $value; -moz-box-align: $value; -ms-flex-align: $value; } -webkit-align-items: $value; align-items: $value; } flexbox align self values: auto (default) | flex-start | flex-end | center | baseline | stretch spec: https://drafts.csswg.org/css-flexbox/#align-items-property @mixin align-self($value: auto) { // no webkit box fallback.
...And 3 more matches
CSS reference - CSS: Cascading Style Sheets
WebCSSReference
drop-filterbackface-visibilitybackgroundbackground-attachmentbackground-blend-modebackground-clipbackground-colorbackground-imagebackground-originbackground-positionbackground-repeatbackground-size<basic-shape>::before (:before)bleed (@page)<blend-mode>block-sizeblur()borderborder-blockborder-block-colorborder-block-endborder-block-end-colorborder-block-end-styleborder-block-end-widthborder-block-startborder-block-start-colorborder-block-start-styleborder-block-start-widthborder-block-styleborder-block-widthborder-bottomborder-bottom-colorborder-bottom-left-radiusborder-bottom-right-radiusborder-bottom-styleborder-bottom-widthborder-collapseborder-colorborder-end-end-radiusborder-end-start-radiusborder-imageborder-image-outsetborder-image-repeatborder-image-sliceborder-image-sourceborder-image-...
...widthborder-inlineborder-inline-colorborder-inline-endborder-inline-end-colorborder-inline-end-styleborder-inline-end-widthborder-inline-startborder-inline-start-colorborder-inline-start-styleborder-inline-start-widthborder-inline-styleborder-inline-widthborder-leftborder-left-colorborder-left-styleborder-left-widthborder-radiusborder-rightborder-right-colorborder-right-styleborder-right-widthborder-spacingborder-start-end-radiusborder-start-start-radiusborder-styleborder-topborder-top-colorborder-top-left-radiusborder-top-right-radiusborder-top-styleborder-top-widthborder-widthbottom@bottom-centerbox-decoration-breakbox-shadowbox-sizingbreak-afterbreak-beforebreak-insidebrightness()ccalc()caption-sidecaret-colorch@character-variantcharacter-variant()@charset:checkedcircle()clamp()clearclipclip...
...)font-variant-alternatesfont-variant-capsfont-variant-east-asianfont-variant-ligaturesfont-variant-numericfont-variant-positionfont-variation-settingsfont-variation-settings (@font-face)font-weightfont-weight (@font-face)format()fr<frequency><frequency-percentage>:fullscreenggapgrad<gradient>grayscale()gridgrid-areagrid-auto-columnsgrid-auto-flowgrid-auto-rowsgrid-columngrid-column-endgrid-column-startgrid-rowgrid-row-endgrid-row-startgrid-templategrid-template-areasgrid-template-columnsgrid-template-rowshhzhanging-punctuationheightheight (@viewport)@historical-forms:hoverhsl()hsla()hue-rotate()hyphensi<ident><image>image()image-orientationimage-renderingimage-set()@importin:in-range:indeterminateinheritinitialinline-sizeinsetinset()inset-blockinset-block-endinset-block-startinset-inlineinset-i...
...And 3 more matches
animation - CSS: Cascading Style Sheets
WebCSSanimation
s%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3epath%20%7bdisplay%3anone%7d%20path%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3cpath%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e%3cpath%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2c3%2c1%2c1%2c0%2c11%2c9%20a1%2c1%2c1%2c1%2c1%2c13%2c9%20z%22%20%2f%3e%3c%2fsvg%3e#play'); } button.pause { background-image: url('data:image/svg+xml;charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3epath%20%7bdisplay%3anone%7d%20path...
...%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3cpath%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3cpath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e%3cpath%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2c3%2c1%2c1%2c0%2c11%2c9%20a1%2c1%2c1%2c1%2c1%2c13%2c9%20z%22%20%2f%3e%3c%2fsvg%3e#pause'); } button.restart { background-image: url('data:image/svg+xml;charset=utf-8,%3csvg%20xmlns%3d%22http%3a%2f%2fwww.w3.org%2f2000%2fsvg%22%20viewbox%3d%220%200%2016%2016%22%3e%3cstyle%3epath%20%7bdisplay%3anone%7d%20path%3atarget%7bdisplay%3ablock%7d%3c%2fstyle%3e%3cpath%20id%3d%22play%22%20d%3d%22m3%2c3%20l3%2c13%20l13%2c8%20z%22%20%2f%3e%3cp...
...ath%20id%3d%22pause%22%20d%3d%22m5%2c4%20l7%2c4%20l7%2c13%20l5%2c13%20z%20m9%2c4%20l11%2c4%20l11%2c13%20l9%2c13%20z%22%20%2f%3e%3cpath%20id%3d%22restart%22%20d%3d%22m13%2c9%20a5%2c5%2c1%2c1%2c1%2c8%2c4%20l8%2c2%20l12%2c5%20l8%2c8%20l8%2c6%20a3%2c3%2c1%2c1%2c0%2c11%2c9%20a1%2c1%2c1%2c1%2c1%2c13%2c9%20z%22%20%2f%3e%3c%2fsvg%3e#restart'); } .grid { width: 100%; height: 100%; display: flex; background: #eee; font: 1em monospace; } .row { display: flex; flex: 1 auto; flex-direction: row; flex-wrap: wrap; justify-content: space-between; } .col { display: flex; flex: 1 auto; flex-direction: column; } .cell { box-sizing: border-box; margin: .5em; padding: 0; background-color: #fff; overflow: hidden; text-align: left; } .flx { flex: 1 0; } .note { backgrou...
...And 3 more matches
box-align - CSS: Cascading Style Sheets
WebCSSbox-align
/* keyword values */ box-align: start; box-align: center; box-align: end; box-align: baseline; box-align: stretch; /* global values */ box-lines: inherit; box-lines: initial; box-lines: unset; the direction of layout depends on the element's orientation: horizontal or vertical.
... values start the box aligns contents at the start, leaving any extra space at the end.
... center the box aligns contents in the center, dividing any extra space equally between the start and the end.
...And 3 more matches
Live streaming web audio and video - Developer guides
this is a fairly complex and nascent subject with a lot of variables, so in this article, we'll introduce you to the subject and let you know how you can get started.
... the key consideration when streaming media to a browser is the fact that rather than playing a finite file we are relaying a file that is being created on the fly and has no pre-determined start or end.
... live streamed media lacks a finite start and end time as rather than a static file, it is a stream of data that the server passes on down the line to the browser and is often adaptive (see below).
...And 3 more matches
Mouse gesture events - Developer guides
mozmagnifygesturestart the mozmagnifygesturestart event is sent when the user begins performing a "pinch" gesture, by using two fingers as the corners of a rectangle and moving them either closer together or farther apart.
...the event's delta value represents the amount by which the gesture has moved since the mozmagnifygesturestart or mozmagnifygestureupdate event.
...if you only care about the end results of the pinch gesture, you can simply watch for this event; however, if you want to provide feedback during the handling of the gesture, you should also watch the mozmagnifygesturestart and mozmagnifygestureupdate events.
...And 3 more matches
Link types - HTML: Hypertext Markup Language
although recognized, the synonyms begin and start are incorrect and must be avoided.
... note: apple's ios does not use this link type, nor the sizes attribute, like others mobile browsers do, to select a webpage icon for web clip or a start-up placeholder.
... instead it uses the non-standard apple-touch-icon and apple-touch-startup-image respectively.
...And 3 more matches
Assertions - JavaScript
this character has a different meaning when it appears at the start of a group.
...in this example, we can get the fruits that start with 'a' by a /^a/ regex.
... let fruits = ["apple", "watermelon", "orange", "avocado", "strawberry"]; // select fruits started with 'a' by /^a/ regex.
...And 3 more matches
Array.prototype.splice() - JavaScript
syntax let arrdeleteditems = array.splice(start[, deletecount[, item1[, item2[, ...]]]]) parameters start the index at which to start changing the array.
... if greater than the length of the array, start will be set to the length of the array.
...(in this case, the origin -1, meaning -n is the index of the nth last element, and is therefore equivalent to the index of array.length - n.) if array.length + start is less than 0, it will begin from index 0.
...And 3 more matches
RegExp.prototype.exec() - JavaScript
"the quick brown fox jumps over the lazy dog" re lastindex the index at which to start the next match.
...when you do so, the search starts at the substring of str specified by the regular expression's lastindex property (test() will also advance the lastindex property).
... note that the lastindex property will not be reset when searching a different string, it will start its search at its existing lastindex .
...And 3 more matches
String.prototype.indexOf() - JavaScript
the indexof() method returns the index within the calling string object of the first occurrence of the specified value, starting the search at fromindex.
... fromindex optional an integer representing the index at which to start the search.
... for fromindex values lower than 0, or greater than str.length, the search starts at index 0 and str.length, respectively.
...And 3 more matches
orient - SVG: Scalable Vector Graphics
WebSVGAttributeorient
only one element is using this attribute: <marker> html, body, svg { height: 100%; } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <defs> <marker id="arrow" viewbox="0 0 10 10" refx="5" refy="5" markerwidth="6" markerheight="6" orient="auto-start-reverse"> <path d="m 0 0 l 10 5 l 0 10 z" /> </marker> <marker id="dataarrow" viewbox="0 0 10 10" refx="5" refy="5" markerwidth="6" markerheight="6" orient="-65deg"> <path d="m 0 0 l 10 5 l 0 10 z" fill="red" /> </marker> </defs> <polyline points="10,10 10,90 90,90" fill="none" stroke="black" marker-start="url(#arrow)" marker-end="url(#arrow)" /> <po...
...lyline points="15,80 29,50 43,60 57,30 71,40 85,15" fill="none" stroke="grey" marker-start="url(#dataarrow)" marker-mid="url(#dataarrow)" marker-end="url(#dataarrow)" /> </svg> usage notes value auto | auto-start-reverse | <angle> | <number> default value 0 animatable yes (non-additive) auto this value indicates that the marker is oriented such that its positive x-axis is pointing in a direction relative to the path at the position the marker is placed.
... auto-start-reverse if placed by marker-start, the marker is oriented 180° different from the orientation that would be used if auto where specified.
...And 3 more matches
Understanding WebAssembly text format - WebAssembly
the simplest module let's start with the simplest, shortest possible wasm module.
... when a function is called, it starts with an empty stack which is gradually filled up and emptied as the body’s instructions are executed.
... there are a lot more things that can be put inside function bodies, but we will start off simple for now, and you’ll see a lot more examples as you go along.
...And 3 more matches
/loader - Archive of obsolete content
there are lots of different possibilities, but the most common setup looks like this: let { loader } = require('toolkit/loader'); let loader = loader({ paths: { // resolve all modules starting with `toolkit/` as follows: // toolkit/foo -> resource://gre/modules/commonjs/toolkit/foo.js // toolkit/foo/bar -> resource://gre/modules/commonjs/toolkit/foo/bar.js 'toolkit/': 'resource://gre/modules/commonjs/toolkit/', // resolve all other non-relative module requirements as follows: // devtools/gcli -> resource:///modules/devtools/gcli.js // panel ...
... -> resource:///modules/panel.js '': 'resource:///modules/', } }) all relative url require() statements (those that start with ".") are first resolved relative to the requirer module id and the result of it is then resolved using the paths option.
...in those cases you have to decide what the entry point module is relative to and provide an appropriate mapping for it: let { loader } = require('toolkit/loader'); let loader = loader({ paths: { // resolve all modules starting with `toolkit/` as follows: // toolkit/foo -> resource://gre/modules/commonjs/toolkit/foo.js // toolkit/foo/bar -> resource://gre/modules/commonjs/toolkit/foo/bar.js 'toolkit/': 'resource://gre/modules/commonjs/toolkit/', // resolev all other non-relative module requirements as follows: // devtools/gcli -> resource:///modules/devtools/gcli.js // panel -> resource:///modules/panel.js '': 'resource:///modules/', // a...
...And 2 more matches
ui/sidebar - Archive of obsolete content
the sidebar script may not be initialized yet, so you can't reliably send messages to the sidebar script right away: however, you can start listening to messages from the script.
...on attach, "main.js" starts listening to the ping message, and responds with a pong: var sidebar = require("sdk/ui/sidebar").sidebar({ id: 'my-sidebar', title: 'my sidebar', url: require("sdk/self").data.url("sidebar.html"), onattach: function (worker) { worker.port.on("ping", function() { console.log("add-on script got the message"); worker.port.emit("pong"); }); } }); try running the add-o...
...on attach, "main.js" sends the ping message, and starts listening for the pong: var sidebar = require("sdk/ui/sidebar").sidebar({ id: 'my-sidebar', title: 'my sidebar', url: require("sdk/self").data.url("sidebar.html"), onready: function (worker) { worker.port.emit("ping"); worker.port.on("pong", function() { console.log("add-on script got the reply"); }); } }); try running the add-on, and showing the sidebar using the "...
...And 2 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
they can both take the values start (top or left), center, end (bottom or right), or stretch (extend this element to match the element with the greatest height or width).
...figure 2 shows how setting align="center" pack="start" on two elements will result in completely different output with the only difference being the value for orient.
...the part of the label that gets cropped can be controlled by setting its value to start, center, or end.
...And 2 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
to create this dev profile start firefox with firefox.exe -no-remote -p dev on the first start the profile manager will appear, where you can create the dev profile and configure its home-path.
... true javascript.options.strict (present in firefox 3.5+) enforces 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.
... chrome url use a file called a “chrome manifest” to register chrome packages with firefox and start using them.
...And 2 more matches
Appendix B: Install and Uninstall Scripts - Archive of obsolete content
add-ons normally run code at startup, and as it is covered in the main tutorial, all you need is a load event handler and a little code.
...keep in mind that the user could have set multiple firefox windows to open at startup, so there's a race condition on which window will run the first run code.
...in this case the user is told that firefox needs to restart in order for the extension to be completely removed.
...And 2 more matches
Making a Mozilla installation modifiable - Archive of obsolete content
although jar archives are binary files, mozilla's ui is not compiled into machine code; mozilla instead builds its ui from the non-compiled files in the archive each time it starts up.
... because of this, we can modify the files in the archive and see our changes to the ui merely by restarting the application.
...after you make these changes, try starting the copy of mozilla you have modified.
...And 2 more matches
Embedding Mozilla in a Java Application using JavaXPCOM - Archive of obsolete content
to start embedding, we use the methods provided by the mozilla singleton class.
... another example: (taken from rayh.co.uk) // note, on linux, gtk has to be already initialized for this code to work mozilla moz = mozilla.getinstance(); // now we need to start an xul application, so we get an instance of the xpcom service manager nsiservicemanager servicemanager = moz.getservicemanager(); // now we need to get the @mozilla.org/toolkit/app-startup;1 service: nsiappstartup appstartup = (nsiappstartup)servicemanager.getservicebycontractid("@mozilla.org/toolkit/app-startup;1", nsiappstartup.ns_iappstartup_iid); // get the nsiwindowwat...
...cher interface to the above nsiwindowcreator windowcreator = (nsiwindowcreator)appstartup.queryinterface(nsiwindowcreator.ns_iwindowcreator_iid); // get the window watcher service nsiwindowwatcher windowwatcher = (nsiwindowwatcher)servicemanager.getservicebycontractid("@mozilla.org/embedcomp/window-watcher;1", nsiwindowwatcher.ns_iwindowwatcher_iid); // set the window creator (from step 6) windowwatcher.setwindowcreator(windowcreator); // create the root xul window: nsidomwindow win = windowwatcher.openwindow(null, "chrome://your-app/content/window.xul", "mywindow", "chrome,resizable,centerscreen", null); // set this as the active window windowwatcher.setactivewindow(win); // hand over the application to xpcom/xul, this will block: app...
...And 2 more matches
JavaScript Client API - Archive of obsolete content
before starting before you start learning the javascript api, you should spend some time on http://docs.services.mozilla.com/ reading about how the sync service operates.
...it's what starts all the magic.
...it's a bit smarter to have // yourself notified when to start and stop tracking therefore: svc.obs.add("weave:engine:start-tracking", this); svc.obs.add("weave:engine:stop-tracking", this); } footracker.prototype = { __proto__: tracker.prototype, _enabled: false, observe: function observe(subject, topic, data) { switch (topic) { case "weave:engine:start-tracking": if (!this._enabled) { // register event handler or observe...
...And 2 more matches
Creating a Help Content Pack - Archive of obsolete content
this attribute marks the start point in the rdf graph described by the file, and the help viewer searches for this element in order to query for further information (stored in child elements) about the content pack being parsed.
...starting with firefox 1.1 and the mozilla 1.8 platform, only the table of contents data source will be displayed.
...let's start with a brief sample rdf file with a single level: <?xml version="1.0"?> <rdf:rdf xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:nc="http://home.netscape.com/nc-rdf#"> <rdf:description rdf:about="urn:root"> <nc:subheadings> <rdf:seq> <rdf:li><rdf:description nc:link="foo.html" nc:title="foo"/></rdf:li> <rdf:li><rdf:description nc:link="baz.htm...
...And 2 more matches
Priority Content - Archive of obsolete content
book length works in progress: netscape gecko plugin api reference 1.0 original: netscape gecko plugin api reference 1.0 wiki location: gecko plugin api reference migrators: started: core javascript reference 1.5 original: core javascript reference 1.5 wiki location: core javascript 1.5 reference migrators: deb richardson in progress: transforming xml: netscape and xslt 1.0 original: transforming xml: netscape and xslt 1.0 wiki location: transforming xml with xslt migrators: serge k.
... started: scripting plugins: macromedia flash original: scripting plugins: macromedia flash wiki location: scripting plugins: macromedia flash migrators: dependant on (these parts need to be done, put your name down) completed: soap in netscape gecko-based browsers original: soap in netscape gecko-based browsers wiki location: soap in gecko-based browsers migrators: doron rosenberg in progr...
... started: using mozilla in testing and debugging web sites original: using mozilla in testing and debugging web sites wiki location: using mozilla in testing and debugging web sites migrators: serge k.
...And 2 more matches
Using XPInstall to Install Plugins - Archive of obsolete content
it can be a way to ensure a smooth user-experience when 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.
...this step will involve the use of the initinstall api call to start everything off, and also the getfolder api call, which helps to locate the current browser's plugin directory.
...by refreshing your plugin, you're ensuring that the plugin is available for use immediately, without obliging the user to restart their browser.
...And 2 more matches
Panels - Archive of obsolete content
here is a complete example: <panel id="search-panel" position="after_start"> <label control="search" value="terms:"/> <textbox id="search"/> </panel> <label value="search" popup="search-panel"/> the position attribute has been added to the panel element with the value 'after_start'.
...for example, the following would open a panel underneath a button: panel.openpopup(button, "after_start", 0, 0, false, false); likewise, the openpopupatscreen method will open a panel at a specific screen position.
...for instance, using the search panel example above, we could add a button which closes the panel when pressed: <script> function dosearch() { document.getelementbyid("search-panel").hidepopup(); } </script> <toolbarbutton label="search" type="panel"> <panel id="search-panel" position="after_start"> <textbox id="search"/> <button label="search" oncommand="dosearch();"/> </panel> </toolbarbutton> in this example, the dosearch() function is called when the "search" button is pressed.
...And 2 more matches
Multiple Rule Example - Archive of obsolete content
<vbox id="photoslist" align="start" datasources="template-guide-photos5.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <rule> <conditions> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" ...
...photo" class="box-padded"> <vbox> <label value="?title"/> <image src="?photo"/> </vbox> <groupbox> <caption label="photo details"/> <label value="?description"/> <label value="date: ?date"/> </groupbox> </hbox> </action> </rule> <rule> <conditions> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?phototitle"/> </conditions> <action> <vbox uri="?photo" class="box-padded"> <label value="?phototitle"/> <image src="?photo"/> </vbox> </action> </rule> </templ...
...the resulting data will be: (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/palace.jpg, ?title = palace from above ?description = view from the top of the tower looking east of the doges palace, ?date = 2005-04-30t14:55:00+01.00) (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/palace.jpg, ?phototitle = palace from above) (?
...And 2 more matches
Complete - Archive of obsolete content
when you restart after installing the extension, the locales en-us and fr-fr are both registered for the component allcustom.
...restart the application using the command line switch: -uilocale fr-fr (of course, if your application is already in french, specify en-us here to switch the extension to english.) notes: if you use a shortcut or launcher icon to start the application, then you can add the command line switch by editing the icon's properties.
...to work around the bug, close the application, delete the file xul.mfl in its profile, then restart it with the command line switch.
...And 2 more matches
Focus and Selection - Archive of obsolete content
it takes two parameters, the first is the starting character and the second is the character after the last one that you want to have selected.
...if you use the same value for both parameters, the start and end of the selection changes to the same position.
...tbox.setselectionrange(0,0); you can retrieve the current selection by using the selectionstart and selectionend properties.
...And 2 more matches
Popup Menus - Archive of obsolete content
it can be set to a number of values, which are described briefly below: after_start the popup appears below the element with the left edges of the element and the popup window aligned.
... before_start the popup appears above the element with the left edges of the element and the popup window aligned.
... start_after the popup appears to the left of the element with the bottom edges of the element and the popup window aligned.
...And 2 more matches
Tree Selection - Archive of obsolete content
you would then write a loop for the number of ranges, calling getrangeat() to get the actual indices of the start and end of the range.
... getrangeat example var start = new object(); var end = new object(); var numranges = tree.view.selection.getrangecount(); for (var t = 0; t < numranges; t++){ tree.view.selection.getrangeat(t,start,end); for (var v = start.value; v <= end.value; v++){ alert("item " + v + " is selected."); } } we create two objects called 'start' and 'end'.
...the getrangeat() function is called passing the range index and the start and end objects.
...And 2 more matches
calICalendarView - Archive of obsolete content
interface code [scriptable, uuid(3e567ccb-2ecf-4f59-b7ca-bf42b0fbf24a)] interface calicalendarview : nsisupports { attribute calicalendar displaycalender; attribute calicalendarviewcontroller controller; void showdate(in calidatetime adate); void setdaterange(in calidatetime astartdate, in calidatetime aenddate); readonly attribute calidatetime startdate; readonly attribute calidatetime enddate; readonly attribute boolean supportsdisjointdates; readonly attribute boolean hasdisjointdates; void setdatelist(in unsigned long acount, [array,size_is(acount)] in calidatetime adates); void getdatelist(out unsigned long acount, [array,size_is(acount),retval] out calid...
... startdate returns a calidatetime corresponding to the first date shown by the view enddate returns a calidatetime corresponding to the last date shown by the view.
... hasdisjointdates returns false if the dates being displayed represent a continuous list, and true if certain dates in between startdate and enddate may not be displayed.
...And 2 more matches
Using SSH to connect to CVS - Archive of obsolete content
if you don't already run ssh-agent on your computer, it's probably easiest to start it up whenever you set up your environment to checkout and build mozilla.
... ms-dos command prompt cygwin for /f "tokens=1,2,3* delims=; " %%a in ('ssh-agent -c') do if "%%a"=="setenv" set %%b=%%c set home=/cygdrive/c/path/to/your/cygwin/home/directory ssh-add ~/.ssh/id_dsa start /b /wait cmd.exe ssh-agent -k exit essentially both sets of commands do the same thing.
...since it's important that you kill the agent when you're finished with it, the last three lines start a child environment that, when exited, will result in the agent's process being killed.
...And 2 more matches
-ms-filter - Archive of obsolete content
code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/filter_s.htm <body> <p>click the image to start the filter.</p> // call the function.
... filterfrom.filters.item(0).transition=12; imagefrom.style.visibility = "hidden"; filterto.style.visibility = ""; filterfrom.filters.item(0).play(14); } </script> </body> gradient progid:dximagetransform.microsoft.gradient( <properties> ) where <properties> = [ <enabled> | <endcolor> | <endcolorstr> | <gradienttype> | <startcolor> | <startcolorstr> ]# where <enabled> = 'enabled=' [ true | false ] <endcolor> = 'startcolor=' <color> <endcolorstr> = 'startcolorstr=' <color> <gradienttype> = 'gradienttype=' <integer> <startcolor> = 'startcolor=' <color> <startcolorstr> = 'startcolorstr=' <color> enabled default: true set to false to disable.
... gradienttype default: 0 (equivalent to linear-gradient(to bottom, …)) set to a non-zero value to make the gradient horizontal (equivalent to linear-gradient(to right, …)) startcolor the end color, supports only opaque colors in the #rrggbb notation.
...And 2 more matches
Building up a basic demo with A-Frame - Game development
the webxr and webgl apis already enable us to start creating virtual reality (vr) experiences inside web browsers, but the community is still waiting for tools and libraries to appear, to make this easier.
... environment setup let's start by setting up an environment to create something with a-frame.
...you should start off by: making sure you are using a modern browser with good webgl support (and webxr support if you have available vr or ar hardware) such as the latest firefox or chrome — download firefox nightly or chrome (v54 or higher).
...And 2 more matches
Building up a basic demo with Three.js - Game development
note: we chose three because it is one of the most popular webgl libraries, and it is easy to get started with.
... environment setup to start developing with three.js, you don't need much.
...right after the function declaration, we're invoking it for the first time to start the loop, after which it will be used indefinitely.
...And 2 more matches
Square tilemaps implementation: Scrolling maps - Game development
in static maps, usually the rendering starts at the top left corner of a tile situated at the top left corner of a viewport.
...in the demo code, the starting point is stored at startcol and startrow.
... var startcol = math.floor(this.camera.x / map.tsize); var endcol = startcol + (this.camera.width / map.tsize); var startrow = math.floor(this.camera.y / map.tsize); var endrow = startrow + (this.camera.height / map.tsize); once we have the first tile, we need to calculate how much its rendering (and therefore the rendering of the other tiles) is offset by.
...And 2 more matches
Player paddle and controls - Game development
because the anchor from which the position is calculated always starts from the top left edge of the object.
...continue by adding the following new line, again at the bottom of the create() function: game.physics.enable(paddle, phaser.physics.arcade); now the magic can start to happen — the framework can take care of checking the collision detection on every frame.
...add the following new line to the update() function, as shown: function update() { game.physics.arcade.collide(ball, paddle); paddle.x = game.input.x; } now on every new frame the paddle's x position will adjust accordingly to the input's x position, however when we start the game, the position of the paddle is not in the middle.
...And 2 more matches
Test your skills: HTML accessibility - Learn web development
try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
...And 2 more matches
Test your skills: WAI-ARIA - Learn web development
try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
...here, we are starting with a mouse- and keyboard-accessible version.
...And 2 more matches
Test your skills: Flexbox - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
...And 2 more matches
Introduction to CSS layout - Learn web development
starting with a well-structured html document is very important, as you can then work with the way things are laid out by default rather than fighting against it.
... in addition to being able to change the default presentation by turning an item from block to inline and vice versa, there are some bigger layout methods that start out as a value of display.
...the items all line up at the start of the container, leaving any extra space at the end of the row.
...And 2 more matches
Beginner's guide to media queries - Learn web development
this means that instead of targetting specific sizes for all designs, a better approach is to change the design at the size where the content starts to break in some way.
...you can start with your desktop or widest view and then add breakpoints to move things around as the viewport becomes smaller, or you can start with the smallest view and add layout as the viewport becomes larger.
... walkthrough: a simple mobile-first layout our starting point is an html document with some css applied to add background colors to the various parts of the layout.
...And 2 more matches
Client-side form validation - Learn web development
simple start file let's start with a simple example: an input that allows you to choose whether you prefer a banana or a cherry.
...find the source code on github at fruit-start.html and a live example below.
... <form> <label for="choose">would you prefer a banana or cherry?</label> <input id="choose" name="i_like"> <button>submit</button> </form> input:invalid { border: 2px dashed red; } input:valid { border: 2px solid black; } to begin, make a copy of fruit-start.html in a new directory on your hard drive.
...And 2 more matches
Test your skills: Basic controls - Learn web development
basic controls 1 this task starts you off nice and gently by asking you to create two <input> elements, for a user's id and password, along with a submit button.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
...And 2 more matches
Test your skills: Other controls - Learn web development
try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... other controls 3 in our final task of this set, we start with much the same list of food choices.
...And 2 more matches
What will your website look like? - Learn web development
previous overview: getting started with the web next what will your website look like?
...we'll start by creating a simple webpage with a heading, an image, and a few paragraphs.
... note: even on real, complex websites, the design teams usually start out with rough sketches on paper and later on build digital mockups using a graphics editor or web technologies.
...And 2 more matches
Debugging HTML - Learn web development
prerequisites: html familiarity, as covered in, for example, getting started with html, html text fundamentals, and creating hyperlinks.
... the best strategy is to start by running your html page through the markup validation service — created and maintained by the w3c, the organization that looks after the specifications that define html, css, and other web technologies.
... "consider adding a lang attribute to the html start tag to declare the language of this document.": this is not an error but a warning.
...And 2 more matches
Adding vector graphics to the Web - Learn web development
when it is zoomed, each pixel is simply increased in size to fill multiple pixels on screen, so the image starts to look blocky.
...yes, you can handcode simple svg in a text editor, but for a complex image this quickly starts to get very difficult.
... svg is not supported in older browsers, so may not be suitable if you need to support older versions of internet explorer with your web site (svg started being supported as of ie9.) raster graphics are arguably better for complex precision images such as photos, for the reasons described above.
...And 2 more matches
HTML table basics - Learn web development
LearnHTMLTablesBasics
overview: tables next this article gets you started with html tables, covering the very basics such as rows and cells, headings, making cells span multiple columns and rows, and how to group together all the cells in a column for styling purposes.
...you can find the stylesheet here, and you can also find an html template that applies the stylesheet — these together will give you a good starting point for experimenting with html tables.
... to stop this row from growing and start placing subsequent cells on a second row, we need to use the <tr> element ('tr' stands for 'table row').
...And 2 more matches
Making asynchronous programming easier with async and await - Learn web development
once that's complete, your code continues to execute starting on the next line.
...both of them start off with a custom promise function that fakes an async process with a settimeout() call: function timeoutpromise(interval) { return new promise((resolve, reject) => { settimeout(function(){ resolve("done"); }, interval); }); }; then each one includes a timetest() async function that awaits three timeoutpromise() calls: async function timetest() { ...
... } each one ends by recording a start time, seeing how long the timetest() promise takes to fulfill, then recording an end time and reporting how long the operation took in total: let starttime = date.now(); timetest().then(() => { let finishtime = date.now(); let timetaken = finishtime - starttime; alert("time taken in milliseconds: " + timetaken); }) it is the timetest() function that differs in each case.
...And 2 more matches
Introducing asynchronous JavaScript - Learn web development
synchronous javascript to allow us to understand what asynchronous javascript is, we ought to start off by making sure we understand what synchronous javascript is.
... async callbacks async callbacks are functions that are specified as arguments when calling a function which will start executing code in the background.
... console.log ('starting'); let image; fetch('coffee.jpg').then((response) => { console.log('it worked :)') return response.blob(); }).then((myblob) => { let objecturl = url.createobjecturl(myblob); image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); }).catch((error) => { console.log('there has been a problem with your fetch operation: ' + error.message); }); ...
...And 2 more matches
Graceful asynchronous programming with Promises - Learn web development
the application has a window with a list of the user's friends, and clicking on a button next to a user starts a video call to that user.
...(evt) { setstatusmessage("calling..."); navigator.mediadevices.getusermedia({video: true, audio: true}) .then(chatstream => { selfviewelem.srcobject = chatstream; chatstream.gettracks().foreach(track => mypeerconnection.addtrack(track, chatstream)); setstatusmessage("connected"); }).catch(err => { setstatusmessage("failed to connect"); }); } this function starts by using a function called setstatusmessage() to update a status display with the message "calling...", indicating that a call is being attempted.
...for a start, chaining processes to occur one after the other is all fine, but what if you want to run some code only after a whole bunch of promises have all fulfilled?
...And 2 more matches
Introduction to events - Learn web development
for a start, it is not a good idea to mix up your html and your javascript, as it becomes hard to parse — keeping your javascript separate is best practice; if it is in a separate file you can apply it to multiple html documents.
...you should probably start with these as you begin learning.
...now, when the area of the <div> outside the video is selected, the box should be hidden again and when the video itself is selected, the video should start to play.
...And 2 more matches
Test your skills: Conditionals - Learn web development
try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
...And 2 more matches
Test your skills: Events - Learn web development
a good starting place is our manipulating documents tutorial.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
...And 2 more matches
Test your skills: Functions - Learn web development
a good starting place is our manipulating documents tutorial.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
...And 2 more matches
Fetching data from the server - Learn web development
to begin this example, make a local copy of ajax-start.html and the four text files — verse1.txt, verse2.txt, verse3.txt, and verse4.txt — in a new directory on your computer.
... function updatedisplay(verse) { } we'll start our function by constructing a relative url pointing to the text file we want to load, as we'll need it later.
... the first block that uses fetch can be found at the start of the javascript: fetch('products.json').then(function(response) { return response.json(); }).then(function(json) { let products = json; initialize(products); }).catch(function(err) { console.log('fetch problem: ' + err.message); }); the fetch() function returns a promise.
...And 2 more matches
Test your skills: Math - Learn web development
math 1 let's start out by testing your knowledge of basic math operators.
... download the starting point for this task to work in your own editor or in an online editor.
... download the starting point for this task to work in your own editor or in an online editor.
...And 2 more matches
Storing the information you need — Variables - Learn web development
variables just make sense, and as you learn more about javascript they will start to become second nature.
...we won't go into all the differences now, but you'll start to discover them as you learn more about javascript (if you really want to read about them now, feel free to check out our let reference page).
... for a start, if you write a multiline javascript program that declares and initializes a variable, you can actually declare a variable with var after you initialize it and it will still work.
...And 2 more matches
What went wrong? Troubleshooting JavaScript - Learn web development
objective: to gain the ability and confidence to start fixing problems in your own code.
... an erroneous example to get started, let's return to our number guessing game — except this time we'll be exploring a version that has some deliberate errors introduced.
... to get started, open the local copy inside your favorite text editor, and your browser.
...And 2 more matches
Adding features to our bouncing balls demo - Learn web development
previous overview: objects in this assessment, you are expected to use the bouncing balls demo from the previous article as a starting point, and add some new and interesting features to it.
... objective: to test comprehension of javascript objects and object-oriented constructs starting point to get this assessment started, make a local copy of index-finished.html, style.css, and main-finished.js from our last article in a new directory in your local computer.
... hints and tips a couple of pointers before you get started.
...And 2 more matches
Test your skills: Object-oriented JavaScript - Learn web development
try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... oojs 3 finally, we'd like you to start with the es shape class you created in the last task.
...And 2 more matches
Ember Interactivity: Footer functionality, conditional rendering - Learn web development
previous overview: client-side javascript frameworks next now it's time to start tackling the footer functionality in our app.
... objective: to continue our learning about components classes, start looking at conditional rendering, and wire up some of our footer functionality.
... try restarting the dev server and going to localhost:4200 again, and you'll now see that we have a fully-operational battlestation “todos left” counter and clear button: if you're asking yourself why we're not just doing the toggle on the component, since the function is entirely self-contained and not at all needing anything from the service, then you are 100% right to ask that question!
...And 2 more matches
Accessibility in React - Learn web development
exploring the keyboard usability problem start by clicking on the input at the top of our app, as if you're going to add a new task.
...head back to your browser and you’ll see that your focus moves between edit <input> and "edit" button as you start and end an edit.
... again try using the "edit" and "cancel" buttons to toggle between the templates of your <todo /> component; you'll see the browser focus indicator move appropriately, without the problem we discussed at the start of this section.
...And 2 more matches
Componentizing our React app - Learn web development
open it up and give it its first line: import react from "react"; since we're going to make a component called todo, you can start adding the code for that to todo.js too, as follows.
...let's start by turning our tasks array into something simple: the name of each task: const tasklist = props.tasks.map(task => task.name); let’s try replacing all the children of the <ul> with tasklist: <ul role="list" classname="todo-list stack-large stack-exception" aria-labelledby="list-heading" > {tasklist} </ul> this gets us some of the way towards showing all the components again, but we�...
...now we'll go on to look at how we handle events in react, and start adding some interactivity.
...And 2 more matches
React interactivity: Editing, filtering, conditional rendering - Learn web development
to start with, we can at least implement an edittask() function in app.js.
...to start with, we want to call setediting() with a value of true when a user presses the "edit" button in our viewtemplate, so that we can switch templates.
... we'll start by making a new hook for storing and setting the new name.
...And 2 more matches
Handling common HTML and CSS problems - Learn web development
if you have a widget, make sure it has a distinct class, and then start the selectors that select elements inside the widget with this class, so conflicts are less likely.
...in general, most core html and css functionality (such as basic html elements, css basic colors and text styling) works across most browsers you'll want to support; more problems are uncovered when you start wanting to use newer features such as flexbox, or html5 video/audio, or even more nascent, css grids or -webkit-background-clip: text.
... to try this example, make a local copy of selectivizr-example-start.html.
...And 2 more matches
Tools and testing - Learn web development
once you've started to become comfortable programming with core web technologies (like html, css, and javascript), and you start to get more experience, read more resources, and learn more tips and tricks, you'll start to come across all kind of tools, from javascript frameworks, to testing and automation tools, and more besides.
... as your web projects become larger and more complex, you'll want to start taking advantage of some of these tools, working out a reliable toolchain to give your development process superpowers.
... get started prerequisites you should really learn the basics of the core html, css, and javascript languages first before attempting to use many the tools detailed here.
...And 2 more matches
Application cache implementation overview
associating the top level document with offline cache this happens between document load start and the first sub-resource download start and is not about associating nsiapplicationcache object with the channel, but with the document object the load is performed for.
...marking entries as foreign when nscontentsink::processofflinemanifest() discovers that the url in the manifest attribute of the html tag is different from the manifest url the channel's nsiapplicationcache object belongs to, the entry the document has been loaded from is marked “foreign” and the page load is completely restarted.
... the load starts again from the top with a completely new channel.
...And 2 more matches
mach
mach expands relative paths starting from the current working directory, so you can run commands like mach build .
... you can add the command to your .profile so it will run automatically when you start the shell: source /path/to/mozilla-central/python/mach/bash-completion.sh this will enable tab completion of mach command names, and in the future it may complete flags and other arguments too.
...that above bootstrap.py will download and setup everything so you can build a mozilla app such as firefox etcetera, so it is a nice starting point.
...And 2 more matches
Message manager overview
its most important functions and attributes are: childcount : contains the number of children (typically, browser windows) getchildat() : get the child at the given index loadframescript() : load a frame script into every tab in the browser broadcastasyncmessage() : send a message to frame scripts addmessagelistener() : start listening to a specific message from all frame scripts removemessagelistener() : stop listening to a specific message interfaces nsiframescriptloader nsimessagelistenermanager nsimessagebroadcaster how to access access it using components.classes: // chrome script let globalmm = cc["@mozilla.org/globalmessagemanager;1"] .getservice(...
... its most important functions and attributes are: childcount : contains the number of children (typically, browser tabs) getchildat() : get the child at the given index loadframescript() : load a frame script into every tab in this window broadcastasyncmessage() : send a message to all frame scripts in this window addmessagelistener() : start listening to a specific message from frame scripts removemessagelistener() : stop listening to a specific message interfaces nsiframescriptloader nsimessagelistenermanager nsimessagebroadcaster how to access you can access it as a property of the browser window: // chrome script let windowmm = window.messagemanager; browser...
... its most important functions are: loadframescript() : load a frame script into this browser frame (tab) sendasyncmessage() : send a message to all frame scripts in this browser frame addmessagelistener() : start listening to a specific message from frame scripts removemessagelistener() : stop listening to a specific message interfaces nsiprocesschecker nsiframescriptloader nsimessagelistenermanager nsimessagesender how to access the browser message manager can be accessed as a property of the xul <browser> element: // chrome script let b...
...And 2 more matches
Performance
key points to keep in mind scripts registered during addon startup get executed during session restore.
... the more expensive they are to execute the longer it will take for the browser to become responsive after startup.
... as long as it the action does not happen frequently the memory and startup savings should outstrip the added cost of script evaluation.
...And 2 more matches
Embedding Tips
a service is a singleton object implementing one or more xpcom interfaces and registered with gecko during startup.
...watch for changes in nsiuricontentlistener::onstarturiopen().
...in response it creates a persist object, creates a listener and starts the operation.
...And 2 more matches
Extending a Protocol
quick start: extending a protocol this tutorial implements a simple ping-pong style ipdl protocol, which sends a message from the content process (main thread) to the chrome process (ui thread).
... visually, it's going to look something like this (except for the operating system bit, which we are not actually going to do - just to illustrate what we could do): let's start by implementing the webidl above.
... creating the protocol pecho.ipdl let's start by saving the following file to ./dom/ipc/pecho.ipdl.
...And 2 more matches
AddonListener
method overview void onenabling(in addon addon, in boolean needsrestart) void onenabled(in addon addon) void ondisabling(in addon addon, in boolean needsrestart) void ondisabled(in addon addon) void oninstalling(in addon addon, in boolean needsrestart) void oninstalled(in addon addon) void onuninstalling(in addon addon, in boolean needsrestart) void onuninstalled(in addon addon) void onoperationc...
... void onenabling( in addon addon, in boolean needsrestart ) parameters addon the addon that is being enabled needsrestart true if an application restart is necessary for the change to take effect onenabled() called when an add-on has been enabled.
... void ondisabling( in addon addon, in boolean needsrestart ) parameters addon the addon that is being disabled needsrestart true if an application restart is necessary for the change to take effect ondisabled() called when an add-on has been disabled.
...And 2 more matches
FileUtils.jsm
nsifile getfile( string key, array patharray, bool followlinks ); parameters key the nsidirectoryservice key to start from (see getting special files for more info) patharray an array of path components to locate beneath the directory specified by key.
... nsifile getdir( string key, array patharray, bool shouldcreate, bool followlinks ); parameters key the nsidirectoryservice key to start from (see getting special files for more info) patharray an array of path components to locate beneath the directory specified by key.
... starting in gecko 38.0, passing mode_append without mode_truncate will throw an exception.
...And 2 more matches
Task.jsm
to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/task.jsm"); introduction for an introduction to tasks, you may start from the task.js documentation, keeping in mind that only the core subset is implemented in this module.
...the task.spawn() function takes a generator function and starts running it as a task.
...; return "value"; } methods async() create and return an "async function" that starts a new task.
...And 2 more matches
Localization formats
as every new web-dev project takes shape, a project manager should ask themselves these questions and have the answers ready before starting the web l10n process.
...you may choose to present just the html for localization: we give an html file which lists several pieces of content like, <h1>getting started</h1> and the localizer translates to <h1>débuter avec firefox</h1> the localizer then submits the translated html or php back to us by either checking in changes to svn or sending us a patch that pascal checks in.
...that file will have the following structure: ;getting started débuter avec firefox the english content is designated by the semi-colon and the localizer provides the translation underneath.
...And 2 more matches
Statistics API
note: this is the sum of all the slice durations, not end time - start time.
... allocated: integer (mb) - size of the javascript heap in mib at the start of the gc.
...each element of the slices array is an object with these fields: slice: integer - the slice index, starting at 0.
...And 2 more matches
JSAPI User Guide
the application starts out by creating an object and populating it with the standard javascript classes, like array and object.
... once the c++ function returns false, the javascript engine starts unwinding the javascript stack, looking for a catch or finally block to execute.
... the basic consequence is that top-level application code can just set an error reporter and start calling jsapi functions.
...And 2 more matches
Creating a Python XPCOM component
then, the next time mozilla starts, it will rebuild the index of components, including any new one in the 'components' directory.
... it is helpful to then start mozilla from the command line to see if new components register successfully.
...testing it to see this work, you will have to start firefox from the command line, since that'll be where the stuff will be printed out.
...And 2 more matches
nsIAccessibleEditableText
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void copytext(in long startpos, in long endpos); void cuttext(in long startpos, in long endpos); void deletetext(in long startpos, in long endpos); void inserttext(in astring text, in long position); void pastetext(in long position); void setattributes(in long startpos, in long endpos, in nsisupports attributes); unimplemented void settextcontents(in astring text); ...
... void copytext( in long startpos, in long endpos ); parameters startpos start offset of the text to be copied into the clipboard.
... void cuttext( in long startpos, in long endpos ); parameters startpos start offset of the text to be deleted and copied to clipboard.
...And 2 more matches
nsIArray
method overview nsisimpleenumerator enumerate(); unsigned long indexof(in unsigned long startindex, in nsisupports element); void queryelementat(in unsigned long index, in nsiidref uuid, [iid_is(uuid), retval] out nsqiresult result); attributes attribute type description length unsigned long the number of elements in the array.
...return value a new enumerator positioned at the start of the array.
...unsigned long indexof( in unsigned long startindex, in nsisupports element ); parameters startindex the initial element to search in the array.
...And 2 more matches
nsIDOMHTMLTimeRanges
each time range represented by an nsidomhtmltimeranges object has an index number; you call the start() and end() methods to obtain the start and end times of each range, specifying the index number of the range to look up.
... last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) inherits from: nsisupports method overview float start(in unsigned long index); float end(in unsigned long index); attributes attribute type description length unsigned long the number of ranges represented by the nsidomhtmltimeranges object.
... start() returns the time offset to the start of the specified time range.
...And 2 more matches
getFile
starting with firefox 35, this is contents/resources.
... c constant string value notes ns_mac_desktop_dir ns_os_desktop_dir ns_mac_trash_dir "trsh" ns_mac_startup_dir "strt" ns_mac_shutdown_dir "shdwn" ns_mac_apple_menu_dir "applmenu" ns_mac_control_panels_dir "cntlpnl" ns_mac_extensions_dir "exts" ns_mac_fonts_dir "fnts" ns_mac_prefs_dir "prfs" ns_mac_documents_dir "docs" ns_mac_internet_search_dir "isrch" ...
... c constant string value notes ns_win_windows_dir "wind" ns_win_program_files_dir "progf" ns_win_home_dir ns_os_home_dir ns_win_desktop_dir "deskv" virtual folder at the root of the namespace ns_win_programs_dir "progs" user start menu programs directory!
...And 2 more matches
nsIFocusManager
nsidomelement getfocusedelementforwindow(in nsidomwindow awindow, in prbool adeep, out nsidomwindow afocusedwindow); pruint32 getlastfocusmethod(in nsidomwindow window); void movecarettofocus(in nsidomwindow awindow); void elementisfocusable(in nsidomelement aelement, in unsigned long aflags); nsidomelement movefocus(in nsidomwindow awindow, in nsidomelement astartelement, in unsigned long atype, in unsigned long aflags); void setfocus(in nsidomelement aelement, in unsigned long aflags); void windowhidden(in nsidomwindow awindow); native code only!
...if astartelement is specified, then movement is done relative to astartelement.
... if astartelement is null, then movement is done relative to the currently focused element.
...And 2 more matches
nsIHttpServer
if (callback) { this.registerprefixhandler("/", callback); } let host = "localhost"; if (typeof port === "string" && port.indexof(':') != -1){ [host, port] = port.split(':'); port = parseint(port); server.identity.add('http', host, port); } server.wrappedjsobject._start(port, host); return true; }, registerfile: function(path, filepath) { var file = components.classes['@mozilla.org/file/local;1'] .createinstance(components.interfaces.nsilocalfile); file.initwithpath(filepath); return server.registerfile(path, file); }, registerdirectory : function(path, ...
...req, resp); }); }, close: function(){ server.stop(function(){}); }, get port() { return server.identity.primaryport } } } reference : mozilla-release/netwerk/test/httpserver/nsihttpserver.idl [scriptable, uuid(cea8812e-faa6-4013-9396-f9936cbb74ec)] interface nsihttpserver : nsisupports { /** * starts up this server, listening upon the given port.
... * * @param port * the port upon which listening should happen, or -1 if no specific port is * desired * @throws ns_error_already_initialized * if this server is already started * @throws ns_error_not_available * if the server is not started and cannot be started on the desired port * (perhaps because the port is already in use or because the process does * not have privileges to do so) * @note * behavior is undefined if this method is called after stop() has been * called on this but before the provided callback function has been * called.
...And 2 more matches
nsIMsgDatabase
void markreadbydate(in prtime startdate, in prtime enddate, in nsmsgkeyarrayptr markedids); native code only!
...bel); void setstringproperty(in nsmsgkey akey, in string aproperty, in string avalue); void markimapdeleted(in nsmsgkey key, in boolean deleted, in nsidbchangelistener instigator); void applyretentionsettings(in nsimsgretentionsettings amsgretentionsettings, in boolean adeleteviafolder); boolean hasnew(); void clearnewlist(in boolean notify); void addtonewlist(in nsmsgkey key); void startbatch(); void endbatch(); nsimsgofflineimapoperation getofflineopforkey(in nsmsgkey messagekey, in boolean create); void removeofflineop(in nsimsgofflineimapoperation op); nsisimpleenumerator enumerateofflineops(); void listallofflineopids(in nsmsgkeyarrayptr offlineopids); native code only!
... in nsidbchangelistener instigator); isread() boolean isread(in nsmsgkey key); isignored() boolean isignored(in nsmsgkey key); ismarked() boolean ismarked(in nsmsgkey key); hasattachments() boolean hasattachments(in nsmsgkey key); markallread() [noscript] void markallread(in nsmsgkeyarrayptr thosemarked); markreadbydate() [noscript] void markreadbydate (in prtime startdate, in prtime enddate, in nsmsgkeyarrayptr markedids); deletemessages() [noscript] void deletemessages(in nsmsgkeyarrayptr nsmsgkeys, in nsidbchangelistener instigator); deletemessage() void deletemessage(in nsmsgkey key, in nsidbchangelistener instigator, ...
...And 2 more matches
nsIRequestObserver
netwerk/base/public/nsirequestobserver.idlscriptable this interface is used by various streams (such as nsichannel ) to indicate the start and end of a request.
... inherits from: nsisupports last changed in gecko 1.0 method overview void onstartrequest(in nsirequest arequest, in nsisupports acontext); void onstoprequest(in nsirequest arequest, in nsisupports acontext, in nsresult astatuscode); methods onstartrequest() called to signify the beginning of an asynchronous request.
... note: an exception thrown from onstartrequest has the side-effect of causing the request to be canceled.
...And 2 more matches
nsISelectionPrivate
void startbatchchanges(); wstring tostringwithformat(in string formattype, in unsigned long flags, in print32 wrapcolumn); attributes attribute type description cancacheframeoffset boolean frame offset cache can be used just during calling nseditor::endplaceholdertransaction.
... constants constant value description endofprecedingline 0 startofnextline 1 tableselection_none 0 tableselection_cell 1 tableselection_row 2 tableselection_column 3 tableselection_table 4 tableselection_allcells 5 methods addselectionlistener() void addselectionlistener( in nsiselectionlistener newlistener ); parameters newlistener ...
... endbatchchanges() will resume user interface updates after a previous call to startbatchchanges().
...And 2 more matches
nsITraceableChannel
implementing nsistreamlistener the nsistreamlistener passed to setnewlistener() should implement the following methods, which are called to notify it of events that occur on the http stream: onstartrequest: an http request is beginning.
... note: it is critical that you pass along requests to the previous listener as soon as possible -- especially for onstartrequest.
...in particular, listeners typically should not be replaced after onstartrequest has been called.
...And 2 more matches
nsIXULRuntime
to get an instance, use: var xulruntime = components.classes["@mozilla.org/xre/app-info;1"] .getservice(components.interfaces.nsixulruntime); method overview void invalidatecachesonrestart(); attributes attribute type description accessibilityenabled boolean if true, the accessibility service is running.
... browsertabsremoteautostart boolean if true, browser tabs may be opened by default in a different process from the main browser ui.
...if a component encounters startup errors that might prevent the app from showing proper ui, it should set this flag to true.
...And 2 more matches
nsIXULTemplateQueryProcessor
the reference is always a placeholder for the starting point and the member is always a placeholder for the end points (the results).
...for example, a query might have the following syntax: (?id, ?name, ?url) from bookmarks where parentfolder = ?start this query might generate a result for each bookmark within a given folder.
... the variable ?start would be the reference variable, while the variable ?id would be the member variable, since it is the unique value that identifies a result.
...And 2 more matches
Debugger.Script - Firefox Developer Tools
for scripts created by eval or the function constructor, this may be a synthesized filename, starting with a valid url and followed by information tracking how the code was introduced into the system; the entire string is not a valid url.
... startline if the instance refers to a jsscript, the number of the line at which this script’s code starts, within the file or document named by url.
... sourcestart if the instance refers to a jsscript, the character within the debugger.source instance given by source at which this script’s code starts; zero-based.
...And 2 more matches
Work with animations - Firefox Developer Tools
starting in firefox 48, it will show animations applied to the ::before and ::after pseudo-elements.
...the timeline starts at the start of the first animation, ends at the end of the last animation, and is labeled with markers every 250 milliseconds (this depends on the time scale of the animations currently displayed).
... if you hover over the bar, a tooltip appears, giving you more detailed information about the animation or transition, including: the type of animation: css transition, css animation, or web animations api the duration of the animation the animation's start and end delay the animation's easing (or timing function).
...And 2 more matches
AudioParam - Web APIs
the change starts at the time specified for the previous event, follows a linear ramp to the new value given in the value parameter, and reaches the new value at the time given in the endtime parameter.
...the change starts at the time specified for the previous event, follows an exponential ramp to the new value given in the value parameter, and reaches the new value at the time given in the endtime parameter.
... audioparam.settargetattime() schedules the start of a change to the value of the audioparam.
...And 2 more matches
CanvasRenderingContext2D.arc() - Web APIs
syntax void ctx.arc(x, y, radius, startangle, endangle [, anticlockwise]); the arc() method creates a circular arc centered at (x, y) with a radius of radius.
... the path starts at startangle, ends at endangle, and travels in the direction given by anticlockwise (defaulting to clockwise).
... startangle the angle at which the arc starts in radians, measured from the positive x-axis.
...And 2 more matches
CanvasRenderingContext2D.createLinearGradient() - Web APIs
syntax canvasgradient ctx.createlineargradient(x0, y0, x1, y1); the createlineargradient() method is specified by four parameters defining the start and end points of the gradient line.
... parameters x0 the x-axis coordinate of the start point.
... y0 the y-axis coordinate of the start point.
...And 2 more matches
CanvasRenderingContext2D.textAlign - Web APIs
syntax ctx.textalign = "left" || "right" || "center" || "start" || "end"; options possible values: "left" the text is left-aligned.
... "start" the text is aligned at the normal start of the line (left-aligned for left-to-right locales, right-aligned for right-to-left locales).
... the default value is "start".
...And 2 more matches
DataTransfer.effectAllowed - Web APIs
this property should be set in the dragstart event to set the desired drag effect for the drag source.
... within the dragenter and dragover event handlers, this property will be set to whatever value was assigned during the dragstart event, thus effectallowed may be used to determine which effect is permitted.
... assigning a value to effectallowed in events other than dragstart has no effect.
...And 2 more matches
Using files from web applications - Web APIs
function handlefiles(files) { for (let i = 0; i < files.length; i++) { const file = files[i]; if (!file.type.startswith('image/')){ continue } const img = document.createelement("img"); img.classlist.add("obj"); img.file = file; preview.appendchild(img); // assuming that "preview" is the div output where the content will be displayed.
...after creating the new filereader object, we set up its onload function and then call readasdataurl() to start the read operation in the background.
...t img = document.createelement("img"); img.src = url.createobjecturl(this.files[i]); img.height = 60; img.onload = function() { url.revokeobjecturl(this.src); } li.appendchild(img); const info = document.createelement("span"); info.innerhtml = this.files[i].name + ": " + this.files[i].size + " bytes"; li.appendchild(info); } } } this starts by fetching the url of the <div> with the id filelist.
...And 2 more matches
FileHandle API - Web APIs
writing there are three possible writing operations on a locked file: write : it's an arbitrary writing method which starts writing in the file at the lockedfile.location byte.
... // get a lockedfile object from the handle var myfile = myfilehandle.open('readwrite'); // start a writing operation var writing = myfile.append('some content'); writing.onsuccess = function () { console.log('writing operation successful'); } writing.onerror = function () { console.log('something goes wrong in the writing process: ' + this.error); } reading it's possible to directly write the content of a lockedfile object without using an intermediate file object and a filereader object.
... those two methods expect a size to indicate how many bytes must be read starting at the lockedfile.location byte.
...And 2 more matches
HTMLElement - Web APIs
toucheventhandlers.ontouchstart returns the event handling code for the touchstart event.
... animationstart fired when an animation starts.
... also available via the onanimationstart property.
...And 2 more matches
HTMLMediaElement - Web APIs
htmlmediaelement.currenttime a double-precision floating-point value indicating the current playback time in seconds; if the media has not started to play and has not been seeked, this value is the media's initial playback time.
... htmlmediaelement.loop a boolean that reflects the loop html attribute, which indicates whether the media element should start over when it reaches the end.
...the best time to set a new length is after the loadedmetadata event fires, when the audio info is known, but before the audio has started or mozaudioavailable events have begun firing.
...And 2 more matches
Ajax navigation example - Web APIs
first_page.php: <?php $page_title = "first page"; $as_json = false; if (isset($_get["view_as"]) && $_get["view_as"] == "json") { $as_json = true; ob_start(); } else { ?> <!doctype html> <html> <head> <?php include "include/header.php"; echo "<title>" .
..."</title>"; ?> </head> <body> <?php include "include/before_content.php"; ?> <p>this paragraph is shown only when the navigation starts from <strong>first_page.php</strong>.</p> <div id="ajax-content"> <?php } ?> <p>this is the content of <strong>first_page.php</strong>.</p> <?php if ($as_json) { echo json_encode(array("page" => $page_title, "content" => ob_get_clean())); } else { ?> </div> <p>this paragraph is shown only when the navigation starts from <strong>first_page.php</strong>.</p> <?php include "include/after_content.php"; echo "</body>\n</html>"; } ?> second_page.php: <?php $page_title = "second page"; $as_json = false; if (isset($_get["view_as"]) && $_get["view_as"] == "json") { $as_json = true;...
... ob_start(); } else { ?> <!doctype html> <html> <head> <?php include "include/header.php"; echo "<title>" .
...And 2 more matches
Working with the History API - Web APIs
because firefox saves state objects to the user's disk so they can be restored after the user restarts the browser, we impose a size limit of 640k characters on the serialized representation of a state object.
...note that the browser won't attempt to load this url after a call to pushstate(), but it might attempt to load the url later, for instance after the user restarts the browser.
...starting in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3), the object is serialized using the structured clone algorithm.
...And 2 more matches
PerformanceEntry.duration - Web APIs
the value returned by this property depends on the performance entry's type: "frame" - returns a timestamp indicating the difference between the starttimes of two successive frames.
... "navigation" - returns the timestamp that is the difference between the performancenavigationtiming.loadeventend and performanceentry.starttime properties, respectively.
... "resource" - returns the difference between the resource's responseend timestamp and its starttime timestamp.
...And 2 more matches
Using Pointer Events - Web APIs
</canvas> <br> <button onclick="startup()">initialize</button> <br> log: <pre id="log" style="border: 1px solid #ccc;"></pre> setting up the event handlers when the page loads, the startup() function shown below should be called by our <body> element's onload attribute (but in the example we use a button to trigger it, due to limitations of the mdn live example system).
... function startup() { var el = document.getelementsbytagname("canvas")[0]; el.addeventlistener("pointerdown", handlestart, false); el.addeventlistener("pointerup", handleend, false); el.addeventlistener("pointercancel", handlecancel, false); el.addeventlistener("pointermove", handlemove, false); log("initialized."); } this simply sets up all the event listeners for our <canvas> element so we can handle the touch events as they occur.
... var ongoingtouches = new array(); when a pointerdown event occurs, indicating that a new touch on the surface has occurred, the handlestart() function below is called.
...And 2 more matches
RTCPeerConnection: iceconnectionstatechange event - Web APIs
bubbles no cancelable no interface event event handler property oniceconnectionstatechange one common task performed by the iceconnectionstatechange event listener: to trigger ice restart when the state changes to failed.
... see ice restart in lifetime of a webrtc session for further information.
... usage notes a successful connection attempt will typically involve the state starting at new, then transitioning through checking, then connected, and finally completed.
...And 2 more matches
Range.setEnd() - Web APIs
WebAPIRangesetEnd
the range.setend() method sets the end position of a range to be located at the given offset into the specified node x.setting the end point above (higher in the document) than the start point will result in a collapsed range with the start and end points both set to the specified end position.
... endoffset an integer greater than or equal to zero representing the offset for the end of the range from the start of endnode.
... usage notes if the endnode is a node of type text, comment, or cdatasection, then endoffset is the number of characters from the start of endnode.
...And 2 more matches
Selection API - Web APIs
you can run code in response to the selection being changed, or a new selection being started, using the globaleventhandlers.onselectionchange and globaleventhandlers.onselectstart event handlers.
... globaleventhandlers.onselectstart represents the event handler that is called when a selectstart event is fired on the current object (i.e.
...afari on iossamsung internetselection experimentalchrome full support 1edge full support 12firefox full support 1notes full support 1notes notes the globaleventhandlers.onselectionchange and globaleventhandlers.onselectstart event handlers are supported as of firefox 52.ie full support 9opera full support 9safari full support 1webview android full support 1chrome android full support 18firefox an...
...And 2 more matches
A simple RTCDataChannel sample - Web APIs
starting up when the script is run, we set up an load event listener, so that once the page is fully loaded, our startup() function is called.
... 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.
... note: even though both ends of our connection will be on the same page, we're going to refer to the one that starts the connection as the "local" one, and to the other as the "remote" end.
...And 2 more matches
Geometry and reference spaces in WebXR - Web APIs
all times and durations in webxr are measured using the domhighrestimestamp type, which is a double-precision floating-point value specifying the time in milliseconds relative to the starting time.
...specifically, under the initial starting conditions, with the default orientation of the viewer upon the space: the x-axis extends horizontally from left to right away from the origin, with the x coordinate of +1.0 being located at the right edge of the world.
...this indicates the position of the headset in space at the start of your use of the xr system, with the origin (0, 0, 0) being positioned basically at the bridge of your nose.
...And 2 more matches
XRSession - Web APIs
WebAPIXRSession
the select event is sent after the selectstart event is sent and immediately before the selectend event is sent.
... selectstart an event of type xrinputsourceevent which is sent to the session object when one of its input devices is first engaged by the user in such a way as to cause the primary action to begin.
... also available through the onselectstart event handler property.
...And 2 more matches
Mastering Wrapping of Flex Items - CSS: Cascading Style Sheets
the container will need to have a height in order that the items will start wrapping and creating new columns, and items will stretch taller to fill each column completely.
...if flex-direction is set to row-reverse then the items will start from the end edge of the container and lay themselves out in reverse ordered lines.
...we start on the right then go onto the second line and again start from the right.
...And 2 more matches
Ordering Flex Items - CSS: Cascading Style Sheets
reverse the display of the items the flex-direction property can take one of four values: row column row-reverse column-reverse the first two values ​​keep the items in the same order that they appear in the document source order and display them sequentially from the start line.
... the second two values ​​reverse the items by switching the start and end lines.
... remember that the start line relates to writing modes.
...And 2 more matches
Typical use cases of Flexbox - CSS: Cascading Style Sheets
you could also use flex-start to place the space at the end of the items, flex-end to place it before them, or center to centre the navigation items.
...the items are aligned on the main axis with flex-start as this is the initial behaviour of flexbox, and we are aligning the item on the right by giving it a left margin of auto.
... you can play with the alignment, aligning the item to the start with flex-start or end with flex-end.
...And 2 more matches
Basic concepts of Logical Properties and Values - CSS: Cascading Style Sheets
start and end as opposed to left and right/top and bottom.
...these properties are flow relative — justify-self: start aligns the item to the start on the inline dimension, align-self: start does the same on the block dimension.
...some of the properties are essentially mappings from the physical versions, for example inline-size for width or margin-inline-start rather than margin-left.
...And 2 more matches
Using CSS transitions - CSS: Cascading Style Sheets
animations that involve transitioning between two states are often called implicit transitions as the states in between the start and final states are implicitly defined by the browser.
... css transitions let you decide which properties to animate (by listing them explicitly), when the animation will start (by setting a delay), how long the transition will last (by setting a duration), and how the transition will run (by defining a timing function, e.g.
... you can control the individual components of the transition with the following sub-properties: (note that these transitions loop infinitely only for the purpose of our examples; css transitions only visualize a property change from start to finish.
...And 2 more matches
Animatable CSS properties - CSS: Cascading Style Sheets
ine-radius-topleft -moz-outline-radius-topright -webkit-line-clamp -webkit-text-fill-color -webkit-text-stroke -webkit-text-stroke-color all backdrop-filter background background-color background-position background-size block-size border border-block-end border-block-end-color border-block-end-width border-block-start border-block-start-color border-block-start-width border-bottom border-bottom-color border-bottom-left-radius border-bottom-right-radius border-bottom-width border-color border-end-end-radius border-end-start-radius border-image-outset border-image-slice border-image-width border-inline-end border-inline-end-color bor...
...der-inline-end-width border-inline-start border-inline-start-color border-inline-start-width border-left border-left-color border-left-width border-radius border-right border-right-color border-right-width border-start-end-radius border-start-start-radius border-top border-top-color border-top-left-radius border-top-right-radius border-top-width border-width bottom box-shadow caret-color clip clip-path color column-count column-gap column-rule column-rule-color column-rule-width column-width columns filter flex flex-basis flex-grow flex-shrink font font-size font-size-adjust font-stretch font-...
...variation-settings font-weight gap grid-column-gap grid-gap grid-row-gap grid-template-columns grid-template-rows height inline-size inset inset-block inset-block-end inset-block-start inset-inline inset-inline-end inset-inline-start left letter-spacing line-clamp line-height margin margin-block-end margin-block-start margin-bottom margin-inline-end margin-inline-start margin-left margin-right margin-top mask mask-border mask-position mask-size max-block-size max-height max-inline-size max-lines max-width min-block-size min-height min-inline-size min-width object-position offset...
...And 2 more matches
Mozilla CSS extensions - CSS: Cascading Style Sheets
t -moz-outline-radius-bottomright -moz-outline-radius-topleft -moz-outline-radius-topright overflow-clip-box overflow-clip-box-block overflow-clip-box-inline s–z -moz-stack-sizing :-moz-system-metric(images-in-menus) :-moz-system-metric(mac-graphite-theme) :-moz-system-metric(scrollbar-end-backward) :-moz-system-metric(scrollbar-end-forward) :-moz-system-metric(scrollbar-start-backward) :-moz-system-metric(scrollbar-start-forward) :-moz-system-metric(scrollbar-thumb-proportional) :-moz-system-metric(touch-enabled) :-moz-system-metric(windows-default-theme) -moz-user-focus -moz-user-input -moz-user-modify -moz-window-dragging -moz-window-shadow formerly proprietary properties that are now standard note: to maximize the compatibility of your css, ...
...ground-sizeobsolete since gecko 2 -moz-border-end [superseded by the standard version border-inline-end] -moz-border-end-color [superseded by the standard version border-inline-end-color] -moz-border-end-style [superseded by the standard version border-inline-end-style] -moz-border-end-width [superseded by the standard version border-inline-end-width] -moz-border-image -moz-border-start [superseded by the standard version border-inline-start] -moz-border-start-color [superseded by the standard version border-inline-start-color] -moz-border-start-style [superseded by the standard version border-inline-start-style] -moz-border-start-width [superseded by the standard version border-inline-start-width] -moz-box-sizing [prefixed version still accepted] c clip-pat...
...oz-column-rule-color [prefixed version still accepted] -moz-context-properties f–m filter [applying to more than svg] -moz-font-feature-settings [prefixed version still accepted] -moz-font-language-override [prefixed version still accepted] -moz-hyphens [prefixed version still accepted] -moz-margin-end [superseded by the standard version margin-inline-end] -moz-margin-start [superseded by the standard version margin-inline-start] mask [applying to more than svg] o -moz-opacityobsolete since gecko 1.9.1 -moz-outlineobsolete since gecko 1.9.2 -moz-outline-colorobsolete since gecko 1.9.2 -moz-outline-offsetobsolete since gecko 1.9.2 -moz-outline-styleobsolete since gecko 1.9.2 -moz-outline-widthobsolete since gecko 1.9.2 p -moz-padding-end [su...
...And 2 more matches
WebKit CSS extensions - CSS: Cascading Style Sheets
border-after** -webkit-border-after-color** -webkit-border-after-style** -webkit-border-after-width** -webkit-border-before** -webkit-border-before-color** -webkit-border-before-style** -webkit-border-before-width** -webkit-border-end** -webkit-border-end-color** -webkit-border-end-style** -webkit-border-end-width** -webkit-border-fit -webkit-border-horizontal-spacing -webkit-border-start** -webkit-border-start-color** -webkit-border-start-style** -webkit-border-start-width** -webkit-border-vertical-spacing -webkit-box-align** -webkit-box-direction** -webkit-box-flex-group** -webkit-box-flex** -webkit-box-lines** -webkit-box-ordinal-group** -webkit-box-orient** -webkit-box-pack** -webkit-box-reflect** c -webkit-column-axis -webkit-column-break-after -webkit-col...
...it-initial-letter l -webkit-line-align -webkit-line-box-contain -webkit-line-clamp -webkit-line-grid -webkit-line-snap -webkit-locale -webkit-logical-height -webkit-logical-width m -webkit-margin-after-collapse -webkit-margin-after -webkit-margin-before-collapse -webkit-margin-before -webkit-margin-bottom-collapse -webkit-margin-collapse -webkit-margin-end** -webkit-margin-start** -webkit-margin-top-collapse -webkit-marquee-direction -webkit-marquee-increment -webkit-marquee-repetition -webkit-marquee-speed -webkit-marquee-style -webkit-marquee -webkit-mask-box-image-outset -webkit-mask-box-image-repeat -webkit-mask-box-image-slice -webkit-mask-box-image-source -webkit-mask-box-image-width -webkit-mask-box-image -webkit-mask-repeat-x -webkit-mask-repeat-y ...
... -webkit-mask-source-type -webkit-max-logical-height -webkit-max-logical-width -webkit-min-logical-height -webkit-min-logical-width n -webkit-nbsp-mode p -webkit-padding-after** -webkit-padding-before** -webkit-padding-end** -webkit-padding-start** -webkit-perspective-origin-x -webkit-perspective-origin-y -webkit-print-color-adjust r-s -webkit-rtl-ordering -webkit-svg-shadow t -webkit-tap-highlight-color -webkit-text-combine -webkit-text-decoration-skip -webkit-text-decorations-in-effect -webkit-text-fill-color -webkit-text-security -webkit-text-stroke-color -webkit-text-stroke-width -webkit-text-stroke -webkit-text-zoom -webkit-transform-origin-x -webkit-transform-origin-y -webkit-transform-origin-z u -webkit-user-drag -webkit-user-modify * a...
...And 2 more matches
clear - CSS: Cascading Style Sheets
WebCSSclear
#container::after { content: ""; display: block; clear: both; } syntax /* keyword values */ clear: none; clear: left; clear: right; clear: both; clear: inline-start; clear: inline-end; /* global values */ clear: inherit; clear: initial; clear: unset; values none is a keyword indicating that the element is not moved down to clear past floating elements.
... inline-start is a keyword indicating that the element is moved down to clear floats on start side of its containing block, that is the left floats on ltr scripts and the right floats on rtl scripts.
... formal definition initial valuenoneapplies toblock-level elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax none | left | right | both | inline-start | inline-end examples clear: left html <div class="wrapper"> <p class="black">lorem ipsum dolor sit amet, consectetuer adipiscing elit.
...And 2 more matches
conic-gradient() - CSS: Cascading Style Sheets
syntax /* a conic gradient rotated 45 degrees, starting blue and finishing red */ conic-gradient(from 45deg, blue, red); /* a a bluish purple box: the gradient goes from blue to red, but as only the bottom right quadrant is visible, as the center of the conic gradient is in at the top left corner */ conic-gradient(from 90deg at 0 0, blue, red); /* colorwheel */ background: conic-gradient( hsl(360, 100%, 50%), hsl(315, 100%, 50%), ...
...with conic gradients, the colors transition as as if spun around the center of a circle, starting at the top and going clockwise.
...the starting point of the gradient or arc is north, or 12:00pm.
...And 2 more matches
Setting up adaptive streaming media sources - Developer guides
other reasons to use live profile over ondemand for vod content may be: your client or server does not support range requests your server cannot cache range requests efficiently your server cannot prefetch range requests efficiently the sidx* is large and having to load it first slows down startup a little you want to use the original files for both dash and other forms of delivery (such as microsoft smooth streaming) as a transition strategy you can use the same media files for both live transmission and vod at a later stage *sidx or segmentindexbox is a structure describing a segment by giving its earliest presentation time and other meta-data and can often make up a large portion ...
...2011" xsi:schemalocation="urn:mpeg:dash:schema:mpd:2011 dash-mpd.xsd" type="static" mediapresentationduration="pt654s" minbuffertime="pt2s" profiles="urn:mpeg:dash:profile:isoff-on-demand:2011"> <baseurl>http://example.com/ondemand/</baseurl> <period> <!-- english audio --> <adaptationset mimetype="audio/mp4" codecs="mp4a.40.5" lang="en" subsegmentalignment="true" subsegmentstartswithsap="1"> <representation id="1" bandwidth="64000"> <baseurl>elephantsdream_aac48k_064.mp4.dash</baseurl> </representation> </adaptationset> <!-- video --> <adaptationset mimetype="video/mp4" codecs="avc1.42401e" subsegmentalignment="true" subsegmentstartswithsap="1"> <representation id="2" bandwidth="100000" width="480" height="360"> <baseurl>elep...
... <?xml version="1.0"?> <mpd xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="urn:mpeg:dash:schema:mpd:2011" xsi:schemalocation="urn:mpeg:dash:schema:mpd:2011" profiles="urn:mpeg:dash:profile:isoff-main:2011" type="static" mediapresentationduration="pt0h9m56.46s"> <baseurl> http://example.com/segments </baseurl> <period start="pt0s"> <adaptationset bitstreamswitching="true"> <representation id="0" codecs="avc1" mimetype="video/mp4" width="320" height="240" startwithsap="1" bandwidth="46986"> <segmentbase> <initialization sourceurl="main/news100/1.m4s" range="0-862"/> </segmentbase> <segmentlist duration="1"> <segmenturl media="main/news100/2.m4s" med...
...And 2 more matches
Media buffering, seeking, and time ranges - Developer guides
this will work with <audio> or <video>; for now let's consider a simple audio example: <audio id="my-audio" controls src="music.mp3"> </audio> we can access these attributes like so: var myaudio = document.getelementbyid('my-audio'); var bufferedtimeranges = myaudio.buffered; timeranges object timeranges are a series of non-overlapping ranges of time, with start and stop times.
... start(index): the start time, in seconds, of a time range.
... ------------------------------------------------------ |=============| |===========| | ------------------------------------------------------ 0 5 15 19 21 for this audio instance, the associated timeranges object would have the following available properties: myaudio.buffered.length; // returns 2 myaudio.buffered.start(0); // returns 0 myaudio.buffered.end(0); // returns 5 myaudio.buffered.start(1); // returns 15 myaudio.buffered.end(1); // returns 19 to try out and visualize buffered time ranges we can write a little bit of html: <p> <audio id="my-audio" controls> <source src="music.mp3" type="audio/mpeg"> </audio> </p> <p> <canvas id="my-canvas" width="300" height="20"> </canvas> </p> and a...
...And 2 more matches
<input type="button"> - HTML: Hypertext Markup Language
WebHTMLElementinputbutton
a simple button we'll begin by creating a simple button with a click event handler that starts our machine (well, it toggles the value of the button and the text content of the following paragraph): <form> <input type="button" value="start machine"> </form> <p>the machine is stopped.</p> const button = document.queryselector('input'); const paragraph = document.queryselector('p'); button.addeventlistener('click', updatebutton); function updatebutton() { if (button.value === 'start...
... machine') { button.value = 'stop machine'; paragraph.textcontent = 'the machine has started!'; } else { button.value = 'start machine'; paragraph.textcontent = 'the machine is stopped.'; } } the script gets a reference to the htmlinputelement object representing the <input> in the dom, saving this refence in the variable button.
... <form> <input type="button" value="start machine" accesskey="s"> </form> <p>the machine is stopped.</p> const button = document.queryselector('input'); const paragraph = document.queryselector('p'); button.addeventlistener('click', updatebutton); function updatebutton() { if (button.value === 'start machine') { button.value = 'stop machine'; paragraph.textcontent = 'the machine has started!'; } else { button.value ...
...And 2 more matches
<input type="week"> - HTML: Hypertext Markup Language
WebHTMLElementinputweek
you can set a default value for the input by including a value inside the value attribute, like so: <label for="week">what week would you like to start?</label> <input id="week" type="week" name="week" value="2017-w01"> one thing to note is that the displayed format may differ from the actual value, which is always formatted yyyy-www.
... basic uses of week the simplest use of <input type="week"> involves a basic <input> and <label> element combination, as seen below: <form> <label for="week">what week would you like to start?</label> <input id="week" type="week" name="week"> </form> controlling input size <input type="week"> doesn't support form sizing attributes such as size.
...in the following example we are setting a minimum value of week 01, 2017 and a maximum value of week 52, 2017: <form> <label for="week">what week would you like to start?</label> <input id="week" type="week" name="week" min="2017-w01" max="2017-w52"> <span class="validity"></span> </form> here's the css used in the above example.
...And 2 more matches
<ol>: The Ordered List element - HTML: Hypertext Markup Language
WebHTMLElementol
tag omission none, both the starting and ending tag are mandatory.
... start an integer to start counting from for the list items.
...for example, to start numbering elements from the letter "d" or the roman numeral "iv," use start="4".
...And 2 more matches
HTML documentation index - HTML: Hypertext Markup Language
WebHTMLIndex
150 <listing> element, html, obsolete, reference, web the html listing element (<listing>) renders text between the start and end tags without interpreting the html in between and using a monospaced font.
... 176 <plaintext>: the plain text element (deprecated) element, html, obsolete, plain text, reference, web, plaintext the html plaintext element (<plaintext>) renders everything following the start tag as raw text, ignoring any following html.
... 220 <xmp> element, html, obsolete, reference, web the html example element (<xmp>) renders text between the start and end tags without interpreting the html in between and using a monospaced font.
...And 2 more matches
JavaScript modules - JavaScript
« previous this guide gives you all you need to get started with javascript module syntax.
... a background on modules javascript programs started off pretty small — most of its usage in the early days was to do isolated scripting tasks, providing a bit of interactivity to your web pages where needed, so large scripts were generally not needed.
... it has therefore made sense in recent years to start thinking about providing mechanisms for splitting javascript programs up into separate modules that can be imported when needed.
...And 2 more matches
Promise - JavaScript
to understand this, start by scrolling to the bottom of the code block, and examine the promise chain.
...in this example, the promise chain is initiated by a custom written new promise() construct; but in actual practice, promise chains more typically start with an api function (written by someone else) that returns a promise.
...it creates a promise that will be fulfilled, using window.settimeout(), to the promise count (number starting from 1) every 1-3 seconds, at random.
...And 2 more matches
String - JavaScript
string.prototype.codepointat(pos) returns a nonnegative integer number that is the code point value of the utf-16 encoded code point starting at the specified pos.
... string.prototype.padstart(targetlength [, padstring]) pads the current string from the start with a given string and returns a new string of the length targetlength.
... string.prototype.startswith(searchstring [, length]) determines whether the calling string begins with the characters of string searchstring.
...And 2 more matches
Progressive web app structure - Progressive web apps (PWAs)
we will start with analyzing the js13kpwa application, why it is built that way, and what benefits it brings.
... progressive: start with the "good, old basic website” and progressively add new features while remembering to detect if they are available in the browser and gracefully handle any errors that crop up if support is not available.
... the app shell model requires all the resources to be available before the website can start rendering.
...And 2 more matches
How to make PWAs installable - Progressive web apps (PWAs)
it contains useful information, such as the app’s title, paths to different-sized icons that can be used to represent the app on an os (such as an icon on the home screen, an entry in the start menu, or an icon on the desktop), and a background color to use in loading or splash screens.
... { "src": "icons/icon-512.png", "sizes": "512x512", "type": "image/png" } ], "start_url": "/pwa-examples/js13kpwa/index.html", "display": "fullscreen", "theme_color": "#b12a34", "background_color": "#b12a34" } most of the fields are self-explanatory, but to be certain we're on the same page: name: the full name of your web app.
... start_url: the index document to launch when starting the app.
...And 2 more matches
height - SVG: Scalable Vector Graphics
WebSVGAttributeheight
value auto | <length> | <percentage> default value auto (treated as 0) animatable yes note: starting with svg2, height is a geometry property meaning this attribute can also be used as a css property for <foreignobject>.
... value auto | <length> | <percentage> default value auto (treated as the intrinsic height of the image) animatable yes note: starting with svg2, height is a geometry property meaning this attribute can also be used as a css property for images.
... value auto | <length> | <percentage> default value auto (treated as 0) animatable yes note: starting with svg2, height is a geometry property meaning this attribute can also be used as a css property for rectangles.
...And 2 more matches
width - SVG: Scalable Vector Graphics
WebSVGAttributewidth
value auto | <length> | <percentage> default value auto (treated as 0) animatable yes note: starting with svg2, width is a geometry property meaning this attribute can also be used as a css property for <foreignobject>.
... value auto | <length> | <percentage> default value auto (treated as the intrinsic width of the image) animatable yes note: starting with svg2, width is a geometry property meaning this attribute can also be used as a css property for images.
... value auto | <length> | <percentage> default value auto (treated as 0) animatable yes note: starting with svg2, width is a geometry property meaning this attribute can also be used as a css property for rectangles.
...And 2 more matches
x - SVG: Scalable Vector Graphics
WebSVGAttributex
value <length> | <percentage> default value 0 animatable yes note: starting with svg2, x is a geometry property meaning this attribute can also be used as a css property for <foreignobject>.
... value <length> | <percentage> default value 0 animatable yes note: starting with svg2, x is a geometry property meaning this attribute can also be used as a css property for images.
... value <length> | <percentage> default value 0 animatable yes note: starting with svg2, x is a geometry property meaning this attribute can also be used as a css property for rectangles.
...And 2 more matches
y - SVG: Scalable Vector Graphics
WebSVGAttributey
value <length> | <percentage> default value 0 animatable yes note: starting with svg2, y is a geometry property meaning this attribute can also be used as a css property for <foreignobject>.
... value <length> | <percentage> default value 0 animatable yes note: starting with svg2, y is a geometry property meaning this attribute can also be used as a css property for images.
... value <length> | <percentage> default value 0 animatable yes note: starting with svg2, y is a geometry property meaning this attribute can also be used as a css property for rectangles.
...And 2 more matches
SVG Attribute reference - SVG: Scalable Vector Graphics
WebSVGAttribute
rtical glyphref gradienttransform gradientunits h hanging height href hreflang horiz-adv-x horiz-origin-x i id ideographic image-rendering in in2 intercept k k k1 k2 k3 k4 kernelmatrix kernelunitlength kerning keypoints keysplines keytimes l lang lengthadjust letter-spacing lighting-color limitingconeangle local m marker-end marker-mid marker-start markerheight markerunits markerwidth mask maskcontentunits maskunits mathematical max media method min mode n name numoctaves o offset opacity operator order orient orientation origin overflow overline-position overline-thickness p panose-1 paint-order path pathlength patterncontentunits patterntransform patternunits ping pointer-events points points...
...atx pointsaty pointsatz preservealpha preserveaspectratio primitiveunits r r radius referrerpolicy refx refy rel rendering-intent repeatcount repeatdur requiredextensions requiredfeatures restart result rotate rx ry s scale seed shape-rendering slope spacing specularconstant specularexponent speed spreadmethod startoffset stddeviation stemh stemv stitchtiles stop-color stop-opacity strikethrough-position strikethrough-thickness string stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width style surfacescale systemlanguage t tabindex tablevalues target targetx targety text-anchor text-decoration text-rendering textlength to transform transform-origin type ...
...rofile, color-rendering, cursor, direction, display, dominant-baseline, enable-background, fill, fill-opacity, fill-rule, filter, flood-color, flood-opacity, font-family, font-size, font-size-adjust, font-stretch, font-style, font-variant, font-weight, glyph-orientation-horizontal, glyph-orientation-vertical, image-rendering, kerning, letter-spacing, lighting-color, marker-end, marker-mid, marker-start, mask, opacity, overflow, pointer-events, shape-rendering, stop-color, stop-opacity, stroke, stroke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, text-decoration, text-rendering, transform, transform-origin, unicode-bidi, vector-effect, visibility, word-spacing, writing-mode filters attributes filter primitive attrib...
...And 2 more matches
<radialGradient> - SVG: Scalable Vector Graphics
value type: <length> ; default value: 50%; animatable: yes fr this attribute defines the radius of the start circle of the radial gradient.
... the gradient will be drawn such that the 0% <stop> is mapped to the perimeter of the start circle.
... value type: <length> ; default value: 50%; animatable: yes fx this attribute defines the x coordinate of the start circle of the radial gradient.
...And 2 more matches
panel - Archive of obsolete content
// // set the focus to the text area so the user can // just start typing.
...// // set the focus to the text area so the user can // just start typing.
...this may take one of the following values: "start": load content scripts immediately after the document element for the panel is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the panel has been loaded, at the time the window.onl...
...this may have one of the following values: "start": load content scripts immediately after the document element for the panel is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the panel has been loaded, at the time the window.onload even...
dev/panel - Archive of obsolete content
or exports.mypanel = mypanel; // create a new tool, initialized // with the new constructor const mytool = new tool({ panels: { mypanel: mypanel } }); in the panel document: retrieve the messageport from the event, and use it to send messages to the add-on // my-panel.js window.addeventlistener("message", function(event) { // retrieve the port var toaddon = event.ports[0]; toaddon.start(); toaddon.postmessage("message from the panel document"); console.log(toaddon); }); communicating with the debugger server the firefox developer tools use a client/server protocol: a tool, such as a javascript debugger or style editor, is the client, and the program being debugged, such as firefox, is the server.
...in.js // require the sdk modules const { panel } = require("dev/panel"); const { tool } = require("dev/toolbox"); const { class } = require("sdk/core/heritage"); const mypanel = class({ extends: panel, label: "my panel", tooltip: "my new devtool's panel", icon: "./my-icon.png", url: "./my-panel.html", setup: function(options) { this.debuggee = options.debuggee; this.debuggee.start(); this.debuggee.onmessage = function(event) { console.log(event.data); } this.debuggee.postmessage({ "to":"root", "type":"listtabs" }); } }); // export the constructor exports.mypanel = mypanel; // create a new tool, initialized // with the new constructor const mytool = new tool({ panels: { mypanel: mypanel } }); more usefully, you can pass debuggee from...
...ol } = require("dev/toolbox"); const { class } = require("sdk/core/heritage"); const mypanel = class({ extends: panel, label: "my panel", tooltip: "my new devtool's panel", icon: "./my-icon.png", url: "./my-panel.html", setup: function(options) { this.debuggee = options.debuggee; }, dispose: function() { this.debuggee = null; }, onready: function() { this.debuggee.start(); this.postmessage("port", [this.debuggee]); } }); // export the constructor exports.mypanel = mypanel; // create a new tool, initialized // with the new constructor const mytool = new tool({ panels: { mypanel: mypanel } }); in my-panel.js: // my-panel.js var content = document.getelementbyid("content"); window.addeventlistener("message", function(event) { var debuggee = event.po...
...rts[0]; console.log(debuggee); debuggee.onmessage = function(event) { content.textcontent = json.stringify(event.data); } debuggee.postmessage({ "to":"root", "type":"listtabs" }); }); if you do this, don't forget to call start() on the port before passing it over to the panel document.
Examples and demos from articles - Archive of obsolete content
in such a condition is difficult and unnatural to keep track of all events started and then to stop them when appropriate through the cleartimeout() function.
... a possible approach to solve this problem is to nest all the informations needed by each animation to start, stop, etc.
...in such a condition is difficult and unnatural to keep track of all events started and then to stop them when appropriate through the cleartimeout() function.
... a possible approach to solve this problem is to nest all the informations needed by each animation to start, stop, etc.
Preferences - Archive of obsolete content
for example, most accessibility preferences in mozilla start with "accessibility." this means that all existing preferences can be imagined as if they were in a tree, like this: + | +-- accessibility | | | +-- typeaheadfind | | | | | +-- autostart (accessibility.typeaheadfind.autostart) | | | | | +-- enablesound (accessibility.typeaheadfind.enablesound) | | | ...
... another caveat you should be aware of is that nsiprefbranch.getchildlist("",{}) returns an array of preference names that start with that branch's root, for example var branch = prefs.getbranch("accessibility."); var children = branch.getchildlist("", {}); will return these items (for the example tree above): "typeaheadfind.autostart", "typeaheadfind.enablesound", and "usebrailledisplay", not just direct children ("typeaheadfind" and "usebrailledisplay"), as you might have expected.
... using preference observers changes a user makes to your extension's preferences, such as through an options dialog, may not take effect until the browser is restarted (e.g., if you have initialized local variables when the browser loads).
...g preferences across clients using sync lxr pages for libpref, the source code module that implements the preferences system a javascript wrapper for preferences api adding preferences to an extension — a simple tutorial with a working extension that illustrates the use of preference observers inline options - how to use the new preference ui that appears inline in the add-on manager window starting in firefox 7 .
Performance best practices in extensions - Archive of obsolete content
improving startup performance extensions are loaded and run whenever a new browser window opens.
... load only what you need, when you need it don't load things during startup that are only needed if the user clicks a button, or if a given preference is enabled when it's not.
... defer everything that you can most extensions have a load event listener in the main overlay that runs their startup functions.
...this is especially bad for the latter if the selector can dynamically start or stop matching.
Session store API - Archive of obsolete content
it's worth noting that this event is sent even if tab loading at startup is deferred until the user selects the tab.
... restoring without restarting firefox 3.6 note this section applies to firefox 3.6 and later.
...this can be on startup or in response to undo close tab, since closed tabs are restored as single-tab sessions.
... starting in firefox 3.5, notifications are sent after reading session store data and before using it, as well as immediately before writing it back to disk.
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
around that time, i started discovering great sites like glish.com and bluerobot.com.
... i also found a lot of trouble ensuring a consistent vertical start position of columns using floats.
...it also guarantees each column will start in the same vertical position.
...by doing this, we don't have to override any of the screen styles, giving us a blank slate to start with for print styles.
Autodial for Windows NT - Archive of obsolete content
starting with windows nt, and in all nt-based versions (windows nt, windows 2000, and windows xp, including xp home) microsoft has changed the behavior of autodial.
...also, if any address that starts with www is in the database, then any other address that begins with www is considered to be in the database.
...if you are using a system with just a modem, the best approach is to configure the remote access auto connection service to automatically start.
...starting in mozilla 1.1, autodial is triggered whenever an address can't be reached (mozilla now mimics the remote access autodial service.) see bug 160846, bug 167624, and bug 160846.
Compiling The npruntime Sample Plugin in Visual Studio - Archive of obsolete content
general decisions filename of dll must start with "np" (not "ns") and ends with ".dll" (i wasted hours on this - repeatedly) mimetype reflects the data type handled by the plugin.
... again note that the resulting dll filename must start with "np", so either call your project like this or rename the file later delete the .cpp and .h and readme files from the project and disk (if you did not create an empty project) copy the npruntime sample plugin source code into the dir of the new vs project and add the files to the project using the vs gui (.cpp files to "source files", .h files to "header files", .rc file to "resource files...
...to reflect your plugin remove the function npp_getjavaclass from npp_gate.cpp build rename the resulting dll so that the filename starts with "np" and ends with ".dll" (or "32.dll"?
... 8.3?) and copy it in mozilla's "plugins" folder start mozilla and open about:plugins to verify the plugin is detected open the file "test.html" and begin testing.
Introducing the Audio API extension - Archive of obsolete content
the mozaudioavailable event has 2 attributes: framebuffer: framebuffer (i.e., an array) containing decoded audio sample data (i.e., floats) time: timestamp for these samples measured from the start in seconds the framebuffer contains an array of audio samples.
...to do this start writing the data in small portions and wait for the value returned by mozcurrentsampleoffset() to be greater than 0.
... var prebuffersize = samplerate * 0.020; // initial buffer is 20 ms var autolatency = true, started = new date().valueof(); ...
... // auto latency detection if (autolatency) { prebuffersize = math.floor(samplerate * (new date().valueof() - started) / 1000); if (audio.mozcurrentsampleoffset()) { // play position moved?
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
introduction when netscape started the mozilla browser, it made the conscious decision to support w3c standards.
...web pages are considered in strict standards mode when they start with a strict doctype.
... alternatively, you can change the markup and close the opened <a /> before the start of the text -- the anchor will continue to work this way.
...every time you trigger an event, the event starts at the dom's outermost element, the element at the top of the dom tree.
Space Manager Detailed Design - Archive of obsolete content
* * @return pr_true if there are bands and pr_false if there are no bands */ prbool ymost(nscoord& aymost) const; /** * returns a band starting at the specified y-offset.
... * * @return pr_true if there are bands and pr_false if there are no bands */ prbool ymost(nscoord& aymost) const; region management /** * returns a band starting at the specified y-offset.
... first, walk all of the bands until a band that is to the right of the desired offset is located starting at that band, walk the remaining bands: if the current band is to the right of the requested band, then there is available space.
... starting at the head of the list of bandrects, check for intersection with the rect passed in: case #1: the rect is totally above the current band rect, so insert a new band rect before the current bandrect cases #2 and #7: the rect is partially above the band rect, so it is divided into two bandrects, one entirely above the band, and one containing the remainder of the rect.
Tamarin build documentation - Archive of obsolete content
if you have trouble starting the app try this: $ export android_swt=$android_build_top/android-sdk-mac_86/tools/lib/x86_64 where $android_build_top is the full path to your sdk/ndk top folder - get the openssl-0.9.8r.tar (openssl-1.0.0c.tar.gz won't work) openssl files from http://www.openssl.org (use the source link on the left).
...to build tamarin: copy tamarin/platform/win32/armasm.rules to c:/program files/microsoft visual studio 9.0/vc/vcprojectdefaults build "builtin.h" following the instructions below in the section "compiling and running applications" do the same for shell_toplevel.h, starting in avmplus/shell, using the command "python shell_toplevel.py" open the tamarin project file "platform/win32/avmplus2008.sln".
...additional things to try are clicking on the project name then refreshing it (file/refresh or right-click/refresh) and/or quitting and restarting eclipse.
...if you no longer want you sandbox to build and it has not started yet, you can delete the build request from the queue from the request page.
Tamarin Build System Documentation - Archive of obsolete content
when all of the slave machines are free they all start the first build phase simultaneously.
... the next phase is started when all slaves have completed the previous phase successfully.
... the phases run when slaves are available and the other phases do not wait for completion to start the next build.
... the list of smoke tests are located in the tamarin-repository, test/run-smokes.txt, assume the start directory is test format is cd testdir; command to run test above the test should be a # comment describing why the test in the smokes, when test failed, possibly a bugzilla bug the tests can be run by following the above instructions for running buildbot scripts locally and executing the all/run-smoke-tests.sh as a rule any test failure should be immediately added to the top of the smoke test li...
The life of an HTML HTTP request - Archive of obsolete content
(1) the loading of the url is started in nswebshell::doloadurl (called from some loadurl or loaduri variant in the webshell).
... (3) when data is starting to come from the webserver the nsichannel calls the onstartrequest in the documenloader.
...the initial reflow is done by the nshtmlcontentsink::startlayout(), startlayout() calls presshell::initialreflow().
... startlayout is called quite early in the parsing process, for html it's called in nshtmlcontentsink::openbody() (among other places).
[Deprecated] The Mozilla build VM - Archive of obsolete content
thanks to significant improvements in our build environment setup process, it's much simpler and easier to get set up and stay up to date by starting with building firefox instead.
...generally, there should be enough information in the bug to get started.
...we are in the process of migrating these bugs to mentored bugs, but more recent "good first bugs" may be good starting points if there are no appropriate mentored bugs.
... you can also ask your getting-started questions in the introduction chat room on matrix, and any firefox development questions in the developers room.
Venkman Internals - Archive of obsolete content
start with venkman information.
...sourcecontext is the 5 lines of source text before the last instance of the word "function" on the line where this function starts.
...the starting line of the function is scriptwrapper.jsdscript.baselinenumber (one based).
...try starting up venkman and type "/watch-expr client.scriptmanagers", make sure to turn on "include functions".
Building accessible custom components in XUL - Archive of obsolete content
ottom: 1px solid black; border-left: 1px solid black; margin: 0; padding: 3px; } grid.spreadsheet description { color: black; background-color: white; margin: 0px; padding: 2px; border-left: thin solid; border-bottom: thin solid; font-family: monospace; font-size: 12pt; text-align: center; font-weight: bold; } </code> you can see the results by installing stage-1.xpi, restarting firefox, and selecting accjax from the tools menu.
...ed an onblur handler to accept the edited value before the focus changes.) first, the code to trigger edit mode: <code> const key_up = 38; const key_down = 40; const key_left = 37; const key_right = 39; const key_enter = 13; const key_escape = 27; function cell_keypress(e) { var current = e.target; switch (e.keycode) { case key_enter: if (current.tagname == 'label') { start_edit(current); } break; case key_up: spreadsheet_up(current); break; case key_down: spreadsheet_down(current); break; case key_left: spreadsheet_left(current); break; case key_right: spreadsheet_right(current); break; } } </code> second, the code to handle replacing the label with a textbox (to start e...
...<code> const xul_ns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; const x2_ns ="http://www.w3.org/tr/xhtml2" function start_edit(label) { var value = label.value; settimeout(function(){ var textbox = document.createelementns(xul_ns, "textbox"); label.parentnode.replacechild(textbox, label); textbox.value = value; textbox.origvalue = value; textbox.flex = 1; textbox.focus(); textbox.select(); textbox.addeventlistener("blur", editable_cell_blur, true); textbox.addeventlistener("keypress", editable_cell_...
...the start_edit function replaces the label with a textbox, which allows the user to change the cell value.
How to Quit a XUL Application - Archive of obsolete content
script can attempt to quit a xul application, or force the application to quit, using the nsiappstartup interface.
... <script> function quit (aforcequit) { var appstartup = components.classes['@mozilla.org/toolkit/app-startup;1'].
... getservice(components.interfaces.nsiappstartup); // eattemptquit will try to close each xul window, but the xul window can cancel the quit // process if there is unsaved data.
...components.interfaces.nsiappstartup.eforcequit : components.interfaces.nsiappstartup.eattemptquit; appstartup.quit(quitseverity); } </script> calling this function if there is an uncaught exception, to force the application to quit: <script> try { dosomething(); } catch (e) { quit(true); } </script> the "quit" menuitem should typically prompt the user if there is unsaved data: <menuitem label="quit" oncommand="quit(false);"/> ...
Positioning - Archive of obsolete content
single word alignment values example before_start the left side of the popup is aligned with the left side of the anchor, and the bottom of the popup is aligned along the top of the anchor.
...equivalent to topright bottomright after_start the left side of the popup is aligned with the left side of the anchor, and the top of the popup is aligned along the bottom of the anchor.
...equivalent to bottomright topright start_before the top edge of the popup is aligned with the top edge of the anchor, and the right side of the popup is aligned along the left side of the anchor.
... equivalent to topleft topright start_after the bottom side of the popup is aligned with the bottom side of the anchor, and the right side of the popup is aligned along the left side of the anchor.
Additional Template Attributes - Archive of obsolete content
the datasources and ref attributes also differ for each usage, so it is possible to use a shared template to display the same structure multiple times but with different starting nodes in each case.
...the container or starting node variable is specified in the <content> tag inside a query, while the member variable is determined by the value of the uri attribute inside the action body.
... <hbox datasources="template-guide-photos5.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> <template container="?start" member="?photo"> <rule> <image uri="?photo" src="?photo"/> </rule> </template> </hbox> in this example, the ?photo variable can be used instead of 'rdf:*' (although you can use either even if you specify the member variable).
...we could use the container variable ?start in the action body also.
Multiple Queries - Archive of obsolete content
here is an example using an rdf datasource: <hbox id="photoslist" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <queryset> <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="canal"/> </query> <action> <button uri="?photo" image="?photo" label="view" orient="vertical"/> </action> </queryset> <queryset> <query> <content uri="?start"/> <mem...
...ber container="?start" child="?photo"/> </query> <action> <image uri="?photo" src="?photo"/> </action> </queryset> </template> </hbox> this template contains two queries, the first contains a <triple> which matches only the photo with a title of 'canal'.
...here are the results that would be generated by the first query above, before any bindings are applied: (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/canal.jpg, then, the builder adds the three results generated from the second query: (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/canal.jpg) (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/palace...
....jpg) (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/canal.jpg) (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg) so four possible results are available, one from the first query and three from the second.
panel - Archive of obsolete content
ArchiveMozillaXULpanel
<panel id="thepanel"> <hbox align="start"> <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 pan...
... a sliding panel will have the start (or end) position extended such that the panel can be the requested size, meaning the arrow will no longer be at the start (or end) of the panel - i.e., the arrow will appear to have been slid along the panel to ensure the arrow is still pointing at the anchor.
... valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer.
... position possible values for position are: before_start, before_end, after_start, after_end, start_before, start_after, end_before, end_after, overlap, and after_pointer.
tooltip - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
... valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer.
... position possible values for position are: before_start, before_end, after_start, after_end, start_before, start_after, end_before, end_after, overlap, and after_pointer.
Application Update - Archive of obsolete content
getting started you will need the following utility scripts from http://lxr.mozilla.org/mozilla/sourc...ate-packaging/ (or local source of xulrunner) common.sh make_full_update.sh you will need mar / mar.exe to build a complete update patch.
...//pref("app.update.url.override", ""); // interval: time between checks for a new version (in seconds) // default=1 day pref("app.update.interval", 86400); // interval: time before prompting the user to download a new version that // is available (in seconds) default=1 day pref("app.update.nagtimer.download", 86400); // interval: time before prompting the user to restart to install the latest // download (in seconds) default=30 minutes pref("app.update.nagtimer.restart", 1800); // interval: when all registered timers should be checked (in milliseconds) // default=5 seconds pref("app.update.timer", 600000); // whether or not we show a dialog box informing the user that the update was // successfully applied.
... this is off in firefox by default since we show a // upgrade start page instead!
...it will then prompt the user to restart the application.
Extentsions FAQ - Archive of obsolete content
these two links should give you a starting point: http://www..xulplanet.com/tutorials/...u/advmenu.html http://www.xulplanet.com/tutorials/x...dommodify.html request for a thunderbird extension that can automatically detect the default domain when composing e-mails via autodetect.
... not the best answer but a good starting point for the question asker to do some research towards the answer.
...if you turn off the xul cache you don't even need to restart to see changes, simply open a new window.
... can anyone point me to any good tutorials that may help me get started?
Theme changes in Firefox 2 - Archive of obsolete content
changes to the default theme the table below lists all the changes made in the default theme for firefox 2; you can use this information as a starting point for figuring out the changes you need to make.
... global/tab-arrow-start-bkgnd.png new file; the background for the scrolling tab bar arrow at the left side of the tab bar.
... global/tab-arrow-start.png new file; the arrow drawn in the scrolling tab bar box at the left end of the tab bar.
... preferences/preferences.css the following styles are no longer used in firefox 2 and should be removed from your theme: #browserstartuphomepage #browserstartuphomepage #panedownloads description #panegeneral description radio[pane=panedownloads] radio[pane=panedownloads]:active the following styles need to be added to your theme to make it compatible with firefox 2: #panecontent description #panemain description #panesecurity description radio[pane=paneadvanced]:hover radio[pane=paneadvanced][selected="true"] rad...
Using workers in extensions - Archive of obsolete content
); } httprequest = null; } var httprequest = new xmlhttprequest(); httprequest.open("get", fullurl, true); httprequest.onload = inforeceived; httprequest.send(null); } setinterval(function() { refreshinformation(); }, 10*60*1000); onmessage = function(event) { if (event.data) { symbol = event.data.touppercase(); } refreshinformation(); } when the worker thread is started, the main body of this code (in lines 26-35) is executed.
... it starts by setting up an interval handler (in lines 26-28) that calls refreshinformation() every 10 minutes.
... the startup() method this method is called when the extension is first loaded, and needs to be updated to start up and configure the worker.
... let's take a look: startup: function() { // register to receive notifications of preference changes this.prefs = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice) .getbranch("stockwatcher2."); this.prefs.queryinterface(components.interfaces.nsiprefbranch2); this.prefs.addobserver("", this, false); this.tickersymbol = this.prefs.getcharpref("symbol").touppercase(); this.worker = new worker("chrome://stockwatcher2/content/ticker_worker.js"); // small little dance to get 'this' to refer to stockwatcher, not the // worker, when a message is received.
-ms-wrap-flow - Archive of obsolete content
start inline flow content can wrap on the start edge of the exclusion area but must leave empty the area after the end edge of the exclusion area.
... end inline flow content can wrap after the end edge of the exclusion area but must leave empty the area before the start edge of the exclusion area.
... clear inline flow content can only wrap on top and bottom of the exclusion and must leave empty the areas to the start and end edges of the exclusion box.
... formal syntax auto | both | start | end | maximum | clear specifications not part of any specification.
Building Mozilla XForms - Archive of obsolete content
getting started things to know first: the xforms extension has a dependency on the schema-validation extension, so you need to build both (that's done automatically) mozilla switched from cvs to mercurial starting with firefox 3.5.
... before you can start building the xforms extension, you should check your mozilla build environment by doing a regular firefox build.
...starting with firefox 3.5, you need to do two more mercurial checkouts: cd extensions hg clone http://hg.mozilla.org/xforms hg clone http://hg.mozilla.org/schema-validation that's it, you now have everything you need to get started.
...switch to the root of your source directory and start the build with make -f client.mk build after the build finishes, you'll have a xforms.xpi in obj-*/dist/xpi-stage/xforms.xpi.
XForms Custom Controls - Archive of obsolete content
the purpose of this article is to give you enough background information so that you'll be able to get a good start.
...work has just started in the w3c xforms working group to investigate the custom control issue, so eventually (hopefully?) there will be an "official" and common way to customize your form's user interface across all xforms processors.
...if you would like to do this kind of heroic work then please contact the mozilla xforms developers before you start.
...to get started, you really only need to know the language where you'd like to use xforms (like xhtml or xul), some xbl and javascript, and the xpcom interfaces we are exposing for your use.
XForms Range Element - Archive of obsolete content
single-node binding special incremental - supported, default value is false start - lower bound of possible values end - upper bound of possible values step - is used for incrementing/decrementing values start/end/step attributes if the value of the bound instance node is outside the range of values specified by the start and end attributes, then the range element receives a xforms-out-of-range event.
...start specifies the lower bound of possible values, i.e.
...if this attribute is omitted, then it is assumed to be the value of start + 20.
...if this attribute is omitted, then it is assumed to be the value of end - start / 20.
RDF in Mozilla FAQ - Archive of obsolete content
general where do i start?
...start at http://www.dmoz.org/ for more information on the open directory.
...the table is keyed by the datasource's "uri", which is either the url of an rdf/xml file, or a "special" uri starting with rdf: that refers to a built-in datasource.
...let's start with the following xul.
Windows Media in Netscape - Archive of obsolete content
this is the example: needs to be embedded in wiki page (can it just be put here?) <object id="playerex2" classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" height="200" width="200"> <param name="uimode" value="full"> <param name="autostart" value="true"> <param name="url" value="media/preludesteel.wma"> your browser does not support the activex windows media player </object> the same markup (used above and shown below) will work in both ie and netscape 7.1.
... <object id="playerex2" classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" height="200" width="200"> <param name="uimode" value="full" /> <param name="autostart" value="true" /> <param name="url" value="preludesteel.wma" /> your browser does not support the activex windows media player </object> the classid attribute references the clsid of windows media player 7 and above -- windows media player versions before 7 used a different clsid.
... <object id="playerex2" classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6" height="200" width="200"> <param name="uimode" value="full" /> <param name="autostart" value="true" /> <param name="url" value="preludesteel.wma" /> </object> <script type="text/javascript"> if(!document.playerex2.versioninfo) { // control not installed -- the versioninfo property returns null // redirect users to http://www.microsoft.com/windows/windowsmedia/download/default.asp } else { //control was correctly created //proceed with scripting calls, etc.
...here, for example, is a code snippet that works equally well on both netscape 7.1 and ie: <object id="player" height="0" width="0" classid="clsid:6bf52a52-394a-11d3-b153-00c04f79faa6"> <param name="autostart" value="true"> </object> <input type="button" name="playmedia" value="play" onclick="startmediaup()"> <input type="button" name="stopmedia" value="stop" onclick="shutmediadown()"> <p>this example shows a minimally-functional player <script> <!-- function startmediaup () { document.player.url = "preludesteel.wma"; document.player.controls.play(); } function shutmediadown () { document.pl...
Desktop mouse and keyboard controls - Game development
the start button can be clicked to do so, but we can use the enter key to do the same: var keyenter = this.game.input.keyboard.addkey(phaser.keycode.enter); var keyenter.ondown.add(this.clickstart, this); you can use addkey() to add any key the phaser.keycode object has to offer.
... the ondown() function is executed whenever the enter key is pressed — it will launch the clickstart() method, which starts a new game.
... to skip the how to play screen, we can listen for any key being pressed and move on: this.input.keyboard.ondowncallback = function() { if(this.statestatus == 'intro') { this.hideintro(); } }; this hides the intro and starts the actual game, without us having to set up another new key control just for this.
... pause and game over screens to make the game fully playable with keyboard it should be possible to go back to the main menu, continue playing, or restart the game from the pause and game over screens.
Unconventional controls - Game development
you can also check this handy cheat sheet seen below if you're working with panasonic tvs running firefox os: you can add moving between states, starting a new game, controlling the ship and blowing stuff up, pausing and restarting the game.
... there's good hello world and getting started javascript tutorials available on the leap motion documentation pages, which will get you through the basics.
... check out the banana piano video, and be sure to visit the quick start guide for all the needed info.
...connecting the boards and using them may look like this: var cylon = require('cylon'); cylon.robot({ connections: { arduino: { adaptor: 'firmata', port: '/dev/ttyacm0' } }, devices: { makey: { driver: 'makey-button', pin: 2 } }, work: function(my) { my.makey.on('push', function() { console.log("button pushed!"); }); } }).start(); as the description says: this gpio driver allows you to connect a 10 mohm resistor to a digital pin on your arduino or raspberry pi to control your robots with bananas, clay, or drawable circuitry.
Efficient animation for web games - Game development
to take a concrete example, if you start a css transition to move something from off-screen so that it is fully visible on-screen, the browser knows that the related content will end up completely visible to the user and can then pre-render that content.
...you may have a callback that ends up looking something like this: var starttime = -1; var animationlength = 2000; // animation length in milliseconds function doanimation(timestamp) { // calculate animation progress var progress = 0; if (starttime < 0) { starttime = timestamp; } else { progress = timestamp - starttime; } // do animation ...
... if (progress < animationlength) { requestanimationframe(doanimation); } } // start animation requestanimationframe(doanimation); you will note that we set starttime to -1 at the beginning, when we could just as easily have set the time using the date() object and avoided the extra code in the animation callback.
... we do this so that any setup or processes that happen between the start of the animation and the callback being processed do not affect the start of the animation, and so that all the animations we start before the frame is processed are synchronised.
Test your skills: CSS and JavaScript accessibility - Learn web development
try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
HTML: A good basis for accessibility - Learn web development
semantic html doesn't take any longer to write than non-semantic (bad) markup if you do it consistently from the start of your project.
... note: in addition to having good semantics and an attractive layout, your content should make logical sense in its source order — you can always place it where you want using css later on, but you should get the source order right to start with, so what screen reader users get read out to them will make sense.
...open this in a new tab, and try pressing the tab key; after a few presses, you should see the tab focus start to move through the different focusable elements.
... you can then press enter/return to follow a focused link or press a button (we've included some javascript to make the buttons alert a message), or start typing to enter text in a text input.
HTML: A good basis for accessibility - Learn web development
semantic html doesn't take any longer to write than non-semantic (bad) markup if you do it consistently from the start of your project.
... note: in addition to having good semantics and an attractive layout, your content should make logical sense in its source order — you can always place it where you want using css later on, but you should get the source order right to start with, so what screen reader users get read out to them will make sense.
...open this in a new tab, and try pressing the tab key; after a few presses, you should see the tab focus start to move through the different focusable elements.
... you can then press enter/return to follow a focused link or press a button (we've included some javascript to make the buttons alert a message), or start typing to enter text in a text input.
WAI-ARIA basics - Learn web development
let's start by looking at what wai-aria is, and what it can do for us.
... a whole new set of problems as web apps started to get more complex and dynamic, a new set of accessibility features and problems started to appear.
... as another example, apps started to feature complex controls like date pickers for choosing dates, sliders for choosing values, etc.
...once that is done, we start up a setinterval() loop that loads a new random quote into the quote box every 10 seconds: let intervalid = window.setinterval(showquote, 10000); this works ok, but it is not good for accessibility — the content update is not detected by screenreaders, so their users would not know what is going on.
Test your skills: The Box Model - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the example as displayed in the image: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Test your skills: sizing - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the example as displayed in the image: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the example as displayed in the image: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Test your skills: values and units - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the example as displayed in the image: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the example as displayed in the image: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Test your skills: Writing Modes and Logical Properties - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the example as displayed in the image: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Test your skills: floats - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Test your skills: Multicol - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
What do common web layouts contain? - Learn web development
you start out with a blank page, and you can take it so many directions.
... and if you don't have much experience, starting out with a blank page might be a bit scary.
...(even many desktop-users prefer viewing things in small windows rather than full-screen.) the real fun begins when you start mixing them all together: … these are just examples and you're quite free to lay things out as you want.
...remember that word "float"--it will ring a bell when you start learning about css.
Styling web forms - Learn web development
if you want to follow along with this example, make a local copy of our postcard-start.html file, and follow the below instructions.
...before we start coding, we need three additional assets: the postcard background — download this image and save it in the same directory as your working html file.
... your fonts need some more processing before you start: go to the fontsquirrel webfont generator.
...using this we can easily position our elements, including the title and all the form elements: h1 { font : 1em "typewriter", monospace; align-self : end; } #message { grid-row: 1 / 5; } #from, #reply { display: flex; } labels and controls now we can start working on the form elements themselves.
Test your skills: Advanced styling - Learn web development
try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Test your skills: Form validation - Learn web development
download the starting point for this task to work in your own editor or in an online editor.
... download the starting point for this task to work in your own editor or in an online editor.
... download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
CSS basics - Learn web development
previous overview: getting started with the web next css (cascading style sheets) is the code that styles web content.
... css basics walks through what you need to get started.
...(the term ruleset is often referred to as just rule.) note the names of the individual parts: selector this is the html element name at the start of the ruleset.
... previous overview: getting started with the web next in this module installing basic software what will your website look like?
Installing basic software - Learn web development
overview: getting started with the web next in installing basic software, we show you what tools you need to do simple web development and how to install them properly.
... that looks like a scary list, but fortunately, you can get started in web development without knowing anything about most of these.
...we recommend starting with visual studio code, which is a free editor, that offers live previews and code hints.
... overview: getting started with the web next in this module installing basic software what will your website look like?
Marking up a letter - Learn web development
prerequisites: before attempting this assessment you should have already worked through getting started with html, what's in the head?
... starting point to begin, get the raw text you need to mark up, and the the css to style the html.
... use an appropriate list type to mark up the semester start dates, study subjects, and exotic dances.
... previous overview: introduction to html next in this module getting started with html what’s in the head?
Test your skills: HTML text basics - Learn web development
try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Test your skills: Links - Learn web development
try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Test your skills: HTML images - Learn web development
try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Images in HTML - Learn web development
there are other types of multimedia to consider, but it is logical to start with the humble <img> element, used to embed a simple image in a webpage.
... prerequisites: basic computer literacy, basic software installed, basic knowledge of working with files, familiarity with html fundamentals (as covered in getting started with html.) objective: to learn how to embed simple images in html, annotate them with captions, and how html images relate to css background images.
...istener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the use...
...istener('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { var scrollpos = textarea.scrolltop; var caretpos = textarea.selectionstart; var front = (textarea.value).substring(0, caretpos); var back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the use...
Test your skills: Multimedia and embedding - Learn web development
try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Structuring the web with HTML - Learn web development
get started prerequisites before starting this topic, you should have at least basic familiarity with using computers and using the web passively (i.e.
...you should have a basic work environment set up as detailed in installing basic software, and understand how to create and manage files, as detailed in dealing with files — both are parts of our getting started with the web complete beginner's module.
... it is recommended that you work through getting started with the web before attempting this topic, however, it isn't absolutely necessary; much of what is covered in the html basics article is also covered in our introduction to html module, albeit in a lot more detail.
...you should definitely start with the first one.
Introduction to web APIs - Learn web development
overview: client-side web apis next first up, we'll start by looking at apis from a high level — what are they, how do they work, how to use them in your code, and how are they structured?
... we start by creating an audiocontext instance inside which to manipulate our track: const audiocontext = window.audiocontext || window.webkitaudiocontext; const audioctx = new audiocontext(); next, we create constants that store references to our <audio>, <button>, and <input> elements, and use the audiocontext.createmediaelementsource() method to create a mediaelementaudiosourcenode representing the so...
... changed: const gainnode = audioctx.creategain(); volumeslider.addeventlistener('input', function() { gainnode.gain.value = this.value; }); the final thing to do to get this to work is to connect the different nodes in the audio graph up, which is done using the audionode.connect() method available on every node type: audiosource.connect(gainnode).connect(audioctx.destination); the audio starts in the source, which is then connected to the gain node so the audio's volume can be adjusted.
...you are probably excited to start actually doing some fun things with specific apis, so let's go!
Handling text — strings in JavaScript - Learn web development
strings — the basics strings are dealt with similarly to numbers at first glance, but when you dig deeper you'll start to see some notable differences.
... let's start by entering some basic lines into the browser developer console to familiarize ourselves.
... creating a string to start with, enter the following lines: let string = 'the revolution will not be televised.'; string; just like we did with numbers, we are declaring a variable, initializing it with a string value, and then returning the value.
...if the browser can see where a string starts, but can't find the end of the string, as indicated by the 2nd quote, it complains with an error (with "unterminated string literal").
Test your skills: variables - Learn web development
try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
What is JavaScript? - Learn web development
here we'll actually start looking at some code, and while doing so, explore what actually happens when you run some javascript in your page.
...this is a good security measure — if this were not the case, then pirates could start writing code to steal information from other websites, and other such bad things.
...did you save your local copy of the starting code as a .html file?
...we've begun with just theory, to start getting you used to why you'd use javascript and what kind of things you can do with it.
Inheritance in JavaScript - Learn web development
getting started first of all, make yourself a local copy of our oojs-class-inheritance-start.html file (see it running live also).
...the class starts the same as it was the last time we looked at it.
...if you find yourself starting to create a number of objects that have similar features, then creating a generic object type to contain all the shared functionality and inheriting those features in more specialized object types can be convenient and useful.
...it is possible to start writing code that temporarily modifies the prototypes of built-in browser objects, but you should not do this unless you have a really good reason.
Working with JSON - Learn web development
you'd just have to access array items (in its parsed version) by starting with an array index, for example [0]["powers"][0].
... getting started to begin with, make local copies of our heroes.html and style.css files.
... to start with, we store the url of the json we want to retrieve in a variable.
...= 0; j < superpowers.length; j++) { const listitem = document.createelement('li'); listitem.textcontent = superpowers[j]; mylist.appendchild(listitem); } myarticle.appendchild(myh2); myarticle.appendchild(mypara1); myarticle.appendchild(mypara2); myarticle.appendchild(mypara3); myarticle.appendchild(mylist); section.appendchild(myarticle); } } to start with, we store the members property of the javascript object in a new variable.
Test your skills: Object basics - Learn web development
try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Introducing JavaScript objects - Learn web development
get started prerequisites before starting this module, you should have some familiarity with html and css.
... you are advised to work through the introduction to html and introduction to css modules before starting on javascript.
... object building practice in previous articles we looked at all the essential javascript object theory and syntax details, giving you a solid base to start from.
... assessments adding features to our bouncing balls demo in this assessment, you are expected to use the bouncing balls demo from the previous article as a starting point, and add some new and interesting features to it.
Routing in Ember - Learn web development
creating the routes let's start by creating three new routes: "index", "active" and "completed".
...start by updating todomvc/app/routes/active.js so it looks as follows: import route from '@ember/routing/route'; import { inject as service } from '@ember/service'; export default class activeroute extends route { @service('todo-data') todos; model() { let todos = this.todos; return { get activetodos() { return todos.incomplete; } } } } we can now update the t...
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer...
... functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
React resources - Learn web development
the official react docs are a great place to start learning about them.
...because reach router is better for accessibility, it's a good place to start.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, ...
...conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Creating our first Vue component - Learn web development
previous overview: client-side javascript frameworks next now it's time to dive deeper into vue, and create our own custom component — we'll start by creating a component to represent each item in the todo list.
...let's start by adding the label prop to the component template.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer...
... functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Deploying our app - Learn web development
there’s many great tutorials and books available, and our git and github page is a good place to start.
...we've not encountered branches at all, but the (terribly named) "master" branch is the default place for our work and it's what git starts on.
... let's get this done: go to https://app.netlify.com/start.
... let’s get started.
Client-side tooling overview - Learn web development
in these articles, we won’t answer every question about web tooling, but we will provide you with a useful starting point of understanding the fundamentals, which you can then build from.
... as with any complex topic, it is good to start small, and gradually work your way up to more advanced uses.
... instead, you might want to find some dedicated tutorials on getting started with particular types of tools.
... great starting places is to search web sites like css tricks, dev, freecodecamp, and smashing magazine, as they’re tailored to the web development industry.
Adding a new CSS property
getting started first, you'll want to add an appropriate test entry to property_database.js.
... parsing to start implementing the parsing, first read the syntax line in the property's specification (whose syntax is in turn defined in the css values and units specification) and any prose in the specification that adds additional restrictions to that syntax.
... (none of this applies to shorthand properties.) start by reading and understanding the "computed value:" line in the specification's definition of the property, and any associated prose.
... also, it's very important not to touch the computed style data at all when there's no specified data provided (ecssunit_null); touching the computed style data in this case would break partial computation based on a start struct, which is when we computed style data on the basis of computed data we've already computed from a subset of the style rules that we're currently computing from.
A bird's-eye view of the Mozilla framework
object model at a glance mozilla dynamically loads and integrates core modules and xul packages into the runtime environment on startup.
...the ability to dynamically integrate modules and packages at startup is a powerful benefit of the object model, which defines a module as a set of one or more xpcom objects calledcomponents.
... at startup, the core application component identifies and loads all of the different xpcom components comprising the core application services and builds a central registry it uses to generate instances of xpcom components and instances of interface implementation classes on demand.
... xpcom in summary to summarize, the xpcom object model specifies the structure of xpcom components, builds a central registry based on the xpcom components loaded at startup, generates xpcom component instances on demand using the registry, which specifies the supported interfaces, their corresponding implementation 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.
Creating a spell check dictionary add-on
this page describes how to package a hunspell spell check dictionary as a firefox add-on, or how to update your existing add-on, so that it can be installed, uninstalled and updated without a restart.
...type = 64 indicates that the add-on is in the restartless format, and unpack is required for hunspell to read the dictionary.
... although the restartless format for dictionary add-ons were introduced in gecko 10, dictionary updates only works starting from gecko 18.
...if you set em:minversion to a lower value, gecko 10-17 will not be able to update your dictionary add-on once the restartless dictionary is installed (bug 782118), and gecko 10-16 may warn the user that your dictionary is not compatible, when users try to update to a newer version of firefox/thunderbird (bug 782115).
Eclipse CDT Manual Setup
(if an "indexing" item starts after the "refreshing the workspace" item has finished, click the little red box beside that item to cancel it, since we want to configure the project before the indexer runs.) initial project properties so that the indexer will run faster and give better results, and so that eclipse doesn't give results for irrelevant files, you should add some resource filters to have eclipse ignore certain ...
...doing this prevents the "searching for binaries" which eclipse constantly starts from taking too long.
... building the index once you see the end of the build output in the console tab and the build item has disappeared from the progress tab, you can start indexing the source.
... if indexing started automatically (see the progress tab), cancel it, since there seems to be a bug that makes it give bad results when it starts automatically at this stage.
MozBeforePaint
usage outline in order to time your animation, the first thing you need to know is the time base; that is, the time at which your animation sequence started.
... you can determine this value by looking at window.mozanimationstarttime.
... this new property indicates the time, in milliseconds since epoch, at which all animations started in the specified window during the current refresh interval should be considered to have started running.
... <!doctype html> <html> <body> <div id="d" style="width:100px; height:100px; background:lime; position:relative;"></div> <script> var d = document.getelementbyid("d"); var start = window.mozanimationstarttime; function step(event) { var progress = event.timestamp - start; d.style.left = math.min(progress/10, 200) + "px"; if (progress < 2000) { window.mozrequestanimationframe(); } else { window.removeeventlistener("mozbeforepaint", step, false); } } window.addeventlistener("mozbeforepaint", step, false); window.mozrequestanimationframe(); </script> </bod...
How to implement a custom autocomplete search component
the xul textbox element supports an autocomplete mechanism that is used to create a textbox with a popup containing a list of possible completions for what the user has started to type.
...ntractid : contract_id, /** * searches for a given string and notifies a listener (either synchronously * or asynchronously) of the result * * @param searchstring the string to search for * @param searchparam an extra parameter * @param previousresult a previous result to use for faster searchinig * @param listener the listener to notify when the search is complete */ startsearch: function(searchstring, searchparam, previousresult, listener) { var results = ['mary', 'john']; var autocomplete_result = new providerautocompleteresult(searchstring, ci.nsiautocompleteresult.result_success, 0, "", results, null); listener.onsearchresult(this, autocomplete_result); }, /** * stops an asynchronous search that is in progress */ stopsearch: fu...
...etesearch.prototype = { /* * search for a given string and notify a listener (either synchronously * or asynchronously) of the result * * @param searchstring - the string to search for * @param searchparam - an extra parameter * @param previousresult - a previous result to use for faster searchinig * @param listener - a listener to notify when the search is complete */ startsearch: function(searchstring, searchparam, result, listener) { // this autocomplete source assumes the developer attached a json string // to the the "autocompletesearchparam" attribute or "searchparam" property // of the <textbox> element.
...ls(components.interfaces.nsifactory)) throw components.results.ns_error_not_implemented; if (acid.equals(class_id)) return simpleautocompletesearchfactory; throw components.results.ns_error_no_interface; }, canunload: function(acompmgr) { return true; } }; // module initialization function nsgetmodule(acompmgr, afilespec) { return simpleautocompletesearchmodule; } starting in gecko 2.0, component registration has been changed, so you need to make the following changes: add an nsgetfactory() function: function nsgetfactory(cid) { if (cid.tostring().touppercase() != class_id.tostring().touppercase()) { throw components.results.ns_error_factory_not_registered; } return simpleautocompletesearchfactory; } you need to explicit...
Interfacing with the Add-on Repository
to make the service work for the time being, you can use code like this when your extension starts up: var prefsservice = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice); var prefbranch = prefsservice.getbranch("extensions."); var recurl = ""; try { recurl = prefbranch.getcharpref("getaddons.recommended.url"); } catch(e) { recurl = ""; } if (recurl == "") { prefbranch.setcharpref("getaddons.recommende...
... starting a request to start a search of the repository, you can use either of the following methods: searchaddons() queries the add-on repository for add-ons matching given search criteria.
... when the user clicks a toolbar button to initiate the query, the following code gets run to start the request: addonrepository.retrieverecommendedaddons(10, this); this asks the repository to fetch up to 10 add-ons, using the object this as the target for callbacks.
...nchor id */ { label: button, accesskey: "i", callback: function() { if (popupnotifications.install) { popupnotifications.install.install(); } else { 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.
SVN for Localizers
first things first, we need to give you a brief introduction to what svn is and where you can find the necessary tools to get started.
... working with svn now that you understand the mozilla svn repository layout (in particular the layout for mozilla.com), let's get some files into your hands to start localizing!
...it's very important for you to update your working copy with the newest files from mozilla svn repository before you start making changes.
... sometimes mistakes happen and you need to start over.
Mozilla projects on GitHub
this article offers a quick guide for getting started with mozilla code on github.
... getting started you can look at code on github without an account.
...to do more—to contribute to the code, or to fork it and start your own project based on mozilla-related code—you need a github account.
...this is a great place to start looking for any projects not listed below.
Performance
measuring add-on startup performance a guide for add-on developers on how to set up a performance testing environment.
... about:memory about:memory is the easiest-to-use tool for measuring memory usage in mozilla code, and is the best place to start.
... profiling with the firefox profiler the firefox profiler is a good tool to start with, particularly for understanding where time is spent within c++ code in firefox.
...it should be the starting point for anybody new to power profiling.
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.
...changes require an application restart.browser.download.lastdir.savepersitebrowser.download.lastdir.savepersite controls whether the directory preselected in the file picker for saving a file download is being remembered on a per-website (host) base.
... javascript.options.showinconsolethe preference javascript.options.showinconsole controls whether errors or warnings in chrome code are shown in the error console.javascript.options.stricttechnical review completed.mail.tabs.drawintitlebarstarting in thunderbird 17.0, the tabs are drawn in the title bar.
...the xul cache is serialized and saved between mozilla sessions in the xul fastload file, which saves a “compiled” version of the xul and javascript in a document to disk for faster startup the next time the application runs.reader.parse-on-load.force-enabledthe preference reader.parse-on-load.force-enabled controls if the reader mode used in firefox mobile should be enabled independent of the memory available in the device.
NSS 3.15.4 release notes
bug 919877 - (cve-2013-1740) when false start is enabled, libssl will sometimes return unencrypted, unauthenticated data from pr_recv new in nss 3.15.4 new functionality implemented ocsp querying using the http get method, which is the new default, and will fall back to the http post method.
... new functions cert_forcepostmethodforocsp cert_getsubjectnamedigest cert_getsubjectpublickeydigest ssl_peercertificatechain ssl_recommendedcanfalsestart ssl_setcanfalsestartcallback new types cert_rev_m_force_post_method_for_ocsp: when this flag is used, libpkix will never attempt to use the http get method for ocsp requests; it will always use post.
... improved ssl/tls false start.
... in addition to enabling the ssl_enable_false_start option, an application must now register a callback using the ssl_setcanfalsestartcallback function.
NSS sources building testing
in order to get started, anonymous read-only access is sufficient.
...in past versions, all files were located in a directory hierarchy that started with the "mozilla" prefix.
...the nss tests will start tcp/ip server tools on your computer, and in order for that to work, the nss test suite needs to know which hostname can be used by client tools to connect to the server tools.
... after you have set the required environment variables, use "cd nss/tests" and start the tests using "./all.sh".
Necko walkthrough
has onstartrequest, onstoprequest, ondataavailable, the three functions in which channel responses are received asynchronously.
... receive response get a callback to each of these: nsistreamlistener::onstartrequest (header info) nsistreamlistener::ondataavailable (data in single or multiple chunks) nsistreamlistener::onstoprequest (no more data from http) this all happens on the main thread, in a non-blocking fashion: make your request on the main thread, then carry on and get the async response later, also on the main thread.
...back on the main thread: nsinputstreampump::oninputstreamready this function in turn calls nsinputstreampump::onstatestart, nsinputstreampump::onstatetransfer and nsinputstreampump::onstatestop.
... these functions call nsistreamlistener::onstartrequest, nsistreamlistener::ondataavailable and nsistreamlistener::onstoprequest respectively.
GCIntegration - SpiderMonkey Redirect 1
the fundamental invariant that this barrier guarantees is that any object reachable when the incremental gc started will be marked.
... a simple way to visualize the invariant is that, when an incremental gc starts, an "initial snapshot" of the heap is taken.
...these objects, as well as any that were allocated since the gc started, are guaranteed to be marked.
...assume that an incremental gc has already started, and a and b have been marked.
Garbage collection
the chunkinfo contains a list of unallocated arenas, starting at chunkinfo::freearenashead and linked through arenaheader::next.
... every arena maintains a list of free spans, starting at arenaheader::firstfreespanoffets.
...if so, the engine must immediately restart a full, non-incremental gc in order to reclaim some memory and continue execution.
...in other words, it is an updatable pointer to a gc thing (it is essentially a cell** that the gc knows about.) root a starting point to the gc graph traversal, a root is known to be alive for some external reason (one other than being reachable by some other part of the gc heap.) weak pointer in common cs terminology, a weak pointer is one that doesn't keep the pointed-to value live for gc purposes.
Introduction to the JavaScript shell
note: starting with spidermonkey 44 (firefox 44 / thunderbird 44 / seamonkey 2.41), the standard, web-compatible javascript version is used by default (and not js1.7+ anymore).
... countheap([start[, kind]]) added in spidermonkey 1.8 count the number of live gc things in the heap, or things reachable from start when it is given and is not null.
... dumpheap([filename[, start[, tofind[, maxdepth[, toignore]]]]]) added in spidermonkey 1.8 dump the graph of all existing objects (or a specific interesting subgraph) to a file.
...----------------------- 15: print("you entered " + n1 + " and " + n2 + "\n"); 00044: 15 name "print" 00047: 15 pushobj 00048: 15 string "you entered " 00051: 15 getvar 0 00054: 15 add 00055: 15 string " and " 00058: 15 add 00059: 15 getvar 1 00062: 15 add 00063: 15 string "\\n" 00066: 15 add 00067: 15 call 1 00070: 15 pop 00071: 15 stop dumpheap(([filename[, start[, tofind[, maxdepth[, toignore]]]]]) dump gc information.
JIT Optimization Strategies
inline caches start off as a jump to a separate piece of code called a "fallback".
... inline caches start off as a jump to a separate piece of code called a "fallback".
... inline caches start off as a jump to a separate piece of code called a "fallback".
... inline caches start off as a jump to a separate piece of code called a "fallback".
JSNewResolveOp
setting jsclass_new_resolve and jsclass_new_resolve_gets_start further extends this hook by passing in the starting object on the prototype chain via *objp.
...when using jsclass_new_resolve_gets_start, the resolve hook must therefore null *objp to signify "not resolved".
... with only jsclass_new_resolve and no jsclass_new_resolve_gets_start, the hook can assume *objp is null on entry.
... this is not good practice, but enough existing hook implementations count on it that we can't break compatibility by passing the starting object in *objp without a new jsclass flag.
JS_DumpHeap
syntax bool js_dumpheap(jsruntime *rt, file *fp, void* startthing, jsgctracekind kind, void *thingtofind, size_t maxdepth, void *thingtoignore); name type description cx jscontext * pointer to a js context.
... startthing void * null or a pointer to a gc thing (use js::value::togcthing() to obtain a pointer to pass here).
... startkind jsgctracekind trace kind of startthing, if startthing is not null.
... must be jstrace_object when startthing is null.
Parser API
example: > var expr = reflect.parse("obj.foo + 42").body[0].expression > expr.left.property ({loc:null, type:"identifier", name:"foo"}) > expr.right ({loc:{source:null, start:{line:1, column:10}, end:{line:1, column:12}}, type:"literal", value:42}) it is also available since firefox 7; it can be imported into the global object via: components.utils.import("resource://gre/modules/reflect.jsm") or into a specified object via: components.utils.import("resource://gre/modules/reflect.jsm", obj) built-in objects whether in spidermonkey shell or firefox (after impor...
...if the parser produced no information about the node's source location, the field is null; otherwise it is an object consisting of a start position (the position of the first character of the parsed source region) and an end position (the position of the first character after the parsed source region): interface sourcelocation { source: string | null; start: position; end: position; } each position object consists of a line number (1-indexed) and a column number (0-indexed): interface position { line: uint32 >= 1...
... interface xmlstarttag <: xml { type: "xmlstarttag"; contents: [ xml ]; } an xml start tag.
... xmlstarttag(contents[, loc]) contents: [ customxml ] loc: sourcelocation returns: customxml callback to produce a custom xml start-tag node.
Setting up CDT to work on SpiderMonkey
start eclipse and create a workspace somewhere.
... at this point, the indexer starts running and already produces a pretty decent index of much of spidermonkey.
... start the build by selecting "build all" from the "project" menu.
... start the indexer by either: selecting "index > rebuild" from the project's context menu located in the project explorer window, or selecting "c/c++ index > rebuild" from the "project" menu.
Web Replay
getting started to enable web replay (macos and firefox nightly only), go to devtools settings and select "enable webreplay".
... there are a few ways to start recording a tab: record current tab open the developer tools and click the button indicated below.
... this will refresh the tab and start recording.
... clicking the 'tools -> web developer -> web replay -> load recording in new tab' menu item will start a new tab which replays the recording to the end.
Redis Tips
getting started with redis before you go any further in this document, make sure you have played with redis for at least 5 or 10 minutes.
... optimistic locking your transactions are atomic once they start, but of course you can't guarantee that you'll get there first.
... use commands like blpop rpush blpoprpush the commands that start with b are blocking.
... but before you start cramming huge messes of stringified json in your db, check in with your gut and ask yourself: does the structure of the json matter for my queries?
History Service Design
places core history service (nsinavhistoryservice.idl) is the core of places, every other places service depends on it to correctly work, so it gets always initialized at application startup.
... database maintenance at startup the service creates an exclusive storage connection to places.sqlite, the exclusive locking is needed for both a perf gain and data-safety.
...in both cases an implementer can know what did happen at startup and act accordingly (maybe restoring a backup).
... performance to ensure performance a bunch of statements, commonly used when adding or reading visit informations, are created at startup.
extIApplication
method overview boolean quit() boolean restart() void getextensions(extiextensionscallback acallback) attributes the following interfaces are available to all applications: attribute type description id readonly attribute astring the id of the application.
... restart() attempts to restart the application.
... it is possible for the restart to be canceled.
... boolean restart() return value boolean value indicating whether the restart was successful.
Accessing the Windows Registry Using XPCOM
this example reads all the startup programs in one key of the registry.
...onents.classes["@mozilla.org/windows-registry-key;1"] .createinstance(components.interfaces.nsiwindowsregkey); wrk.open(wrk.root_key_current_user, "software\\mdc\\test", wrk.access_all); removechildrenrecursive(wrk); wrk.close(); monitoring registry keys if you would like to know whether a registry key has changed since you last checked it, you can use the startwatching(), stopwatching(), and haschanged() methods.
... you must call startwatching() for the key to be monitored.
...(value in cache) { return cache[value]; } cache[value] = readregistryvaluenocache(wrk, value); return cache[value]; } var wrk = components.classes["@mozilla.org/windows-registry-key;1"] .createinstance(components.interfaces.nsiwindowsregkey); wrk.open(wrk.root_key_local_machine, "software\\microsoft\\windows\\currentversion", wrk.access_read); wrk.startwatching(false); // only watch the values on this key, not child keys var id = readregistryvalue(wrk, "productid"); /* later you can read this again, and it should come from the cache unless there have been changes to the registry.
XPCOM Stream Guide
MozillaTechXPCOMGuideStreams
from the nsirequestobserver interface, the .onstartrequest(request, context) method tells you when the request begins, while the .onstoprequest(request, context) method tells you when the request ends.
... a request will have one .onstartrequest(request, context) call, followed by at least one .ondataavailable(...) call, followed by one .onstoprequest(request, context) call.
... the context argument will be something passed from whoever invokes the request to the .onstartrequest(), .ondataavailable(), and .onstoprequest() methods of the listener.
... as for passing in the stream listener and starting the request: that will vary depending on the use case.
nsACString_internal
rnal& operator=(const nsacstring_internal&) - source parameters nsacstring_internal& str nsacstring_internal& operator=(const nscsubstringtuple&) - source parameters nscsubstringtuple& tuple adopt void adopt(char*, pruint32) - source parameters char* data pruint32 length replace void replace(pruint32, pruint32, char) - source buffer manipulation parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint32, const nsacstring_internal&) - source parameters pruint32 cutstart pruint32 cutlength nsacstring_internal& str void replace(pruint32, pruint32, const nscsubstringtuple&) - source param...
...eters pruint32 cutstart pruint32 cutlength nscsubstringtuple& tuple replaceascii void replaceascii(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length append void append(char) - source parameters char c void append(const char*, pruint32) - source parameters char* data pruint32 length void append(const nsacstring_internal&) - source parameters nsacstring_internal& str void append(const nscsubstringtuple&) - source parameters nscsubstringtuple& tuple appendascii void appendascii(const char*, pruint32) - source parameters char* data pruint32 length appendliteral(const char void appendliteral(const char (&)[n]) - source appendliteral(char void appendliteral(char ...
...rt(const char*, pruint32, pruint32) - source parameters char* data pruint32 pos pruint32 length void insert(const nsacstring_internal&, pruint32) - source parameters nsacstring_internal& str pruint32 pos void insert(const nscsubstringtuple&, pruint32) - source parameters nscsubstringtuple& tuple pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength setcapacity void setcapacity(pruint32) - source buffer sizing parameters pruint32 newcapacity setlength void setlength(pruint32) - source parameters pruint32 newlength truncate void truncate(pruint32) - source parameters pruint32 newlength getdata pruint32 getdata(const char**) const - source get a const pointer to the string's internal bu...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters char achar print32 aoffset ...
nsAString_internal
ator=(const nsastring_internal&) - source parameters nsastring_internal& str nsastring_internal& operator=(const nssubstringtuple&) - source parameters nssubstringtuple& tuple adopt void adopt(prunichar*, pruint32) - source parameters prunichar* data pruint32 length replace void replace(pruint32, pruint32, prunichar) - source buffer manipulation parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length void replace(pruint32, pruint32, const nsastring_internal&) - source parameters pruint32 cutstart pruint32 cutlength nsastring_internal& str void replace(pruint32, pruint32, const nssubstringtuple&) - so...
...urce parameters pruint32 cutstart pruint32 cutlength nssubstringtuple& tuple replaceascii void replaceascii(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length append void append(prunichar) - source parameters prunichar c void append(const prunichar*, pruint32) - source parameters prunichar* data pruint32 length void append(const nsastring_internal&) - source parameters nsastring_internal& str void append(const nssubstringtuple&) - source parameters nssubstringtuple& tuple appendascii void appendascii(const char*, pruint32) - source parameters char* data pruint32 length appendliteral(const char void appendliteral(const char (&)[n]) - source appendliteral(char...
...st prunichar*, pruint32, pruint32) - source parameters prunichar* data pruint32 pos pruint32 length void insert(const nsastring_internal&, pruint32) - source parameters nsastring_internal& str pruint32 pos void insert(const nssubstringtuple&, pruint32) - source parameters nssubstringtuple& tuple pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength setcapacity void setcapacity(pruint32) - source buffer sizing parameters pruint32 newcapacity setlength void setlength(pruint32) - source parameters pruint32 newlength truncate void truncate(pruint32) - source parameters pruint32 newlength getdata pruint32 getdata(const prunichar**) const - source get a const pointer to the string's intern...
... @param achar -- char to be stripped @param aoffset -- where in this string to start stripping chars parameters prunichar achar print32 aoffset ...
nsDependentCSubstring external
methods constructors void nsdependentcsubstring_external() - source void nsdependentcsubstring_external(const char*, pruint32) - source parameters char* astart pruint32 alength void nsdependentcsubstring_external(const nsacstring&, pruint32) - source parameters nsacstring& astr pruint32 astartpos void nsdependentcsubstring_external(const nsacstring&, pruint32, pruint32) - source parameters nsacstring& astr pruint32 astartpos pruint32 alength rebin...
...d void rebind(const char*, pruint32) - source parameters char* astart pruint32 alength beginreading pruint32 beginreading(const char**, const char**) const - source returns the length, beginning, and end of a string in one operation.
...g&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* aptr nsacstring& operator=(char) - source parameters char achar replace void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint32, char) - source parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const nsacstring&) - source parameters pruint32 cutstart pruint32 cutlength nsacstring& readable ...
...os void insert(const char*, pruint32, pruint32) - source parameters char* data pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsDependentSubstring external
methods constructors void nsdependentsubstring_external() - source void nsdependentsubstring_external(const prunichar*, pruint32) - source parameters prunichar astart pruint32 alength void nsdependentsubstring_external(const nsastring&, pruint32) - source parameters nsastring astr pruint32 astartpos void nsdependentsubstring_external(const nsastring&, pruint32, pruint32) - source parameters nsastring astr pruint32 astartpos pruint32 alength rebind ...
... void rebind(const prunichar*, pruint32) - source parameters prunichar astart pruint32 alength beginreading pruint32 beginreading(const prunichar**, const prunichar**) const - source returns the length, beginning, and end of a string in one operation.
... parameters nsastring astring nsastring operator=(const prunichar*) - source parameters prunichar aptr nsastring operator=(prunichar) - source parameters prunichar achar replace void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar data pruint32 length void replace(pruint32, pruint32, prunichar) - source parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const nsastring&) - source parameters pruint32 cutstart pruint32 cutlength nsastring readable ...
... void insert(const prunichar*, pruint32, pruint32) - source parameters prunichar data pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
amIWebInstallInfo
toolkit/mozapps/extensions/amiwebinstalllistener.idlscriptable this interface is used by the default implementation of amiwebinstalllistener to communicate with the running application and allow it to warn the user about blocked installs and start the installs running.
... originatinguri nsiuri the uri that started the installs.
... originatingwindow nsidomwindow the window that started the installs.
... methods install() starts all installs.
imgIEncoder
nt32 frameformat, in astring frameoptions); void encodeclipboardimage(in nsiclipboardimage aclipboardimage, out nsifile aimagefile); obsolete since gecko 1.9 void endimageencode(); void initfromdata([array, size_is(length), const] in pruint8 data, in unsigned long length, in pruint32 width, in pruint32 height, in pruint32 stride, in pruint32 inputformat, in astring outputoptions); void startimageencode(in pruint32 width, in pruint32 height, in pruint32 inputformat, in astring outputoptions); constants possible values for input format (note that not all image formats support saving alpha channels): constant value description input_format_rgb 0 input is rgb each pixel is represented by three bytes: r, g, and b (in that order, regardless of host endianness) input_format_rgba...
... apng: ----- the following options can be used with startimageencode(): transparency=[yes|no|none] -- default: "yes" overrides default from input format.
... startimageencode() void startimageencode( in pruint32 width, in pruint32 height, in pruint32 inputformat, in astring outputoptions ); parameters width width in pixels.
...the alternative is to use startimageencode(), call addimageframe() one or more times, and then finish initialization with endimageencode().
mozIStorageConnection
begintransaction() starts a new transaction deferred transaction.
... begintransactionas() this method starts a new transaction of the given transaction type.
... note: the database engine does not support nested transactions, so attempting to start a transaction when one is already active will throw an exception.
...it loads pages from the start of the database file until the memory cache (specified by "pragma cache_size=") is full or the entire file is read.
nsIAccessibleTreeCache
last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports method overview nsiaccessible getcachedtreeitemaccessible(in long arow, in nsitreecolumn acolumn); void invalidatecache(in long arow, in long acount); void treeviewchanged(); void treeviewinvalidated(in long astartrow, in long aendrow, in long astartcol, in long aendcol); methods getcachedtreeitemaccessible() returns the tree item from the cache for the cell in the specified row and column; the nsiaccessible is created if it doesn't already exist in the cache.
...void invalidatecache( in long arow, in long acount ); parameters arow row index the invalidation starts from.
...void treeviewinvalidated( in long astartrow, in long aendrow, in long astartcol, in long aendcol ); parameters astartrow row index invalidation starts from.
...astartcol column index invalidation starts from.
nsIAutoCompleteInput
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview acstring getsearchat(in unsigned long index); void onsearchbegin(); void onsearchcomplete(); boolean ontextentered(); boolean ontextreverted(); void selecttextrange(in long startindex, in long endindex); attributes attribute type description completedefaultindex boolean if a search result has its defaultindex set, this will optionally try to complete the text in the textbox to the entire text of the result at the default index as the user types.
... selectionstart long the starting index of the current selection in the text field.
...onsearchbegin() called when the search starts.
...void selecttextrange( in long startindex, in long endindex ); parameters startindex the index to the first character in the text field to select.
nsIAutoCompleteSearch
toolkit/components/autocomplete/nsiautocompletesearch.idlscriptable this interface is implemented by search providers to start and stop autocomplete.
... inherits from: nsisupports last changed in gecko 1.7 users call startsearch() and pass in an nsiautocompleteobserver when the search starts.
...method overview void startsearch(in astring searchstring, in astring searchparam, in nsiautocompleteresult previousresult, in nsiautocompleteobserver listener); void stopsearch(); methods startsearch() search for a given string and notify a listener (either synchronously or asynchronously) of the result.
... void startsearch( in astring searchstring, in astring searchparam, in nsiautocompleteresult previousresult, in nsiautocompleteobserver listener ); parameters searchstring the string to search for.
nsIBrowserSearchService
this is not an issue if your code is executed in reaction to a user interaction, as initialization is complete by then, but this is an issue if your code is executed during startup.
... if you need to write code that is executed during startup and makes use of nsibrowsersearchservice, you should make sure that this code is executed from the callback to init().
... addenginewithdetails() adds a new search engine, without asking the user for confirmation and without starting to use it right away.
... if your code requires nsibrowsersearchservice and is executed during startup, you should make sure that this code is executed from the callback to init().
nsIClipboardDragDropHooks
use this to do things such as prevent a drag from starting, adding or removing data and flavors, or preventing the drop.
... method overview boolean allowdrop(in nsidomevent event, in nsidragsession session); boolean allowstartdrag(in nsidomevent event); boolean oncopyordrag(in nsidomevent aevent, in nsitransferable trans); boolean onpasteordrop(in nsidomevent event, in nsitransferable trans); methods allowdrop() tells gecko whether a drop is allowed on this content area.
...allowstartdrag() prevents the drag from starting.
... boolean allowstartdrag( in nsidomevent event ); parameters event the dom event (drag gesture).
nsIDownloadHistory
1.0 66 introduced gecko 1.9 inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void adddownload(in nsiuri asource, [optional] in nsiuri areferrer, [optional] in prtime astarttime); methods adddownload() adds a download to history.
...void adddownload( in nsiuri asource, in nsiuri areferrer, optional in prtime astarttime optional ); parameters asource the source of the download we are adding to history.
...astarttime optional the time the download was started.
... if the start time is not given, the current time is used.
nsIGeolocationProvider
after startup() is called, any geo location change should call callback.update().
...method overview boolean isready(); obsolete since gecko 1.9.2 void shutdown(); void startup(); void watch(in nsigeolocationupdate callback); methods isready() obsolete since gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) reports whether or not the device is ready and has a position.
...startup() start up the provider.
...void startup(); parameters none.
nsILivemarkService
long getlivemarkidforfeeduri(in nsiuri afeeduri); nsiuri getsiteuri(in long long container); boolean islivemark(in long long folder); void reloadalllivemarks(); void reloadlivemarkfolder(in long long folderid); void setfeeduri(in long long container, in nsiuri feeduri); void setsiteuri(in long long container, in nsiuri siteuri); void start(); void stopupdatelivemarks(); methods createlivemark() creates a new livemark.
... createlivemarkfolderonly() this method also creates a new livemark but use this method during startup to avoid http traffic.
... exceptions thrown ns_error_invalid_arg if the folder id isn't known or identifies a folder that isn't a livemark container; also if the siteuri argument isn't a valid nsiuri object (or null) start() this method starts the livemark refresh timer.
... void start(); parameters none.
nsIMIMEInputStream
the value is recalculated every time the stream is rewound to the start.
... not allowed to be changed once the stream has been started to be read.
...may not be called once the stream has been started to be read.
...may not be called once the stream has been started to be read.
nsIPrefService
for example, if the root browser.startup.
... is used, the branch will be able to easily access the preferences browser.startup.page, browser.startup.homepage, and browser.startup.homepage_override by simply requesting page, homepage, or homepage_override.
...for example, if the root browser.startup.
... is used, the branch will be able to easily access the preferences browser.startup.page, browser.startup.homepage, and browser.startup.homepage_override by simply requesting page, homepage, or homepage_override.
nsISSLSocketControl
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void proxystartssl(); void starttls(); attributes attribute type description forcehandshake boolean obsolete since gecko 1.9 notificationcallbacks nsiinterfacerequestor methods proxystartssl() starts an ssl proxy connection.
... void proxystartssl(); parameters none.
... starttls() establishes a starttls connection.
...void starttls(); parameters none.
nsISelection
void collapsetoend(); void collapsetostart(); boolean containsnode(in nsidomnode node, in boolean partlycontained); void deletefromdocument(); void extend(in nsidomnode parentnode, in long offset); void extendnative(in nsidomnode parentnode, in long offset); native code only!
...void collapsetoend(); parameters none collapsetostart() collapses the whole selection to a single point at the start of the current selection (regardless of direction).
...void collapsetostart(); containsnode() indicates whether the nsidomnode is part of the selection.
... "extend()" leaves the start of the selection unchanged, and applies movement direction/granularity to the end of the selection.
nsITreeSelection
inherits from: nsisupports last changed in gecko 1.9 (firefox 3) method overview void adjustselection(in long index, in long count); void clearrange(in long startindex, in long endindex); void clearselection(); void getrangeat(in long i, out long min, out long max); long getrangecount(); void invalidateselection(); void invertselection(); boolean isselected(in long index); void rangedselect(in long startindex, in long endindex, in boolean augment); void select(in long index); void selectall(); void timedselect(in long index, in ...
...void clearrange( in long startindex, in long endindex ); parameters startindex index to clearing at.
...void rangedselect( in long startindex, in long endindex, in boolean augment ); parameters startindex index to start selecting at.
...this parameter is inclusive; to select one item, set endindex == startindex.
nsIWebSocketListener
erbird 8.0 / seamonkey 2.5) method overview void onacknowledge(in nsisupports acontext, in pruint32 asize); void onbinarymessageavailable(in nsisupports acontext, in acstring amsg); void onmessageavailable(in nsisupports acontext, in autf8string amsg); void onserverclose(in nsisupports acontext, in unsigned short acode, in autf8string areason); void onstart(in nsisupports acontext); void onstop(in nsisupports acontext, in nsresult astatuscode); methods onacknowledge() called to acknowledge a message sent via nsiwebsocketchannel.sendmsg() or nsiwebsocketchannel.sendbinarymsg().
... onstart() called to signify the establishment of the message stream.
... any listener that receives onstart() will also receive onstop().
... void onstart( in nsisupports acontext ); parameters acontext user defined context.
Using Objective-C from js-ctypes
speech synthesis example let's start with the following objective-c code, which invokes the speech synthesis api to say "hello, firefox!".
... #import <appkit/appkit.h> int main(void) { nsspeechsynthesizer* synth = [[nsspeechsynthesizer alloc] initwithvoice: nil]; [synth startspeakingstring: @"hello, firefox!"]; // wait until start speaking.
..._msgsend(tmp, initwithvoice, null); // @"hello, firefox!" id nsstring = (id)objc_getclass("nsstring"); sel initwithcstring_encoding = sel_registername("initwithcstring:encoding:"); int nsutf8stringencoding = 4; id tmp2 = objc_msgsend(nsstring, alloc); id text = objc_msgsend(tmp2, initwithcstring_encoding, "hello, firefox!", nsutf8stringencoding); // [synth startspeakingstring: @"hello, firefox!"]; sel startspeakingstring = sel_registername("startspeakingstring:"); objc_msgsend(synth, startspeakingstring, text); sel isspeaking = sel_registername("isspeaking"); // wait until start speaking.
...tr_t(null)); let nsstring = objc_getclass("nsstring"); let initwithcstring_encoding = sel_registername("initwithcstring:encoding:"); let nsutf8stringencoding = 4; let tmp2 = objc_msgsend(nsstring, alloc); let text = objc_msgsend(tmp2, initwithcstring_encoding, ctypes.char.array()("hello, firefox!"), ctypes.unsigned_long(nsutf8stringencoding)); let startspeakingstring = sel_registername("startspeakingstring:"); objc_msgsend(synth, startspeakingstring, text); let isspeaking = sel_registername("isspeaking"); // wait until start speaking.
ctypes.open
loading the native file if your addon is restartless, you must set it to be unpacked.
...tensions/youraddon@jetpack.xpi!/mysubfolder/mycfunctionsforunix.so" var filepath_mylib = localfilemylib.path; // "file:///c:/users/vayeate/appdata/roaming/mozilla/firefox/profiles/aecgxse.unnamed%20profile%201/extensions/youraddon@jetpack.xpi!/mysubfolder/mycfunctionsforunix.so" if your add-on is a bootstrap add-on, then you don't need to use this method to convert a chrome:// path; instead, on startup procedure of the bootstrap add-on obtain the file and/or jar path from installpath from the adata parameter.
... function startup(adata, areason) { var nsifile_folder = adata.installpath; // if addon is unpacked, this will be the addon folder.
... if addon is packed, this will be addon xpi } this can then be joined with your file name to obtain it's path like this: function startup(adata, areason) { var jarpath_folder = 'jar:' + os.path.tofileuri(adata.installpath.path) + '!/'; // if unpacked is false in install.rdf this will look like: "jar:file:///c:/users/vayeate/appdata/roaming/mozilla/firefox/profiles/aksozfjt.unnamed%20profile%2010/extensions/asynczip@jetpack!/" var filepath_folder = adata.installpath.path; // if unpacked is set to false in install.rdf this will look like: "c:\users\vayeate\appdata\roaming\mozilla\firefox\profiles\aksozfjt.unnamed profile 10\extensions\asynczip@jetpack" var filepath_mylib = os.path.join(filepath_folder, 'mysubfolder', 'mycfunctionsforunix.so'); var jarpath_mylib = jarpath_folde...
Version, UI, and Status Information - Plugins
it starts by using npn_version to get the version numbers.
... bool has_windowless() { npbool supportswindowless = false; nperror ret = npn_getvalue(instance, npnvsupportswindowless, &supportswindowless); return ret == nperr_no_error && supportswindowless; } reloading a plug-in when the browser starts up, it loads all the plug-ins it finds in the plugins directory for the platform.
... if you call npn_reloadplugins, the browser reloads all plug-ins in the plugins directory without restarting.
... this causes the browser to install a new plug-in and load it, or remove a plug-in, without having to restart.
Plugin Roadmap for Firefox - Plugins
schedule june 2016 starting with firefox 47 in june 2016, all plugins other than adobe flash are click-to-activate.
... march 2017 starting with firefox 52 in march 2017, plugins other than adobe flash are no longer supported in firefox.
... august 2017 starting with firefox 55 in august 2017, users must choose which sites are allowed to activate the flash plugin.
... september 2017 starting with firefox 56 in september 2017, firefox for android will remove all support for plugins (bug 1381916).
Intensive JavaScript - Firefox Developer Tools
a button to start and stop some css animations.
... leaving the radio button set to "use blocking call in main thread", make a recording: press the "start animations" button start recording a performance profile press "do pointless computations!" two or three times stop recording the profile exactly what you see will vary from one machine to another, but it will be something like this: the top half of this is the waterfall overview.
...ions; i++) { var candidate = i * (multiplier * math.random()); var isprime = true; for (var c = 2; c <= math.sqrt(candidate); ++c) { if (candidate % c === 0) { // not prime isprime = false; break; } } if (isprime) { primes.push(candidate); } } return primes; } in the worker, we have to listen for a message telling us to start, and send a "done" message back when we are done.
...compared with the original, each button-press is visible in the overview as two very short orange markers: the dopointlesscomputationsinworker() function that handles the click event and starts the worker's processing the handleworkercompletion() function that runs when the worker calls "done".
Waterfall - Firefox Developer Tools
stack at start call stack console.time(), with links to functions.
... gc is needed when a lot of memory is being allocated non-incremental gc is usually needed when the memory allocation rate 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".
... to make a console marker, call console.time() at the start of the section, and console.timeend() at the end.
... starting in firefox 41, the right-hand sidebar will also show the stack at the end of the period: that is, at the point console.timeend() was called.
Debugging Firefox Desktop - Firefox Developer Tools
you only need to do this once: the setting values persist across restarts.
... start the debugger server next, you need to start the debugger server in the debuggee.
... run the debuggee from the command line, passing it the --start-debugger-server option: /path/to/firefox --start-debugger-server passed with no arguments, --start-debugger-server makes the debugger server listen on port 6000.
... to use a different port, pass the desired port number: /path/to/firefox --start-debugger-server 1234 note: in windows, the start-debugger-server call will only have one dash: firefox.exe -start-debugger-server 1234 note: by default, and for security reasons, the devtools.debugger.force-local option is set.
AudioBufferSourceNode.AudioBufferSourceNode() - Web APIs
the sample frames, comprising the loop, run from the values loopstart to loopend-(1/samplerate).
... loopstart: an optional value in seconds, where looping should begin if the loop attribute is true.
...if loopstart is less than 0, looping will begin at 0.
... if loopstart is greater than the duration of the buffer, looping will begin at the end of the buffer.
AudioParam.setValueCurveAtTime() - Web APIs
the curve is a linear interpolation between the sequence of values defined in an array of floating-point values, which are scaled to fit into the given interval starting at starttime and a specific duration.
... syntax var paramref = param.setvaluecurveattime(values, starttime, duration); parameters values an array of floating-point numbers representing the value curve the audioparam will change through along the specified duration.
... starttime a double representing the time (in seconds) after the audiocontext was first created that the change in value will happen.
... rangeerror the specified starttime is either negative or a non-finite value, or duration is not a finite, strictly positive number.
AudioScheduledSourceNode.stop() - Web APIs
note: if a scheduled stop time occurs before the node's scheduled start time, the node never starts to play.
... return value undefined exceptions invalidstatenode the node has not been started by calling start().
... example this example demonstrates starting an oscillator node, scheduled to begin playing at once and to stop playing in one second.
...*/ osc.start(); osc.stop(context.currenttime + 1); specifications specification status comment web audio apithe definition of 'stop()' in that specification.
AudioScheduledSourceNode - Web APIs
the audioscheduledsourcenode interface—part of the web audio api—is a parent interface for several types of audio source node interfaces which share the ability to be started and stopped, optionally at specified times.
... specifically, this interface defines the start() and stop() methods, as well as the onended event handler.
... unless stated otherwise, nodes based upon audioscheduledsourcenode output silence when not playing (that is, before start() is called and after stop() is called).
... methods inherits methods from its parent interface, audionode, and adds the following methods: start() schedules the node to begin playing the constant sound at the specified time.
CanvasRenderingContext2D.arcTo() - Web APIs
examples how arcto works one way to think about arcto() is to imagine two straight segments: one from the starting point to a first control point, and another from there to a second control point.
...canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // tangential lines ctx.beginpath(); ctx.strokestyle = 'gray'; ctx.moveto(200, 20); ctx.lineto(200, 130); ctx.lineto(50, 20); ctx.stroke(); // arc ctx.beginpath(); ctx.strokestyle = 'black'; ctx.linewidth = 5; ctx.moveto(200, 20); ctx.arcto(200,130, 50,20, 40); ctx.stroke(); // start point ctx.beginpath(); ctx.fillstyle = 'blue'; ctx.arc(200, 20, 5, 0, 2 * math.pi); ctx.fill(); // control points ctx.beginpath(); ctx.fillstyle = 'red'; ctx.arc(200, 130, 5, 0, 2 * math.pi); // control point one ctx.arc(50, 20, 5, 0, 2 * math.pi); // control point two ctx.fill(); result in this example, the path created by arcto() is thick and black.
... tangent lines are gray, control points are red, and the start point is blue.
...this happens because the radius is too large for the arc to fit entirely below the starting point.
CanvasRenderingContext2D.clearRect() - Web APIs
make sure to call beginpath() before starting to draw new items after calling clearrect().
... parameters x the x-axis coordinate of the rectangle's starting point.
... y the y-axis coordinate of the rectangle's starting point.
...this is commonly required at the start of each frame in an animation.
CanvasRenderingContext2D.createRadialGradient() - Web APIs
syntax canvasgradient ctx.createradialgradient(x0, y0, r0, x1, y1, r1); the createradialgradient() method is specified by six parameters, three defining the gradient's start circle, and three defining the end circle.
... parameters x0 the x-axis coordinate of the start circle.
... y0 the y-axis coordinate of the start circle.
... r0 the radius of the start circle.
DataTransfer.clearData() - Web APIs
this method can only be used in the handler for the dragstart event, because that's the only time the drag operation's data store is writeable.
...</span> <span class="tweaked" id="target">drop zone</span> <div>status: <span id="status">drag to start</span></div> <div>data is: <span id="data">uninitialized</span></div> css span.tweaked { display: inline-block; margin: 1em 0; padding: 1em 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } javascript window.addeventlistener('domcontentloaded', function () { // select html elements var draggable = document.getelementbyid('source'...
...); var dropable = document.getelementbyid('target'); var status = document.getelementbyid('status'); var data = document.getelementbyid('data'); var dropped = false; // register event handlers draggable.addeventlistener('dragstart', dragstarthandler); draggable.addeventlistener('dragend', dragendhandler); dropable.addeventlistener('dragover', dragoverhandler); dropable.addeventlistener('dragleave', dragleavehandler); dropable.addeventlistener('drop', drophandler); function dragstarthandler (event) { status.innerhtml = 'drag in process'; // change target element's border to signify drag has started event.currenttarget.style.border = '1px dashed blue'; // start by clearing existing clipboards; this will affect all types since we // don't give a specif...
... } function dragendhandler (event) { if (!dropped) { status.innerhtml = 'drag canceled'; } data.innerhtml = event.datatransfer.getdata('text/plain') || 'empty'; // change border to signify drag is no longer in process event.currenttarget.style.border = '1px solid black'; if (dropped) { // remove all event listeners draggable.removeeventlistener('dragstart', dragstarthandler); draggable.removeeventlistener('dragend', dragendhandler); dropable.removeeventlistener('dragover', dragoverhandler); dropable.removeeventlistener('dragleave', dragleavehandler); dropable.removeeventlistener('drop', drophandler); } } function dragoverhandler (event) { status.innerhtml = 'drop available'; event.preventdefault(); } ...
DataTransfer.setDragImage() - Web APIs
when a drag occurs, a translucent image is generated from the drag target (the element the dragstart event is fired at), and follows the mouse pointer during the drag.
... this method must be called in the dragstart event handler.
... demo <!doctype html> <html lang=en> <title>example of datatransfer.setdragimage()</title> <meta name="viewport" content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> <script> function dragstart_handler(ev) { console.log("dragstart"); // set the drag's format and data.
...andler(ev) { console.log("dragover"); ev.preventdefault(); } function drop_handler(ev) { console.log("drop"); ev.preventdefault(); // get the data, which is the id of the drop target var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } </script> <body> <h1>example of <code>datatransfer.setdragimage()</code></h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html living standardthe definition of 'setdragima...
Traversing an HTML table with JavaScript and DOM Interfaces - Web APIs
at the end of the start function, there is a new line of code.
... <head> <title>sample code - traversing an html table with javascript and dom interfaces</title> <script> function start() { // get the reference for the body var mybody = document.getelementsbytagname("body")[0]; // creates <table> and <tbody> elements mytable = document.createelement("table"); mytablebody = document.createelement("tbody"); // creating all cells for(var j = 0; j < 3; j++) { // creates a <tr> element mycurrent_row = document.createelement("tr"); for(var i...
... // appends the row <tr> into <tbody> mytablebody.appendchild(mycurrent_row); } // appends <tbody> into <table> mytable.appendchild(mytablebody); // appends <table> into <body> mybody.appendchild(mytable); // sets the border attribute of mytable to 2; mytable.setattribute("border","2"); } </script> </head> <body onload="start()"> </body> </html> manipulating the table with dom and css getting a text node from the table this example introduces two new dom attributes.
... <html> <body onload="start()"> </body> <script> function start() { var mybody = document.getelementsbytagname("body")[0]; mytable = document.createelement("table"); mytablebody = document.createelement("tbody"); for(var row = 0; row < 2; row++) { mycurrent_row=document.createelement("tr"); for(var col = 0; col < 2; col++) { mycurrent_cell = document.crea...
EffectTiming.fill - Web APIs
WebAPIEffectTimingfill
the web animations api's effecttiming dictionary's fill property specifies a fill mode, which defines how the element to which the animation is applied should look when the animation sequence is not actively running, such as before the time specified by iterationstart or after animation's end time.
...that means that unless we specify otherwise using the fill property, the instant the animation is started the element will be rotated to the left 90°, and then it will animate smoothly from there.
...notice how before the animation starts running, the box is upright, then upon clicking the "animate!" button, the box is instantly rotated 90° to the left (to correspond to the first keyframe in the animation sequence).
...fill modes to persist an animation, it is often simpler to set the final value of the animation effect directly in specified style: elem.animate({ transform: 'translatey(100px)' }, 200).finished.then(() => { elem.style.transform = 'translatey(100px)'; }); alternatively, it may be simpler still to set the final value in specified style before triggering the animation and then animate from the start value.
Element.scrollIntoView() - Web APIs
corresponds to scrollintoviewoptions: {block: "start", inline: "nearest"}.
... one of start, center, end, or nearest.
... defaults to start.
... one of start, center, end, or nearest.
HTMLInputElement.setRangeText() - Web APIs
syntax element.setrangetext(replacement); element.setrangetext(replacement, start, end [, selectmode]); parameters replacement the string to insert.
... start optional the 0-based index of the first character to replace.
... defaults to the current selectionstart value (the start of the user's current selection).
... "start"moves the selection to just before the inserted text.
HTMLMediaElement.play() - Web APIs
it returns a promise which is resolved when playback has been successfully started.
... return value a promise which is resolved when playback has been started, or is rejected if for any reason playback cannot be started.
...this may happen, for example, if the browser requires the user to explicitly start media playback by clicking a "play" button.
...if playback fails to start, the playbutton element's class is cleared, restoring its default appearance.
In depth: Microtasks and the JavaScript runtime environment - Web APIs
starting with the addition of timeouts and intervals as part of the web api (settimeout() and setinterval()), the javascript environment provided by web browsers has gradually advanced to include powerful features that enable scheduling of tasks, multi-threaded application development, and so forth.
... upon starting the program, the global context is created.
... tasks vs microtasks a task is any javascript scheduled to be run by the standard mechanisms such as initially starting to execute a program, an event triggering a callback, and so forth.
... when multiple programs and multiple code objects within those programs start to try to work at once, alongside a browser which also needs processor time—let alone time to render and draw the site and its own ui, handle user events, and so forth—everything becomes clogged up far too easily nowadays.
Using microtasks in JavaScript with queueMicrotask() - Web APIs
tasks a task is any javascript code which is scheduled to be run by the standard mechanisms such as initially starting to run a program, an event callback being run, or an interval or timeout being fired.
...it starts by encoding it as json using the json.stringify() method.
...an urgent callback has run!"); log("main program started"); settimeout(callback, 0); queuemicrotask(urgentcallback); log("main program exiting"); result note that the output logged from the main program body appears first, followed by the output from the microtask, followed by the timeout's callback.
...an urgent callback has run!"); let dowork = () => { let result = 1; queuemicrotask(urgentcallback); for (let i=2; i<=10; i++) { result *= i; } return result; }; log("main program started"); settimeout(callback, 0); log(`10!
IDBCursor - Web APIs
WebAPIIDBCursor
it starts at the lower bound of the key range and moves upwards (monotonically increasing in the order of keys).
...it starts at the lower bound of the key range and moves upwards.
...it starts at the upper bound of the key range and moves downwards (monotonically decreasing in the order of keys).
...it starts at the upper bound of the key range and moves downwards.
IDBTransaction - Web APIs
you use idbdatabase to start transactions, idbtransaction to set the mode of the transaction (e.g.
.../idbtransaction" target="_top"><rect x="151" y="1" width="140" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="221" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">idbtransaction</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} transactions are started when the transaction is created, not when the first request is placed; for example consider this: var trans1 = db.transaction("foo", "readwrite"); var trans2 = db.transaction("foo", "readwrite"); var objectstore2 = trans2.objectstore("foo") var objectstore1 = trans1.objectstore("foo") objectstore2.put("2", "key"); objectstore1.put("1", "key"); after the code is executed the object store shou...
...commit() can be used to start the commit process without waiting for events from outstanding requests to be dispatched.
...this mode is for updating the version number of transactions that were started using the setversion() method of idbdatabase objects.
Basic concepts - Web APIs
this will start a versionchange transaction and fire an upgradeneeded event.
...so, for example, if a database connection already has a writing transaction with a scope that just covers the flyingmonkey object store, you can start a second transaction with a scope of the unicorncentaur and unicornpegasus object stores.
...and you don't even have to wait for the transaction to start or be active to abort it.
...you can still start several transactions with the same scope at the same time, but they just queue up and execute one after another.
MediaRecorder.state - Web APIs
syntax var state = mediarecorder.state values a animationplaystate object containing one 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.
... recording recording has been started and the ua is capturing data.
... paused recording has been started, then paused, but not yet stopped or resumed.
... record.onclick = function() { mediarecorder.start(); console.log(mediarecorder.state); // will return "recording" console.log("recorder started"); } ...
MediaStreamConstraints.audio - Web APIs
html content <p>click the start button below to begin the demonstration.</p> <div id="startbutton" class="button"> start </div> <audio id="audio" autoplay controls></audio><br> <div id="log"></div> css content body { font: 14px "open sans", "arial", sans-serif; } audio { margin-top: 20px; border: 1px solid black; width: 160px; } .button { cursor: pointer; width: 160px; border: 1px solid black; font-size: 1...
...6px; 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 is returned.
... result using a mediatrackconstraints object now let's look at a similar example that uses a set of constraints based on the mediatrackconstraints dictionary: html content <p>click the start button below to begin the demonstration.</p> <div id="startbutton" class="button"> start </div> <audio id="audio" autoplay controls></audio><br> <div id="log"></div> css content body { font: 14px "open sans", "arial", sans-serif; } audio { margin-top: 20px; border: 1px solid black; width: 160px; } .button { cursor: pointer; width: 160px; border: 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 enabled and that, if possible, the sample rate be 8 bits per sample instead of the more common 16 bits (possibly as a bandwidth saving measure).
MediaStreamConstraints.video - Web APIs
html content <p>click the start button below to begin the demonstration.</p> <div id="startbutton" class="button"> start </div> <video id="video" width="160" height="120" autoplay></video><br> <div id="log"></div> css content body { font: 14px "open sans", "arial", sans-serif; } video { margin-top: 20px; border: 1px solid black; } .button { cursor: pointer; width: 160px; border: 1px solid black; font-size: 1...
...6px; 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 is returned.
... result using a mediatrackconstraints object now let's look at a similar example that uses a set of constraints based on the mediatrackconstraints dictionary: html content <p>click the start button below to begin the demonstration.</p> <div id="startbutton" class="button"> start </div> <video id="video" width="160" height="120" autoplay></video><br> <div id="log"></div> css content body { font: 14px "open sans", "arial", sans-serif; } video { margin-top: 20px; border: 1px solid black; } .button { cursor: pointer; width: 160px; border: 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 preference for a video track whose dimensions are as close as possible to 160x120 pixels, and whose frame rate is as close to 15 frames per second as possible.
PerformanceEventTiming - Web APIs
auxclick beforeinput click compositionend compositionstart compositionupdate contextmenu dblclick dragend dragenter dragleave dragover dragstart drop input keydown keypress keyup mousedown mouseenter mouseleave mouseout mouseover mouseup pointerover pointerenter pointerdown pointerup pointercancel pointerout pointerleave gotpointercapture lostpointercapture touchstart touchend touchcancel properties performanceeventtiming.processingstart returns the time at which event dispatch started.
... examples the following example shows how to use the api for all events: const observer = new performanceobserver(function(list) { const perfentries = list.getentries().foreach(entry => { // full duration const inputduration = entry.duration; // input delay (before processing event) const inputdelay = entry.processingstart - entry.starttime; // synchronous event processing time (between start and end dispatch).
... const inputsyncprocessingtime = entry.processingend - entry.processingstart; }); }); // register observer for event.
... if (entry.starttime < firsthiddentime) { const fid = entry.processingstart - entry.starttime; // report the fid value to an analytics endpoint.
RTCPeerConnection.createOffer() - Web APIs
the createoffer() method of the rtcpeerconnection interface initiates the creation of an sdp offer for the purpose of starting a new webrtc connection to a remote peer.
... icerestart optional to restart ice on an active connection, set this to true.
...if you then apply the returned offer, ice will restart.
... specify false to keep the same credentials and therefore not restart ice.
RTCPeerConnection.setConfiguration() - Web APIs
in this situation, one might call setconfiguration() to switch to new regional ice servers, then initiate an ice restart.
... example in this example, it has already been determined that ice restart is needed, and that negotiation needs to be done using a different ice server.
... var restartconfig = { iceservers: [{ urls: "turn:asia.myturnserver.net", username: "allie@oopcode.com", credential: "topsecretpassword" }] }; mypeerconnection.setconfiguration(restartconfig); mypeerconnection.createoffer({"icerestart": true}).then(function(offer) { return mypeerconnection.setlocaldescription(offer); }) .then(function() { // send the offer to the other peer using the signaling server }) .catch(reporterror); first, a new rtcconfiguration is created, restartconfig, specifying the new ice server and its credentials.
...ice negotiation is restarted by calling createoffer(), specifying true as the value of the icerestart option.
Range.compareBoundaryPoints() - Web APIs
range.end_to_start compares the end boundary-point of sourcerange to the start boundary-point of range.
... range.start_to_end compares the start boundary-point of sourcerange to the end boundary-point of range.
... range.start_to_start compares the start boundary-point of sourcerange to the start boundary-point of range.
... example var range, sourcerange, compare; range = document.createrange(); range.selectnode(document.getelementsbytagname("div")[0]); sourcerange = document.createrange(); sourcerange.selectnode(document.getelementsbytagname("div")[1]); compare = range.compareboundarypoints(range.start_to_end, sourcerange); specifications specification status comment domthe definition of 'range.compareboundarypoints()' in that specification.
Selection - Web APIs
WebAPISelection
anchor and focus should not be confused with the start and end positions of a selection.
... selection.iscollapsedread only returns a boolean indicating whether the selection's start and end points are at the same position.
... selection.collapsetostart() collapses the selection to the start of the first range in the selection.
... the above behavior applies to selections made using the following methods: selection.collapse() selection.collapsetostart() selection.collapsetoend() selection.extend() selection.selectallchildren() selection.addrange() selection.setbaseandextent() and when the range is modified using the following methods: range.setstart() range.setend() range.setstartbefore() range.setstartafter() range.setendbefore() range.setendafter() range.collapse() range.selectnode() range.selectnodecontents() glossary o...
SourceBuffer - Web APIs
sourcebuffer.appendwindowstart controls the timestamp for the start of the append window.
... sourcebuffer.onupdatestart fired whenever the value of sourcebuffer.updating transitions from false to true.
... sourcebuffer.appendbufferasync() starts the process of asynchronously appending the specified buffer to the sourcebuffer.
... sourcebuffer.removeasync() starts the process of asynchronously removing media segments in the specified range from the sourcebuffer.
Touch.target - Web APIs
WebAPITouchtarget
summary returns the element (eventtarget) on which the touch contact started when it was first placed on the surface, even if the touch point has since moved outside the interactive area of that element or even been removed from the document.
...the touch.target property is an element (eventtarget) on which a touch point is started when contact is first placed on the surface.
...when the touchstart event handler for this element is invoked, each touch point's touch.target property is accessed via the event's touchevent.targettouches list.
... // register a touchmove listener for the 'source' element var src = document.getelementbyid("source"); src.addeventlistener('touchstart', function(e) { // iterate through the touch points that were activiated // for this element.
TouchEvent.touches - Web APIs
touches is a read-only touchlist listing all the touch objects for touch points that are currently in contact with the touch surface, regardless of whether or not they've changed or what their target element was at touchstart time.
... syntax var touches = touchevent.touches; return value touches a touchlist listing all the touch objects for touch points that are still in contact with the touch surface, regardless of whether or not they've changed or what their target element was at touchstart time.
... in following code snippet, the touchstart event handler checks the length of the touchevent.touches list to determine the number of touch points that were activated and then invokes different handlers depending on the number of touch points.
... someelement.addeventlistener('touchstart', function(e) { // invoke the appropriate handler depending on the // number of touch points.
User Timing API - Web APIs
starttime - set to the timestamp when mark() was called.
... creating a performance measure a measure is created by calling performance.measure(measurename, startmarkname, endmarkname) where measurename is the measure's name and startmarkname and endmarkname are the start and end names, respectively, of the marks the measure will be placed between (in the performance timeline).
... starttime - set to the timestamp when measure() was called.
... duration - set to a domhighrestimestamp that is the duration of the measure (typically, the end mark timestamp minus the start mark timestamp).
VTTCue() - Web APIs
WebAPIVTTCueVTTCue
syntax vttcue = new vttcue(starttime, endtime, text); parameters starttime this is a double representing the initial text track cue start time.
...for example, if a cue is to be visible from 50 seconds to a one minute, five and a half seconds in the media's playback, starttime will be 50.0.
...given the example cue mentioned under starttime, the value of endtime would be 65.5.
... text a domstring providing the text that will be shown during the time span indicated by starttime and endtime.
Simple color animation - Web APIs
the user can start, stop and restart the animation by clicking the button.
...a click event handler additionally enables the basic user interaction of starting and stopping the animation.
... var button = document.queryselector("#animation-onoff"); var verb = document.queryselector("strong"); function startanimation(evt) { button.removeeventlistener(evt.type, startanimation, false); button.addeventlistener("click", stopanimation, false); verb.innerhtml="stop"; // setup animation loop by redrawing every second.
... drawanimation(); } function stopanimation(evt) { button.removeeventlistener(evt.type, stopanimation, false); button.addeventlistener("click", startanimation, false); verb.innerhtml="start"; // stop animation by clearing the timer.
Animating textures in WebGL - Web APIs
this is actually pretty easy to do and fun to watch, so let's get started.
...checking for both of these events guarantees there is data available and it's safe to start uploading video to a webgl texture.
... in the code above, we confirm whether we got both of those events; if so, we set a global variable, copyvideo, to true to indicate that it's safe to start copying the video to a texture.
... and finally, we set the src attribute to start and call play to start loading and playing the video.
WebGL tutorial - Web APIs
this tutorial describes how to use the <canvas> element to draw webgl graphics, starting with the basics.
... the examples provided should give you some clear ideas what you can do with webgl and will provide code snippets that may get you started in building your own content.
... before you start using the <canvas> element is not very difficult, but you do need a basic understanding of html and javascript.
... in this tutorial getting started with webgl how to set up a webgl context.
Viewpoints and viewers: Simulating cameras in WebXR - Web APIs
the format for storing matrices is generally as a flat array in column-major order; that is, the values from the matrix are written starting with the top-left corner and moving down to the bottom, then moving over to the right a row and repeating until all values are in the array.
... if you start each frame's rendering pass by computing the perspective matrix, you can then multply into that matrix all the other transforms you need to apply in order to result in the frame's desired geometry.
... for example: const transform = createperspectivematrix(viewport, 130, 1, 100); const translatevec = vec3.fromvalues(-trackdistance, -cranedistance, pushdistance); mat4.translate(transform, transform, translatevec); this starts with the perspective matrix representing a 130° vertical field of view, then applies a translation that moves the camera in a manner that includes track, crane, and push movements.
... then we clear the framebuffer to ensure we're starting with a known state, since our renderer will not be touching every pixel.
Using IIR filters - Web APIs
demo our simple example for this guide provides a play/pause button that starts and pauses audio play, and a toggle that turns an iir filter on and off, altering the tone of the sound.
...something like this is acceptable: let feedforward = [0.00020298, 0.0004059599, 0.00020298]; our feedback values cannot start with zero, otherwise on the first pass nothing would be sent back: let feedbackward = [1.0126964558, -1.9991880801, 0.9873035442]; note: these values are calculated based on the lowpass filter specified in the filter characteristics of the web audio api specification.
...we set this up using a custom function, playsoundnode(), which creates a buffer source from an existing audiobuffer, attaches it to the default destination, starts it playing, and returns it: function playsourcenode(audiocontext, audiobuffer) { 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.
... the play button html looks like this: <button class="button-play" role="switch" data-playing="false" aria-pressed="false">play</button> and the click event listener starts like so: playbutton.addeventlistener('click', function() { if (this.dataset.playing === 'false') { srcnode = playsourcenode(audioctx, sample); ...
Using the Web Audio API - Web APIs
let's take a look at getting started with the web audio api.
...so, let's start by taking a look at our play and pause functionality.
...this is where the web audio api really starts to come in handy.
... this makes up quite a few basics that you would need to start to add audio to your website or web app.
Visualizations with Web Audio API - Web APIs
8; var bufferlength = analyser.frequencybincount; var dataarray = new uint8array(bufferlength); next, we clear the canvas of what had been drawn on it before to get ready for the new visualization display: canvasctx.clearrect(0, 0, width, height); we now define the draw() function: function draw() { in here, we use requestanimationframe() to keep looping the drawing function once it has been started: var drawvisual = requestanimationframe(draw); next, we grab the time domain data and copy it into our array analyser.getbytetimedomaindata(dataarray); next, fill the canvas with a solid colour to start canvasctx.fillstyle = 'rgb(200, 200, 200)'; canvasctx.fillrect(0, 0, width, height); set a line width and stroke colour for the wave we will draw, then begin drawing a path canvasctx.line...
... canvasctx.moveto(x, y); } else { canvasctx.lineto(x, y); } x += slicewidth; } finally, we finish the line in the middle of the right hand side of the canvas, then draw the stroke we've defined: canvasctx.lineto(canvas.width, canvas.height/2); canvasctx.stroke(); }; at the end of this section of code, we invoke the draw() function to start off the whole process: draw(); this gives us a nice waveform display that updates several times a second: creating a frequency bar graph another nice little sound visualization to create is one of those winamp-style frequency bar graphs.
... analyser.fftsize = 256; var bufferlength = analyser.frequencybincount; console.log(bufferlength); var dataarray = new uint8array(bufferlength); canvasctx.clearrect(0, 0, width, height); next, we start our draw() function off, again setting up a loop with requestanimationframe() so that the displayed data keeps updating, and clearing the display with each animation frame.
... var barwidth = (width / bufferlength) * 2.5; var barheight; var x = 0; as before, we now start a for loop and cycle through each value in the dataarray.
Web audio spatialization basics - Web APIs
let's take a look at each of them: to start we can set the panningmodel.
...the inner cone is where gain (volume) is always emulated at a maximum and the outer cone is where the gain starts to drop away.
... const rolloff = 10; now we can start setting our position and orientation of our boombox.
... to start with let's take a look at our left, right, up and down values as these are pretty straightforward.
Window.prompt() - Web APIs
WebAPIWindowprompt
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetpromptchrome full support 1notes full support 1notes notes starting with chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.edge full support 12firefox full support 1ie full support 4notes full support 4notes notes this funct...
...desktop versions of ie do implement this function.opera full support 3notes full support 3notes notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.safari full support 1webview android full support 1notes full support 1notes notes starting with webview 46, this method is blocked inside an <ifra...
...me> unless its sandbox attribute has the value allow-modals.chrome android full support 18notes full support 18notes notes starting with chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.firefox android full support 4opera android full support 10.1notes full support 10.1notes notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.safari ios full support 1samsung internet android ful...
...l support 1.0notes full support 1.0notes notes starting with samsung internet 5.0, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.legend full support full supportsee implementation notes.see implementation notes.
XRSystem - Web APIs
WebAPIXRSystem
) { immersivebutton.addeventlistener("click", onbuttonclicked); navigator.xr.issessionsupported('immersive-vr') .then((issupported) => { if (issupported) { immersivebutton.disabled = false; } else { immersivebutton.disabled = true; }); } function onbuttonclicked() { if (!xrsession) { navigator.xr.requestsession('immersive-vr') .then(() => { // onsessionstarted() not shown for reasons of brevity and clarity.
... onsessionstarted(xrsession); }); } else { // shut down the already running xrsession xrsession.end() .then(() => xrsession = null); } } this code starts by checking to see if webxr is available by looking for the navigator.xr property.
...if there isn't, we use requestsession() to start one and, once the returned promise resolves, we call a function onsessionstarted() to set up our session for rendering and so forth.
...that way, if the user clicks the button again, a new session will start.
-webkit-border-before - CSS: Cascading Style Sheets
the -webkit-border-before css property is a shorthand property for setting the individual logical block start border property values in a single place in the style sheet.
... it relates to -webkit-border-after, -webkit-border-start, and -webkit-border-end, which define the other borders of the element.
... this property is on the standard track as border-block-start.
...= <number> | <angle> examples applying a border with vertical text html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; -webkit-border-before: 5px dashed blue; } result specifications not part of any standard, but it relates to the standards-track border-block-start property.
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
start with a structured and accessible document a grid layout should mean we do not need to change our document source in order to get the layout that we want.
... therefore the starting point of your page should be a well structured and accessible source document.
...starting out with a well-structured document is a very good way to avoid the problem, as you will be aware that you are removing semantic elements in order to make the layout work if you actually have to go into the document and do so!
... as a way to start thinking about these issues, as you use css grid layout i would suggest reading flexbox & the keyboard navigation disconnect from léonie watson.
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
the ie/edge (≤15) version of the specification is prefixed with an -ms prefix and the properties implemented in ie/edge (≤15) are as follows: grid-template-columns as -ms-grid-columns grid-template-rows as -ms-grid-rows grid-row-start as -ms-grid-row grid-column-start as -ms-grid-column align-self as -ms-grid-row-align justify-self as -ms-grid-column-align the ie version has additional properties not required in the new specification of -ms-grid-column-span and -ms-grid-row-span.
...if they tend to use up-to-date versions of firefox, chrome, opera, and safari, then it would make sense to start using css grids once those browsers update.
... starting to use grid in production it is worth noting that you do not have to use grid in an all or nothing way.
... you could start by simply enhancing elements in your design with grid, that could otherwise display using an older method.
animation-direction - CSS: Cascading Style Sheets
in other words, each time the animation cycles, the animation will reset to the beginning state and start over again.
...in other words, each time the animation cycles, the animation will reset to the end state and start over again.
...the count to determine if a cycle is even or odd starts at one.
...the count to determine if a cycle is even or odd starts at one.
<custom-ident> - CSS: Cascading Style Sheets
grid-row-start grid-row-end grid-column-start grid-column-end forbids the span value.
...characters and numbers ground-level a mix of alphanumeric characters and a dash -test a dash followed by alphanumeric characters _internal an underscore followed by alphanumeric characters \22 toto a unicode character followed by a sequence of alphanumeric characters bili\.bob a correctly escaped period invalid identifiers 34rem it must not start with a decimal digit.
... -12rad it must not start with a dash followed by a decimal digit.
...--toto it must not start with two dashes.
flex-direction - CSS: Cascading Style Sheets
the main-start and main-end points are the same as the content direction.
... row-reverse behaves the same as row but the main-start and main-end points are permuted.
...the main-start and main-end points are the same as the before and after points of the writing-mode.
... column-reverse behaves the same as column but the main-start and main-end are permuted.
float - CSS: Cascading Style Sheets
WebCSSfloat
syntax /* keyword values */ float: left; float: right; float: none; float: inline-start; float: inline-end; /* global values */ float: inherit; float: initial; float: unset; the float property is specified as a single keyword, chosen from the list of values below.
... inline-start the element must float on the start side of its containing block.
... formal definition initial valuenoneapplies toall elements, but has no effect if the value of display is none.inheritednocomputed valueas specifiedanimation typediscrete formal syntax left | right | none | inline-start | inline-end examples how floated elements are positioned as mentioned above, when an element is floated, it is taken out of the normal flow of the document (though still remaining part of it).
... editor's draft adds the values inline-start and inline-end.
image() - CSS: Cascading Style Sheets
image fragments one key difference between url() and image() is the ability to add a media fragment identifier — a starting point along the x and y axis, along with a width and height — onto the image source to display only a section of the source image.
...the syntax looks like so: background-image: image('myimage.webp#xywh=0,20,40,60'); the background image of the element will be the portion of the image myimage.webp that starts at the coordinate 0px, 20px (the top left hand corner) and is 40px wide and 60px tall.
...the first two represent the x and y coordates for the starting point of the box that will be created.
...what cursor do you see?</div> .box:hover { cursor: image("https://mdn.mozillademos.org/files/16411/sprite.png#xywh=32,64,16,16"); } when the user hovers over the box, the cursor will change to display the 16x16 px section of the sprite image, starting at x=32 and y=64.
margin-block - CSS: Cascading Style Sheets
the margin-block css shorthand property defines the logical block start and end margins of an element, which maps to physical margins depending on the element's writing mode, directionality, and text orientation.
... /* <length> values */ margin-block: 10px 20px; /* an absolute length */ margin-block: 1em 2em; /* relative to the text size */ margin-block: 5% 2%; /* relative to the nearest block container's width */ margin-block: 10px; /* sets both start and end values */ /* keyword values */ margin-block: auto; /* global values */ margin-block: inherit; margin-block: initial; margin-block: unset; these values corresponds to the margin-top and margin-bottom, or margin-right, and margin-left property depending on the values defined for writing-mode, direction, and text-orientation.
... constituent properties this property is a shorthand for the following css properties: margin-block-end margin-block-start syntax values the margin-block property takes the same values as the margin-left property.
... formal definition initial value0applies tosame as margininheritednopercentagesdepends on layout modelcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typediscrete formal syntax <'margin-left'>{1,2} examples setting block start and end margins html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; margin-block: 20px 40px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'margin-block' in that specification.
margin-inline - CSS: Cascading Style Sheets
the margin-inline css shorthand property is a shorthand property that defines both the logical inline start and end margins of an element, which maps to physical margins depending on the element's writing mode, directionality, and text orientation.
... /* <length> values */ margin-inline: 10px 20px; /* an absolute length */ margin-inline: 1em 2em; /* relative to the text size */ margin-inline: 5% 2%; /* relative to the nearest block container's width */ margin-inline: 10px; /* sets both start and end values */ /* keyword values */ margin-inline: auto; /* global values */ margin-inline: inherit; margin-inline: initial; margin-inline: unset; this property corresponds to the margin-top and margin-bottom, or margin-right, and margin-left properties, depending on the values defined for writing-mode, direction, and text-orientation.
... constituent properties this property is a shorthand for the following css properties: margin-inline-end margin-inline-start syntax values the margin-inline property takes the same values as the margin-left property.
... formal definition initial value0applies tosame as margininheritednopercentagesdepends on layout modelcomputed valueif specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, autoanimation typediscrete formal syntax <'margin-left'>{1,2} examples setting inline start and end margins html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-rl; margin-inline: 20px 40px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'margin-inline' in that specification.
repeating-linear-gradient() - CSS: Cascading Style Sheets
thus, the position of each ending color stop coincides with a starting color stop; if the color values are different, this will result in a sharp visual transition.
... syntax /* a repeating gradient tilted 45 degrees, starting blue and finishing red, repeating 3 times */ repeating-linear-gradient(45deg, blue, red 33.3%); /* a repeating gradient going from the bottom right to the top left, starting blue and finishing red, repeating every 20px */ repeating-linear-gradient(to left top, blue, red 20px); /* a gradient going from the bottom to top, starting blue, turning green after 40%, and finishing red.
... this gradient doesn't repeat because the last color stop defaults to 100% */ repeating-linear-gradient(0deg, blue, green 40%, red); /* a gradient repeating five times, going from the left to right, starting red, turning green, and back to red */ repeating-linear-gradient(to right, red 0%, green 10%, red 20%); values <side-or-corner> the position of the gradient line's starting point.
...a percentage of 0%, or a length of 0, represents the start of the gradient; the value 100% is 100% of the image size, meaning the gradient will not repeat.
touch-action - CSS: Cascading Style Sheets
an application using pointer events will receive a pointercancel event when the browser starts handling a touch gesture.
... when a gesture is started, the browser intersects the touch-action values of the touched element and its ancestors, up to the one that implements the gesture (in other words, the first containing scrolling element).
... after a gesture starts, changes to touch-action will not have any impact on the behavior of the current gesture.
...once scrolling has started, the direction may still be reversed.
CSS: Cascading Style Sheets
WebCSS
from css3, the scope of the specification increased significantly and the progress on different css modules started to differ so much, that it became more effective to develop and release recommendations separately per module.
... get started tutorials our css learning area features multiple modules that teach css from the ground up — no previous knowledge required.
...this module provides a gentle beginning to your path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html.
...in addition to providing code you can use as a starting point in your projects, these recipes highlight the different ways layout specifications can be used, and the choices you can make as a developer.
Media events - Developer guides
event name description abort sent when playback is aborted; for example, if the media is playing and is restarted from the beginning, this event is sent.
... loadstart sent when loading of the media begins.
... playing sent when the media has enough data to start playing, after the play event, but also when recovering from being stalled, when looping media restarts, and after seeked, if it was playing before seeking.
... the listener simply calls the element's play() method, which starts playback.
Introduction to Web development - Developer guides
whether you're just getting started with web development, or are just expanding your horizons into new realms of web awesomeness, the links here should help you get started.
... html elements reference guide — a comprehensive guide to html elements with details on how browsers support them css getting started with css — an absolute beginners guide to css covers basic concepts and fundamentals css reference guide — a complete guide to css with details on the level of gecko/firefox support for each.
... javascript beginning getting started with javascript — what is javascript and how can it help you?
...this is a good starting point for beginners wishing to learn web development fundamentals across a number of areas.
HTML attribute: rel - HTML: Hypertext Markup Language
WebHTMLAttributesrel
note: apple's ios does not use this link type, nor the sizes attribute, like others mobile browsers do, to select a webpage icon for web clip or a start-up placeholder.
... instead it uses the non-standard apple-touch-icon and apple-touch-startup-image respectively.
... note: apple's ios does not use this link type, nor the sizes attribute, like others mobile browsers do, to select a webpage icon for web clip or a start-up placeholder.
... instead it uses the non-standard apple-touch-icon and apple-touch-startup-image respectively.
<input type="time"> - HTML: Hypertext Markup Language
WebHTMLElementinputtime
this is simple enough, with the label and input as we've seen before, but with the addition of a <p> element with a <span> to display the value of the time input: <form> <label for="starttime">start time: </label> <input type="time" id="starttime"> <p> value of the <code>time</code> input: <code> "<span id="value">n/a</span>"</code>.
... var starttime = document.getelementbyid("starttime"); var valuespan = document.getelementbyid("value"); starttime.addeventlistener("input", function() { valuespan.innertext = starttime.value; }, false); when a form including a time input is submitted, the value is encoded before being included in the form's data.
...for example, specifying a min of 14:00 and a max of 2:00 means that the permitted time values start at 2:00 pm, run through midnight to the next day, ending at 2:00 am.
...chrome-based browsers support it starting in version 82 and firefox added it in version 76.
Microformats - HTML: Hypertext Markup Language
"dt-start", "dt-end", "dt-bday" special parsing: time element datetime attribute, value-class-pattern and separate date time value parsing for readability.
...h-event is often used with both event listings and individual event pages <div class="h-event"> <h1 class="p-name">microformats meetup</h1> <p>from <time class="dt-start" datetime="2013-06-30 12:00">30<sup>th</sup> june 2013, 12:00</time> to <time class="dt-end" datetime="2013-06-30 18:00">18:00</time> at <span class="p-location">some bar in sf</span></p> <p class="p-summary">get together and discuss all things microformats-related.</p> </div> properties property description p-name event name (or title) p-summary short...
... summary of the event dt-start datetime the event starts dt-end datetime the event ends p-location where the event takes place, optionally embedded h-card parsed h-event example <div class="h-event"> <h2 class="p-name">indieweb summit</h2> <time class="dt-start" datetime="2019-06-29t09:00:00-07:00">june 29, 2019 at 9:00am (-0700)</time><br>through <time class="dt-end" datetime="2019-06-30t18:00:00-07:00">june 30, 2019 at 6:00pm (-0700)</time><br> <div class="p-location h-card"> <div> <span class="p-name">mozilla</span> </div> <div> <span class="p-street-address">1120 nw couch st</span>, <span class="p-locality">portland</span>, <span class="p-region">oregon</span>, <span class="p-country">us</span> ...
...{ "name": [ "indieweb summit" ], "url": [ "https://aaronparecki.com/2019/06/29/1/" ], "author": [ { "type": [ "h-card" ], "properties": { "name": [ "aaron parecki" ], "url": [ "https://aaronparecki.com"] }, "lang": "en", "value": "aaron parecki" } ], "start": [ "2019-06-29t09:00:00-07:00" ], "end": [ "2019-06-30t18:00:00-07:00" ], "published": [ "2019-05-25t18:00:00-07:00" ], "content": [ { "html": "come join us", "value": "come join us", "lang": "en" } ], "location": [ { "type": [ "h-card" ], "properties": { ...
Grammar and types - JavaScript
note: you might also see a third type of comment syntax at the start of some javascript files, which looks something like this: #!/usr/bin/env node.
... a javascript identifier must start with a letter, underscore (_), or dollar sign ($).
...referencing the variable in the block before the variable declaration results in a referenceerror, because the variable is in a "temporal dead zone" from the start of the block until the declaration is processed.
... the syntax of a constant identifier is the same as any variable identifier: it must start with a letter, underscore, or dollar sign ($), and can contain alphabetic, numeric, or underscore characters.
Iterators and generators - JavaScript
it allows creation of a simple range iterator which defines a sequence of integers from start (inclusive) to end (exclusive) spaced step apart.
... function makerangeiterator(start = 0, end = infinity, step = 1) { let nextindex = start; let iterationcount = 0; const rangeiterator = { next: function() { let result; if (nextindex < end) { result = { value: nextindex, done: false } nextindex += step; iterationcount++; return result; } return { value: iterationcount, done: true } } }; return rangeiterator; } using the iterator then looks like this: const it = makerangeiterator(1, 10, 2); let result = it.next(); while (!result.done) { console.log(result.value); // 1 3 5 7 9 result = it.next(); } co...
... function* makerangeiterator(start = 0, end = 100, step = 1) { let iterationcount = 0; for (let i = start; i < end; i += step) { iterationcount++; yield i; } return iterationcount; } iterables an object is iterable if it defines its iteration behavior, such as what values are looped over in a for...of construct.
... here is the fibonacci generator using next(x) to restart the sequence: function* fibonacci() { let current = 0; let next = 1; while (true) { let reset = yield current; [current, next] = [next, next + current]; if (reset) { current = 0; next = 1; } } } const sequence = fibonacci(); console.log(sequence.next().value); // 0 console.log(sequence.next().value); // 1 console.log(sequence.next().value); //...
Functions - JavaScript
as we can see, both examples do not start with the function keyword.
... statements involving functions which do not start with function are function expressions.
... method definition syntax starting with ecmascript 2015, you are able to define own methods in a shorter syntax, similar to the getters and setters.
...ples // function declaration function foo() {} // function expression (function bar() {}) // function expression x = function hello() {} if (x) { // function expression function world() {} } // function declaration function a() { // function declaration function b() {} if (0) { // function expression function c() {} } } block-level functions in strict mode, starting with es2015, functions inside blocks are now scoped to that block.
Array.prototype.reduce() - JavaScript
starts from index 0 if an initialvalue is provided.
... otherwise, it starts from index 1.
... note: if initialvalue is not provided, reduce() will execute the callback function starting at index 1, skipping the first index.
... if initialvalue is provided, it will start at index 0.
Array.prototype.slice() - JavaScript
the slice() method returns a shallow copy of a portion of an array into a new array object selected from start to end (end not included) where start and end represent the index of items in that array.
... syntax arr.slice([start[, end]]) parameters start optional zero-based index at which to start extraction.
... if start is undefined, slice starts from the index 0.
... if start is greater than the index range of the sequence, an empty array is returned.
BigInt64Array - JavaScript
bigint64array.prototype.bytelength returns the length (in bytes) of the bigint64array from the start of its arraybuffer.
... bigint64array.prototype.byteoffset returns the offset (in bytes) of the bigint64array from the start of its arraybuffer.
... bigint64array.prototype.fill() fills all the elements of an array from a start index to an end index with a static value.
... bigint64array.prototype.subarray() returns a new biguint64array from the given start and end element index.
BigUint64Array - JavaScript
biguint64array.prototype.bytelength returns the length (in bytes) of the biguint64array from the start of its arraybuffer.
... biguint64array.prototype.byteoffset returns the offset (in bytes) of the biguint64array from the start of its arraybuffer.
... biguint64array.prototype.fill() fills all the elements of an array from a start index to an end index with a static value.
... biguint64array.prototype.subarray() returns a new biguint64array from the given start and end element index.
Float32Array - JavaScript
float32array.prototype.bytelength returns the length (in bytes) of the float32array from the start of its arraybuffer.
... float32array.prototype.byteoffset returns the offset (in bytes) of the float32array from the start of its arraybuffer.
... float32array.prototype.fill() fills all the elements of an array from a start index to an end index with a static value.
... float32array.prototype.subarray() returns a new float32array from the given start and end element index.
Float64Array - JavaScript
float64array.prototype.bytelength returns the length (in bytes) of the float64array from the start of its arraybuffer.
... float64array.prototype.byteoffset returns the offset (in bytes) of the float64array from the start of its arraybuffer.
... float64array.prototype.fill() fills all the elements of an array from a start index to an end index with a static value.
... float64array.prototype.subarray() returns a new float64array from the given start and end element index.
Int16Array - JavaScript
int16array.prototype.bytelength returns the length (in bytes) of the int16array from the start of its arraybuffer.
... int16array.prototype.byteoffset returns the offset (in bytes) of the int16array from the start of its arraybuffer.
... int16array.prototype.fill() fills all the elements of an array from a start index to an end index with a static value.
... int16array.prototype.subarray() returns a new int16array from the given start and end element index.
Int32Array - JavaScript
int32array.prototype.bytelength returns the length (in bytes) of the int32array from the start of its arraybuffer.
... int32array.prototype.byteoffset returns the offset (in bytes) of the int32array from the start of its arraybuffer.
... int32array.prototype.fill() fills all the elements of an array from a start index to an end index with a static value.
... int32array.prototype.subarray() returns a new int32array from the given start and end element index.
Int8Array - JavaScript
int8array.prototype.bytelength returns the length (in bytes) of the int8array from the start of its arraybuffer.
... int8array.prototype.byteoffset returns the offset (in bytes) of the int8array from the start of its arraybuffer.
... int8array.prototype.fill() fills all the elements of an array from a start index to an end index with a static value.
... int8array.prototype.subarray() returns a new int8array from the given start and end element index.
Intl.Locale.prototype.hourCycle - JavaScript
the 12 hour clock, with midnight starting at 12:00 am.
...the 24 hour clock, with midnight starting at 0:00.
...the 12 hour clock, with midnight starting at 0:00 am.
...the 24 hour clock, with midnight starting at 24:00.
Symbol.match - JavaScript
for example, the methods string.prototype.startswith(), string.prototype.endswith() and string.prototype.includes(), check if their first argument is a regular expression and will throw a typeerror if they are.
... property attributes of symbol.match writable no enumerable no configurable no examples disabling the isregexp check the following code will throw a typeerror: '/bar/'.startswith(/bar/); // throws typeerror, as /bar/ is a regular expression // and symbol.match is not modified.
...the methods startswith and endswith won't throw a typeerror as a consequence.
... var re = /foo/; re[symbol.match] = false; '/foo/'.startswith(re); // true '/baz/'.endswith(re); // false specifications specification ecmascript (ecma-262)the definition of 'symbol.match' in that specification.
TypedArray.prototype.copyWithin() - JavaScript
the copywithin() method copies the sequence of array elements within the array to the position starting at target.
... the copy is taken from the index positions of the second and third arguments start and end.
... syntax typedarray.copywithin(target, start[, end = this.length]) parameters target target start index position where to copy the elements to.
... start source start index position where to start copying elements from.
TypedArray - JavaScript
typedarray.prototype.byteoffset returns the offset (in bytes) of the typed array from the start of its arraybuffer.
... typedarray.prototype.fill() fills all the elements of an array from a start index to an end index with a static value.
... typedarray.prototype.subarray() returns a new typedarray from the given start and end element index.
... examples new is required starting with ecmascript 2015, typedarray constructors must be constructed with the new operator.
Uint16Array - JavaScript
uint16array.prototype.bytelength returns the length (in bytes) of the uint16array from the start of its arraybuffer.
... uint16array.prototype.byteoffset returns the offset (in bytes) of the uint16array from the start of its arraybuffer.
... uint16array.prototype.fill() fills all the elements of an array from a start index to an end index with a static value.
... uint16array.prototype.subarray() returns a new uint16array from the given start and end element index.
Uint32Array - JavaScript
uint32array.prototype.bytelength returns the length (in bytes) of the uint32array from the start of its arraybuffer.
... uint32array.prototype.byteoffset returns the offset (in bytes) of the uint32array from the start of its arraybuffer.
... uint32array.prototype.fill() fills all the elements of an array from a start index to an end index with a static value.
... uint32array.prototype.subarray() returns a new uint32array from the given start and end element index.
Uint8ClampedArray - JavaScript
uint8clampedarray.prototype.bytelength returns the length (in bytes) of the uint8clampedarray from the start of its arraybuffer.
... uint8clampedarray.prototype.byteoffset returns the offset (in bytes) of the uint8clampedarray from the start of its arraybuffer.
... uint8clampedarray.prototype.fill() fills all the elements of an array from a start index to an end index with a static value.
... uint8clampedarray.prototype.subarray() returns a new uint8clampedarray from the given start and end element index.
Lexical grammar - JavaScript
u+feff byte order mark <bom> used at the start of the script to mark it as unicode and the text's byte order (wikipedia).
...and is only valid at the absolute start of a script or module.
... decimal 1234567890 42 // caution when using with a leading zero: 0888 // 888 parsed as decimal 0777 // parsed as octal, 511 in decimal note that decimal literals can start with a zero (0) followed by another decimal digit, but if all digits after the leading 0 are smaller than 8, the number is interpreted as an octal number.
...if the digits after 0x are outside the range (0123456789abcdef), the following syntaxerror is thrown: "identifier starts immediately after numeric literal".
JavaScript typed arrays - JavaScript
a view provides a context — that is, a data type, starting offset, and the number of elements — that turns the data into a typed array.
... filereader.prototype.readasarraybuffer() the filereader.prototype.readasarraybuffer() method starts reading the contents of the specified blob or file.
... multiple views on the same data things start to get really interesting when you consider that you can create multiple views onto the same data.
... working with complex data structures by combining a single buffer with multiple views of different types, starting at different offsets into the buffer, you can interact with data objects containing multiple data types.
Critical rendering path - Web Performance
a request for a web page or app starts with an html request.
...a single dom node starts with a starttag token and ends with an endtag token.
...if another set of starttag and endtag tokens come between a set of starttag and endtags, you have a node inside a node, which is how we define the hierarchy of the dom tree.
...to construct the render tree, the browser checks every node, starting from root of the dom tree, and determine which css rules are attached.
Mobile first - Progressive web apps (PWAs)
in our planning your app article, we provided a high level look into the kinds of planning and functionality decisions you should make before you start coding an app, including some ideas for desktop and mobile design.
... note: starting with very little and working up as the need arises usually makes more sense than starting with everything and then covering up things if they aren't needed!
...volo has a number of useful commands available, of which we will just use a couple: volo server: starts a local web server at localhost:8080 and runs your app through it: great for easy testing.
... you can write your own feature detects (mark pilgrim's all-in-one almost-alphabetical guide to detecting everything is a good start), but really it is much better to use a dedicated existing solution, such as modernizr.
The building blocks of responsive design - Progressive web apps (PWAs)
fluid grids the best place to start is with fluid measurements for our application layout — essentially, this means using a combination of percentages and ems/rems to size your containers and text, not fixed widths such as pixels.
...for a start, let's have a look at what happens when we include the <video> and <img> elements inside our first two columns, naked and unstyled.
...the video always resizes dynamically, but the screen captures taken from it do not, so upon resizing the screen it was possible to end up with a messy layout with different sized elements when using max-width: 100%, such as: media queries fluid grids are a great start, but you'll notice that at certain points (known as breakpoints) the layout starts to break down.
...the trouble with this, then, is that raster images are zoomed in and as a result can start to look pixellated.
Structural overview of progressive web apps - Progressive web apps (PWAs)
progressive: start with the "good, old basic website” and progressively add new features while remembering to detect if they are available in the browser and gracefully handle any errors that crop up if support is not available.
... the app shell model requires all the resources to be available before the website can start rendering.
...instead, you can start right away.
... it provides fine-grained control: the stream can be started, chained with another stream, canceled, checked for errors, and more.
text-anchor - SVG: Scalable Vector Graphics
the text-anchor attribute is used to align (start-, middle- or end-alignment) a string of pre-formatted text or auto-wrapped text where the wrapping area is determined from the inline-size property relative to a given point.
...any element but it has effect only on the following five elements: <altglyph>, <text>, <textpath>, <tref>, and <tspan> html, body, svg { height: 100%; } <svg viewbox="0 0 120 120" xmlns="http://www.w3.org/2000/svg"> <!-- materialisation of anchors --> <path d="m60,15 l60,110 m30,40 l90,40 m30,75 l90,75 m30,110 l90,110" stroke="grey" /> <!-- anchors in action --> <text text-anchor="start" x="60" y="40">a</text> <text text-anchor="middle" x="60" y="75">a</text> <text text-anchor="end" x="60" y="110">a</text> <!-- materialisation of anchors --> <circle cx="60" cy="40" r="3" fill="red" /> <circle cx="60" cy="75" r="3" fill="red" /> <circle cx="60" cy="110" r="3" fill="red" /> <style><![cdata[ text { font: bold 36px verdana, helvetica, arial, sans-serif; } ]...
...]></style> </svg> usage notes default value start value start | middle | end animatable yes start the rendered characters are aligned such that the start of the text string is at the initial current text position.
...the midpoint between the start of the text string and the end of the text string is determined.
y1 - SVG: Scalable Vector Graphics
WebSVGAttributey1
two elements are using this attribute: <line>, and <lineargradient> html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <line x1="1" x2="9" y1="1" y2="5" stroke="red" /> <line x1="1" x2="9" y1="5" y2="5" stroke="green" /> <line x1="1" x2="9" y1="9" y2="5" stroke="blue" /> </svg> line for <line>, y1 defines the y coordinate of the starting point of the line.
...efault value 0 animatable yes example html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <line x1="1" x2="9" y1="1" y2="5" stroke="red" /> <line x1="1" x2="9" y1="5" y2="5" stroke="green" /> <line x1="1" x2="9" y1="9" y2="5" stroke="blue" /> </svg> lineargradient for <lineargradient>, y1 defines the y coordinate of the starting point of the gradient vector used to map the gradient stop values.
... the exact behavior of this attribute is influenced by the gradientunits attributs value <length> | <percentage> default value 0% animatable yes example html,body,svg { height:100% } <svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- by default the gradient vector start at the top left corner of the bounding box of the shape it is applied to.
... --> <lineargradient y1="0%" id="g0"> <stop offset="5%" stop-color="black" /> <stop offset="50%" stop-color="red" /> <stop offset="95%" stop-color="black" /> </lineargradient> <rect x="1" y="1" width="8" height="8" fill="url(#g0)" /> <!-- here the gradient vector start at the bottom left corner of the bounding box of the shape it is applied to.
<marker> - SVG: Scalable Vector Graphics
WebSVGElementmarker
markers are attached to shapes using the marker-start, marker-mid, and marker-end properties.
... html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <defs> <!-- arrowhead marker definition --> <marker id="arrow" viewbox="0 0 10 10" refx="5" refy="5" markerwidth="6" markerheight="6" orient="auto-start-reverse"> <path d="m 0 0 l 10 5 l 0 10 z" /> </marker> <!-- simple dot marker definition --> <marker id="dot" viewbox="0 0 10 10" refx="5" refy="5" markerwidth="5" markerheight="5"> <circle cx="5" cy="5" r="5" fill="red" /> </marker> </defs> <!-- coordinate axes with a arrowhead in both direction --> <polyline points="10,10 10,90 90,90" fill="none" stroke="black" marker-start="url(#arrow)" marker-end="url(#arrow)" /> <!-- data line with polymarkers --> <polyline points=...
..."15,80 29,50 43,60 57,30 71,40 85,15" fill="none" stroke="grey" marker-start="url(#dot)" marker-mid="url(#dot)" marker-end="url(#dot)" /> </svg> attributes markerheight this attribute defines the height of the marker viewport.
... value type: auto|auto-start-reverse|<angle> ; default value: 0; animatable: yes preserveaspectratio this attribute defines how the svg fragment must be deformed if it is embedded in a container with a different aspect ratio.
Content Scripts - Archive of obsolete content
it takes one of: "start": load the scripts immediately after the document element for the page is inserted into the dom.
...for example, here's an add-on that tries to add a click handler by assignment to window.onclick: var myscript = "window.onclick = function() {" + " console.log('unsafewindow.onclick: ' + window.document.title);" + "}"; require("sdk/page-mod").pagemod({ include: "*", contentscript: myscript, contentscriptwhen: "start" }); this will work fine on most pages, but will fail on pages which also assign to onclick: <html> <head> </head> <body> <script> window.onclick = function() { window.alert("it's my click now!"); } </script> </body> </html> for these reasons, it's better to add event listeners using addeventlistener(), defining the listener as a function: var themessage = "hello...
...by supplying a listener to attach you can access the port object for content scripts attached to that page by this page-mod: // main.js var pagemods = require("sdk/page-mod"); var self = require("sdk/self"); var pagemod = pagemods.pagemod({ include: ['*'], contentscriptfile: self.data.url("content-script.js"), onattach: startlistening }); function startlistening(worker) { worker.port.on('click', function(html) { worker.port.emit('warning', 'do not click this again'); }); } // content-script.js window.addeventlistener('click', function(event) { self.port.emit('click', event.target.tostring()); event.stoppropagation(); event.preventdefault(); }, false); self.port.on('warning', function(message) { win...
SDK and XUL Comparison - Archive of obsolete content
restartlessness add-ons built with the sdk can be installed without having to restart firefox.
... although you can write traditional add-ons that are restartless, you can't use xul overlays in them, so most traditional add-ons would have to be substantially rewritten anyway.
... mobile support starting in sdk 1.5, we've added experimental support for developing add-ons on the new native version of firefox mobile.
simple-storage - Archive of obsolete content
lets an add-on store data so that it's retained across firefox restarts.
...you may also need to include the --no-copy option to prevent firefox from copying the profile to a temporarry directory each time it starts.
... ss.storage.pages = []; require("sdk/tabs").on("ready", function(tab) { ss.storage.pages.push(tab.url); }); require("sdk/ui/button/action").actionbutton({ id: "read", label: "read", icon: "./read.png", onclick: function() { console.log(ss.storage.pages); } }); but this isn't going to work, because it empties the array each time the add-on runs (for example, each time firefox is started).
widget - Archive of obsolete content
this may take one of the following values: "start": load content scripts immediately after the document element for the widget is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the widget has been loaded, at the time the window.o...
...this may have one of the following values: "start": load content scripts immediately after the document element for the widget is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the widget has been loaded, at the time the window.onload ev...
...this may have one of the following values: "start": load content scripts immediately after the document element for the widget view is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the widget view has been loaded, at the time the window...
remote/parent - Archive of obsolete content
the module loads asynchronously but you can start sending messages to the module immediately.
...listen to attach and detach events to hear as processes are started and stopped: const { processes } = require("sdk/remote/parent"); processes.on("attach", function(process) { console.log("new process is remote: " + process.isremote); }); methods forevery(callback) calls the callback for every existing process and any new processes created in the future.
... events attach event emitted when a new process is started.
test/httpd - Archive of obsolete content
usage the most basic usage is: var { startserverasync } = require("sdk/test/httpd"); var srv = startserverasync(port, basepath); require("sdk/system/unload").when(function cleanup() { srv.stop(function() { // you should continue execution from this point.
... }) }); this starts a server in background (assuming you're running this code in an application that has an event loop, such as firefox).
... you can also use nshttpserver to start the server manually: var { nshttpserver } = require("sdk/test/httpd"); var srv = new nshttpserver(); // further documentation on developer.mozilla.org see http server for unit tests for general information.
cfx - Archive of obsolete content
there are four supported cfx commands: cfx init create a skeleton add-on as a starting point for your own add-on.
... this command will create an skeleton add-on, as a starting point for your own add-on development, with the following file structure: my-addon data docs main.md lib main.js package.json readme.md tests test-main.js cfx run this command is used to run the add-on.
...if package.json exists, cfx will load the corresponding add-on, load from the tests directory any modules that start with the word test- and run the unit tests they contain.
console - Archive of obsolete content
if you have started firefox for your add-on from the command line with jpm run or jpm test then these messages appear in the command shell you used.
... console.log(object[, object, ...]) logs the arguments to the console, preceded by "info:" and the name of your add-on: console.log("this is an informational message"); info: my-addon: this is an informational message console.time(name) starts a timer with a name specified as an input parameter.
... console.timeend(name) stops the specified timer and logs the elapsed time in seconds since its start.
Developing for Firefox Mobile - Archive of obsolete content
then type: adb devices you should see some output like: list of devices attached 51800f220f01564 device (the long hex string will be different.) if you do, then adb has found your device and you can get started.
...then execute jpm-mobile run with some extra options: jpm-mobile run --adb /path/to/adb in the command shell, you should see something like: launching mobile application with intent name org.mozilla.fennec pushing the addon to your device starting: intent { act=android.activity.main cmp=org.mozilla.fennec/.app (has extras) } --------- beginning of /dev/log/main --------- beginning of /dev/log/system could not read chrome manifest 'file:///data/data/org.mozilla.fennec/chrome.manifest'.
... info: starting info: starting zerdatime 1329258528988 - browser chrome startup finished.
Progress Listeners - Archive of obsolete content
example create an object which implements nsiwebprogresslistener: const state_start = ci.nsiwebprogresslistener.state_start; const state_stop = ci.nsiwebprogresslistener.state_stop; var mylistener = { queryinterface: xpcomutils.generateqi(["nsiwebprogresslistener", "nsisupportsweakreference"]), onstatechange: function(awebprogress, arequest, aflag, astatus) { // if you use mylistener for more than one tab/window, use ...
... // awebprogress.domwindow to obtain the tab/window which triggers the state change if (aflag & state_start) { // this fires when the load event is initiated } if (aflag & state_stop) { // this fires when the load finishes } }, onlocationchange: function(aprogress, arequest, auri) { // this fires when the location bar changes; that is load event is confirmed // or when the user switches tabs.
... gecko 2.0 note starting in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), all events are optional.
Extension Versioning, Update and Compatibility - Archive of obsolete content
note: starting in gecko 2.0, the automatic add-on update process properly supports cases in which the add-on's guid changes by uninstalling the old version and then installing the new one.
...the hashing algorithm used is put at the start of the string and separated from the hash by a :.
... <em:updatehash>sha256:78fc1d2887eda35b4ad2e3a0b60120ca271ce6e64ad2e3a0b60120ca271ce6e6</em:updatehash> note: the value of updatehash, must start with the string of hashing algorithm, it is a common error to delete this prefix, when setting new value to updatehash:sha256:78fc1d2887eda35b4ad2e3a0b60120ca271ce6e64ad2e3a0b60120ca271ce6e6 when a hash is specified the downloaded file is compared with the hash and an error shown if it does not match.
Install Manifests - Archive of obsolete content
gecko 1.9.2 note starting in gecko 1.9.2 (firefox 3.6), you can also simply include your icon, named icon.png, in the base directory of the add-on.
... gecko 2.0 note starting in gecko 2.0 (firefox 4.0), you can also simply include your icon, named icon64.png, in the base directory of the add-on.
... note: starting in gecko 11.0, applications such as firefox will assume add-ons that have not been updated in a very long time are no longer compatible by default.
Appendix: What you should know about open-source software licenses - Archive of obsolete content
most attempts at explaining open source start with the gpl.
...so instead, i’m going to start with the simplest, the modified bsd license.
...it is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.
Intercepting Page Loads - Archive of obsolete content
we will start with the simplest one, which is also the most common to use.
...in this case, your best bet is to use onstatechange, and filter to when the state flags indicate a document has begun being loaded: if ((astateflags & components.interfaces.nsiwebprogresslistener.state_start) && (astateflags & components.interfaces.nsiwebprogresslistener.state_is_document)) note the use of the binary mask & operator.
... as with all other solutions, you need to be efficient, and a good way to do this is to filter out unneeded cases right from the start.
Promises - Archive of obsolete content
let list = yield downloads.getlist(downloads.all); list.add(download_2); // start the second download, and wait for both // downloads to complete.
... yield promise.all([download_1, download_2.start()]); // do something with the saved files.
... let db = yield sqlite.openconnection({ path: database_path }); try { // start a transaction to insert the data.
Creating a dynamic status bar extension - Archive of obsolete content
we use the window.addeventlistener() dom function to tell firefox to call the stockwatcher.startup() function when a new browser window is opened: window.addeventlistener("load", function(e) { stockwatcher.startup(); }, false); our new extension has two primary functions: startup() and refreshinformation().
...startup() the startup() function is called when a new browser window is opened.
... we end up reloading data from each of the windows once in 10 minutes - fixing this by creating a js component responsible for communication with the server is a good idea for one of the future articles startup: function() { this.refreshinformation(); window.setinterval(this.refreshinformation, 10*60*1000); }, this starts by calling our refreshinformation() function, which is responsible for fetching and displaying stock ticker information in the status bar panel.
Creating a status bar extension - Archive of obsolete content
some of the samples in this series may be similar to samples you've seen elsewhere, but the goal of this series of articles is to help compile information for new extension developers into one place to make it easy to jump in and get started.
...starting with firefox 1.5, however, you should use a string in the form extension-name@creator-domain.
...then restart firefox, and you should see the extension in the status bar.
Monitoring WiFi access points - Archive of obsolete content
ner) || iid.equals(components.interfaces.nsisupports)) return this; throw components.results.ns_error_no_interface; }, } netscape.security.privilegemanager.enableprivilege('universalxpconnect'); var listener = new test(); var wifi_service = components.classes["@mozilla.org/wifi/monitor;1"].getservice(components.interfaces.nsiwifimonitor); wifi_service.startwatching(listener); </script> </head> <body> <div id="d"><p></p></div> <div id="c"><p></p></div> </body> </html> the nsiwifilistener object the first thing the code above does is to prototype the listener object that will be receiving notifications of changes to the access point list.
...starting to monitor access points to start monitoring the access points, we instantiate the listener (on line 44), then get access to the wifi monitor interface on line 45.
... the monitoring is started up on line 47, by calling the wifi monitoring service's startwatching() method.
How Thunderbird and Firefox find their configuration files - Archive of obsolete content
all other files in that directory are dynamically created by mozilla on first start.
...here is an example of what this may look like: [general] startwithlastprofile=1 [profile0] name=default isrelative=1 path=profiles/default.uda if you want to point this to a location of your choice (for example h:\thunderbird), you need to perform to changes: set isrelative to be 0 update the path to point to the desired place.
...you'd obtain a file such as the following: [general] startwithlastprofile=1 [profile0] name=default isrelative=0 path=h:\thunderbird a discussion about this file can be found here ...
Download Manager preferences - Archive of obsolete content
browser.download.manager.focuswhenstarting a boolean value that indicates whether or not to focus the download manager window when a download begins.
...0 indicates that the downloads should be paused and resumed automatically the next time firefox is run; 1 indicates that the downloads should be paused but will not automatically resume when the application is restarted; and 2 indicates that the downloads will be canceled on quit.
... browser.download.manager.showwhenstarting a boolean value that indicates whether or not to show the downloads window when a download begins.
GRE - Archive of obsolete content
dynamically link to that gre using the xpcomgluestartup() function.
... dependent libraries and environment variables the xulrunner gre is designed so that the embedder does not need to set any environment variables such as path or ld_library_path before calling xpcomgluestartup(), because it dynamically loads the correct dependent libraries.
...embedders will need to set the ld_library_path environment variable and start a new process in order to embed a suite-based gre correctly.
Helper Apps (and a bit of Save As) - Archive of obsolete content
four primary tasks: sets up temporary file and instantiate the nsihelperapplauncherdialog in onstartrequest.
... nsexternalapphandler::onstartrequest creates a temporary file with a salted name to hold the data.
...checks happen in onstartrequest, in the helper app dialog, and as a last ditch in the launching code.
Nanojit - Archive of obsolete content
out.ins0(lir_start); lins *two = out.insimm(2); lins *firstparam = out.insparam(0, 0); lins *result = out.ins2(lir_add, firstparam, two); out.ins1(lir_ret, result); // emit a lir_loop instruction.
... out.ins0(lir_start); lins *two = out.insimm(2); lins *firstparam = out.insparam(0, 0); lins *result = out.ins2(lir_add, firstparam, two); out.ins1(lir_ret, result); basically, what the code provided above is doing is feeding raw lir into the lir buffer, using the lirwriter's writer object.
...(typedef js_fastcall int32_t (*addtwofn)(int32_t); ) then, printf is hardcoded to call it with a parameter 5, and on linking with nanojit library, the following program will display 2+5=7 now, what i need to do is generate output for this: start two = int 2 twoplustwo = add two, two ret twoplustwo this adds two and two in the most hardcoded way possible.
Table Cellmap - Archive of obsolete content
79 // this union relies on the assumption that an object (not primitive type) does 80 // not start on an odd bit boundary.
... insertrowsbefore firstrow=0 ***start table dump*** mcolwidths= row(0)=02763344 cell(0)=02763528 cell(0)=0276381c row(0)=02763940 cell(0)=02763990 cell(0)=02763ab4 ***** start table cell map dump ***** 023566b0 cols array orig/span-> 023566b0 ***** start group cell map dump ***** 023565b0 maprowcount=0 tablerowcount=0 ***** end group cell map dump ***** ***** end table cell map dump ***** ***end table dump*** insertrowsafter *...
...**start table dump*** mcolwidths=-1 -1 row(0)=02763344 cell(0)=02763528 cell(1)=0276381c row(1)=02763940 cell(0)=02763990 cell(1)=02763ab4 ***** start table cell map dump ***** 023566b0 cols array orig/span-> 023566b00=2/0 1=2/0 ***** start group cell map dump ***** 023565b0 maprowcount=2 tablerowcount=2 row 0 : c0,0 c0,1 row 1 : c1,0 c1,1 c0,0=02763528(0) c0,1=0276381c(1) c1,0=02763990(0) c1,1=02763ab4(1) ***** end group cell map dump ***** ***** end table cell map dump ***** ***end table dump*** structural information one can imagine the cellmap as grid with equally wide rows and columns where the table cells are drawn.
Actionscript Acceptance Tests - Archive of obsolete content
testname.as.asc_args this file specifies additional arguments to pass to asc when compiling the test: # asc args for file # two modes are available: # override| all command line arguments (except builtin.py) are ignored and replaced by these # merge| merge these args in with the current args # specifiy an arg that starts with -no will disable the arg...
... any avm arguments can be placed before the |multiabc| directive, or the line can start with the directive.
... the underscore is necessary otherwise the buildbot system will delete the .abc before starting up a testrun (not an issue when running locally, but makes it easy to differentiate between binary-only abc files and generated abcs.
Install script template - Archive of obsolete content
rr = initinstall(software_name, plid, version); if (err != 0) { // call initinstall again in case illegal characters in plid err = initinstall(software_name, software_name, version); if (err != 0) cancelinstall(err); } //addfiles to current browser block var pluginsfolder = getfolder("plugins"); //verify disk space if(verifydiskspace(pluginsfolder, plugin_size+component_size)) { // start installing plugin shared library reseterror(); // install the plugin shared library to the current browser's plugin directory errblock1 = addfile (plid, version, plugin_file, pluginsfolder, null); if (errblock1!=0) { logcomment("could not add " + plugin_file + " to " + pluginsfolder + ":" + errblock1); cancelinstall(errblock1); } // start installing xpt file if this is a scriptabl...
...lse { // we have admin privileges to write to the win system directory // so we will set up dll and xpt in their new home errblock2 = addfile (plid, version, plugin_file, secondaryfolder, null); // something went wrong if errblock2 is not 0 if (errblock2!=0) { logcomment("could not add " + plugin_file + " to " + secondaryfolder + ":" + errblock2); return errblock2; } // start installing xpt file if this is a scriptable plugin errblock2 = addfile (plid, version, component_file, secondaryfolder, null); if (errblock2!=0) { logcomment("could not add " + component_file + " to " + secondaryfolder + ":" + errblock2); return errblock2; } } return 0; // 0 means everything went well with the secondary install } function writeplidsolution() { //concatenate th...
...ribing suffix **/ function registerplid(rootkey, plidpath, plidid, dllabsolutepath, xptabsolutepath, plugindescription, vendor, productname, pluginversion, mimetype, suffix, suffixdescription) { var myregstatus = 0; winreg = getwinregistry(); if (winreg == null) { logcomment("moz registerplid: winreg == null"); return winregisnullerror; } // which root to start from hklm, hkcu if (rootkey == hkey_local_machine) { logcomment("moz registerplid: rootkey=="+hkey_local_machine); winreg.setrootkey(winreg.hkey_local_machine); } else if (rootkey == hkey_current_user) { logcomment("moz registerplid: rootkey=="+hkey_current_user); winreg.setrootkey(winreg.hkey_current_user); } else { logcomment("moz registerplid: invalid rootkey, "+rootkey); r...
getFolder - Archive of obsolete content
urrent user" "defaults" "file:///" "os drive" "plugins" "preferences" "profile" "program" "temporary" "mac apple menu" "mac control panel" "mac desktop" "mac documents" "mac extension" "mac fonts" "mac shutdown" "mac startup" "mac system" "mac trash" "mac preferences" "macosx default download" "macosx home" "macosx internet sites" "macosx local applications" "macosx local desktop" "macosx local documents" "macosx local frameworks" "macosx local internet plugin" "macosx local pr...
...s" "macosx user internet plugin" "macosx user preferences" "unix lib" "unix local" "windows" "win appdata" "win common files" "win desktop" "win desktop common" "win program files" "win programs" "win programs common" "win startmenu" "win startmenu common" "win startup" "win startup common" "win system" the "file:///" form is only valid when the subdirectory parameter is used.
...the folders whose names start with "win", "mac", or "unix" are specific to those platforms.
Return Codes - Archive of obsolete content
restart the computer and the application to complete the installation process.
... on windows nt, you may only need to restart the application as long as you did not replace operating system files.
...e 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.
Providing Command-Line Options - Archive of obsolete content
using the example to use this sample code, save the commandline.js file into the components directory and add the following lines to your chrome.manifest file: component {2991c315-b871-42cd-b33f-bfee4fcbf682} components/commandline.js contract @mozilla.org/commandlinehandler/general-startup;1?type=myapp {2991c315-b871-42cd-b33f-bfee4fcbf682} category command-line-handler m-myapp @mozilla.org/commandlinehandler/general-startup;1?type=myapp the javascript code const cc = components.classes; const ci = components.interfaces; components.utils.import("resource://gre/modules/xpcomutils.jsm"); components.utils.import("resource://gre/modules/services.jsm"); // changeme: to the chrome...
... aargument); } // command line handler function commandlinehandler() { }; commandlinehandler.prototype = { classdescription: "myapphandler", // changeme: generate a unique id classid: components.id('{2991c315-b871-42cd-b33f-bfee4fcbf682}'), // changeme: change the type in the contractid to be unique to your application contractid: "@mozilla.org/commandlinehandler/general-startup;1?type=myapp", _xpcom_categories: [{ category: "command-line-handler", // changeme: // category names are sorted alphabetically.
... -viewapp on the command line."); } // changeme: change "myapp" to your command line flag (no argument) if (cmdline.handleflag("myapp", false)) { openwindow(chrome_uri, null); cmdline.preventdefault = true; } }, // changeme: change the help info as appropriate, but // follow the guidelines in nsicommandlinehandler.idl // specifically, flag descriptions should start at // character 24, and lines should be wrapped at // 72 characters with embedded newlines, // and finally, the string should end with a newline helpinfo : " -myapp open my application\n" + " -viewapp <uri> view and edit the uri in my application,\n" + " wrapping this description\n" }; var nsgetfactory = xpcomutils.gen...
Bindings - Archive of obsolete content
<query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/description" object="?description"/> </query> it works similarly to the previous triple.
...(?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/palace.jpg, ?title = 'palace from above') (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/canal.jpg, ?title = 'canal') (?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/obelisk.jpg, ?title = 'obelisk...
...(?start = http://www.xulplanet.com/rdf/myphotos, ?photo = http://www.xulplanet.com/ndeakin/images/t/palace.jpg, ?title = 'palace from above', ?description = 'view from the top of the tower looking east of the doges palace') thus, only one match exists, so only one set of content is generated.
Containment Properties - Archive of obsolete content
if the starting node (or ref) has that predicate as one of its triples in the rdf data, the builder will use it in addition to checking if it is a container.
...three generated via the use of the containment attribute, and two generated because the starting resource is a container with two children.
...<vbox datasources="template-guide-ex3.rdf" ref="http://www.xulplanet.com/rdf/a" containment="http://www.xulplanet.com/rdf/relateditem"> <template> <query> <content uri="?start"/> <member container="?start" child="?child"/> </query> <action> <label uri="?child" value="?child"/> </action> </template> </vbox> try this example.
Introduction - Archive of obsolete content
some rdf datasources are provided with mozilla -- their url's start with 'rdf:'.
...the rdf service starts the loading of the datasource in the background, and the template builder goes through the process of building content anyway.
...once some data starts arriving, the template builder scans its information to see if some results can be created.
Rule Compilation - Archive of obsolete content
datasources="http://www.xulplanet.com/ds/sample.rdf" ref="http://www.xulplanet.com/rdf/a" flex="1"> <template> <query> -- query content goes here -- </query> <rule> -- rule content goes here -- </rule> <rule> -- rule content goes here -- </rule> </template> </vbox> query/rule compilation and lazy content generation when the template builder starts processing, and after it has started the datasource loading, it first must compile the query and rules.
...for example, just calling the code like the following on the hidden vbox above will start off the template builder.
...when the template builder decides to start generation is determined automatically, and you don't need to do anything special to get this to happen.
Using Remote XUL - Archive of obsolete content
for apache, you can do this by adding the following line to your mime.types file: application/vnd.mozilla.xul+xml .xul alternately, add this line to your httpd.conf file or, if the apache server is configured to allow it, to the .htaccess file in the directory from which the xul file is served: addtype application/vnd.mozilla.xul+xml .xul then restart your web server.
... <?php header('content-type: application/vnd.mozilla.xul+xml'); ?> <!-- xul markup starts here --> note that you don't need a web server for this tutorial; you can load the document you create on your computer via a "file" url or the "open file" function of your browser.
...what we've built is just a start, however.
Window icons - Archive of obsolete content
starting with firefox 1.5, thunderbird 1.5, and xulrunner 1.8, you can specify an icon for a xul window by putting files named mywindow.ico (for windows) and mywindow.xpm or mywindow16.xpm (linux), where mywindow is the id of the <window> you want to attach the icon to, in the chrome/icons/default subfolder of your bundle.
... starting with firefox 3.0, xulrunner 3.0, thunderbird 3.0 and seamonkey 2.0 you can now specify png format icons instead of xpm format on linux.
... older versions to support older applications, such as firefox 1.0, you need to copy the icons to app_dir/chrome/icons/default manually on the first start (example code).
XUL Questions and Answers - Archive of obsolete content
specifying window.onload function to specify a function to run when the window is loaded,add the following code between the script tags in the xul file: window.addeventlistener("load", function(e) { startup(); }, false); similarly, for onunload use the code: window.addeventlistener("unload", function(e) { shutdown(); }, false); is there an event which is called when the firefox browser is initialized?
... an event is initiated when the application starts up and when the profile is changed.
...terfaces.nsiwebprogresslistener; listobj.queryinterface = function(aiid) { if (aiid.equals(listobj.wpl) || aiid.equals(components.interfaces.nsisupportsweakreference) || aiid.equals(components.interfaces.nsisupports)) return this; throw components.results.ns_nointerface; } listobj.onstatechange = function(aprogress, arequest, aflag, astatus) { if (aflag & listobj.wpl.state_start) { // this fires when the load event is initiated } else { if (aflag & listobj.wpl.state_stop) { if ( aflag & listobj.wpl.state_is_window ) { // this fires when all load finish } if ( aflag & listobj.wpl.state_is_network ) { // fires when all load are really over, // do something "final" here // (my two cents) } else { // t...
XUL accessibility guidelines - Archive of obsolete content
in a tabbed dialog, focus should normally start on the first control in the selected tab.
... in all other dialogs, focus should just start on the first control (although it can be on any other control if there is a good reason for, just not on the dialog itself).
... learn more accessible custom widgets accessible dhtml building accessible custom components in xul xul accessibility checklist use the following checklist to quickly verify the accessibility of a new xul application, or as a starting point for fixing accessibility problems in an existing one.
label - Archive of obsolete content
ArchiveMozillaXULlabel
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
... related elements description attributes label interfaces nsiaccessibleprovider, nsidomxullabelelement notes labels are not focusable note: starting in gecko 2.0, labels are properly not focusable.
menu - Archive of obsolete content
ArchiveMozillaXULmenu
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
...items are numbered starting at the first item displayed in the list.
menulist - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
...items are numbered starting at the first item displayed in the list.
preference - Archive of obsolete content
for example, the browser's home page is set with the preference browser.startup.homepage.
...for example, the browser's home page is set with the preference browser.startup.homepage.
... related preferences system documentation: introduction: getting started | examples | troubleshooting reference: prefwindow | prefpane | preferences | preference | xul attributes ...
Creating XULRunner Apps with the Mozilla Build System - Archive of obsolete content
in most cases, developers of xulrunner applications can download an existing sdk and follow the instructions in getting started with xulrunner.
...it tells mozilla where to look for the build.mk file, which is what tells it where to start building your app.
...the important ones are described in xulrunner:specifying startup chrome window.
How to enable locale switching in a XULRunner application - Archive of obsolete content
code to update the locale user preference and restart the application mozilla xulrunner doesn't allow runtime switching of the locale, therefore the application must be restarted to activate the new choice.
...it saves the new locale to the user application preferences (thereby overriding the default prefs.js above) and then asks xulrunner to restart.
... getservice(components.interfaces.nsiprefbranch); prefs.setcharpref("general.useragent.locale", newlocale); // restart application var appstartup = components.classes["@mozilla.org/toolkit/app-startup;1"] .getservice(components.interfaces.nsiappstartup); appstartup.quit(components.interfaces.nsiappstartup.erestart | components.interfaces.nsiappstartup.eattemptquit); } catch(err) { alert("couldn't change locale: " + err); } } * * * here i include a complete x...
Making sure your theme works with RTL locales - Archive of obsolete content
that means that text that had a left margin will have a right margin instead (or -moz-margin-start), arrows that pointed right will have to point left and vice versa, and so on.
... using start/end rules instead of left/right rules directions are mirrored in rtl mode, so left becomes right and right becomes left.
...instead, you should use the following start/end rules instead to ensure rtl compatibility: -moz-padding-start -moz-padding-end -moz-margin-start -moz-margin-end -moz-border-start -moz-border-start-color -moz-border-start-style -moz-border-start-width -moz-border-end -moz-border-end-color -moz-border-end-style -moz-border-end-width #urlbar-search-splitter { min-width: 8px; -moz-margin-start: -4px; border: none; background: transparent; } testing your theme testing your theme for rtl compatibility is easy, and you do not even have to go through the hassle of downloading a rtl locale.
Debug.msTraceAsyncCallbackCompleted - Archive of obsolete content
asyncoperationid must correspond to the operation id previously returned from debug.mstraceasyncoperationstarting.
... function asyncwrapperfunction() { var opid = debug.mstraceasyncoperationstarting('async trace'); dosomethingasync().then(function (result) { debug.mstraceasyncoperationcompleted(opid, debug.ms_async_op_status_success); debug.mstraceasynccallbackstarting(opid); // process result of async operation.
... }, function (error) { debug.mstraceasyncoperationcompleted(opid, debug.ms_async_op_status_error); debug.mstraceasynccallbackstarting(opid); }); debug.mstraceasynccallbackcompleted(); } function dosomethingasync() { return winjs.promise.as(true); } asyncwrapperfunction(); requirements supported in the internet explorer 11 standards document mode.
GetObject - Archive of obsolete content
for example: var cadobject; cadobject = getobject("c:\\cad\\schema.cad"); when this code is executed, the application associated with the specified pathname is started, and the object in the specified file is activated.
...you could use the following code to activate a layer within a drawing called schema.cad: var layerobject = getobject("c:\\cad\\schema.cad!layer3"); if you do not specify the object's class, automation determines which application to start and which object to activate, based on the file name you provide.
...if there is no current instance, and you don't want the object started with a file loaded, use the activexobject object.
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
we’ll start by taking a look at querying a sql database.
...om employee" ); // get the metadata from the resultset var meta = rs.getmetadata(); // loop over the records, dump out column names and values while( rs.next() ) { for( var i = 1; i <= meta.getcolumncount(); i++ ) { print( meta.getcolumnname( i ) + ": " + rs.getobject( i ) + "\n" ); } print( "----------\n" ); } // cleanup rs.close(); stmt.close(); conn.close(); this code starts off by using a rhino function named importpackage which is just like using the import statement in java.
... new ext.button({ text: "submit", fieldlabel: "", handler: formhandler }); // create the form panel, attach the inputs form_comments = new ext.form.formpanel({ labelalign: "right", width: 400, title: "comments", items: [ txt_name, txt_email, txt_message, btn_comments ], renderto: "form-comments" }); }); </script> the code in listing 6 starts by hooking in the ext js library which is used to produce the ui elements of the form.
Developing Mozilla XForms - Archive of obsolete content
debugging always start with a debug build of the xforms and the schema-validation extensions.
...then start firefox out of the build directory: cd obj-*/dist/firefox ./firefox -no-remote -jsconsole -p yourprofilename the xforms extension that was built together with firefox should be already installed.
...often you'll find the first starting points here or in the error console.
XUL Parser in Python - Archive of obsolete content
at the middle of it is a subclass of the xmllib parser that overrides that parser's unknown_starttag method and asks it to do all the work.
... the unknown_starttag handler is fed the tag name, the attributes of that tag, and the attributes' values, so all you have to do as you hit each xul element is build up a nested dictionary of elements and their associated attributes.
...but mozilla's upcoming support for languages like perl and python will really open up the mozilla platform to tools and approaches of this kind--and make now a good time to start thinking about how these various technologies will be put together.
Game promotion - Game development
many great games get started as a quick, sloppy demo submitted to a competition.
... manakeep is a website builder made for indie game developers and provides a great starting point to create your website.
...this big list of youtubers is a great place to start.
Implementing game control mechanisms - Game development
setting up the environment let's start with a quick overview of the game's folder structure, javascript files and in-game states, so we know what's happening where.
...the first one is needed for preloading required assets, create() is executed once the state had started, and update() is executed on every frame.
...} it will be created once at the start of the game, and will execute this.clickenclave() action assigned to it when clicked, but you can also use the mouse's pointer value in the update() function to make an action: update: function() { // ...
Bounce off the walls - Game development
we need to check, on every frame, whether the ball is touching the top edge of the canvas — if yes, we'll reverse the ball movement so it will start to move in the opposite direction and stay within the visible boundaries.
... remembering that the coordinate system starts from the top left, we can come up with something like this: if(y + dy < 0) { dy = -dy; } if the y value of the ball position is lower than zero, change the direction of the movement on the y axis by setting it equal to itself, reversed.
... the code above would deal with the ball bouncing off the top edge, so now let's think about the bottom edge: if(y + dy > canvas.height) { dy = -dy; } if the ball's y position is greater than the height of the canvas (remember that we count the y values from the top left, so the top edge starts at 0 and the bottom edge is at 320 pixels, the canvas' height), then bounce it off the bottom edge by reversing the y axis movement as before.
Animations and tweens - Game development
go to your ballhitbrick() function, find your brick.kill(); line, and replace it with the following: var killtween = game.add.tween(brick.scale); killtween.to({x:0,y:0}, 200, phaser.easing.linear.none); killtween.oncomplete.addonce(function(){ brick.kill(); }, this); killtween.start(); let's walk through this so you can see what's happening here: when defining a new tween you have to specify which property will be tweened — in our case, instead of hiding the bricks instantly when hit by the ball, we will make their width and height scale to zero, so they will nicely disappear.
... the last thing do to is to start the tween right away using start().
... that's the expanded version of the tween definition, but we can also use the shorthand syntax: game.add.tween(brick.scale).to({x:2,y:2}, 500, phaser.easing.elastic.out, true, 100); this tween will double the brick's scale in half a second using elastic easing, will start automatically, and have a delay of 100 miliseconds.
Visual JS GE - Game development
if you use editor.js to visually create game objects, you must start the build_from_editor_to_visual_js_file.js when you have finished.
... this tool will create visual.js in the starter/ directory along with all your game objects.
... after this has finished processing, restart the web page by entering the following in the console: resource.test_res.
Game development
the learning area is a good place to go to get started with the basics.
... to get started, see: about emscripten for an introduction including high-level details.
... emscripten tutorial for a tutorial to teach you how to get started.
Plug-in Development Overview - Gecko Plugin API Reference
the server looks for the mime type registered by a plug-in, based on the file extension, and starts sending the file to the browser.
... when it starts up, the browser checks for plug-in modules for the platform and registers them.
... starting in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7), you can get the origin of the document in a secure, convenient way by calling npn_getvalue() to retrieve the value of the variable npnvdocumentorigin.
CSS and JavaScript accessibility best practices - Learn web development
css let's start off by looking at css.
...as an example, you might want to make sure your main content area can handle bigger text (maybe it will start to scroll to allow it all to be seen), and won't just hide it, or break completely.
... in addition, the errorfield is placed at the top of the source order (although it is positioned differently in the ui using css), meaning that users can find out exactly what's wrong with their form submissions and get to the input elements in question by going back up to the start of the page.
Accessibility - Learn web development
to help you achieve this, this module will cover general best practices (which are demonstrated throughout the html, css, and javascript topics), cross browser testing, and some tips on enforcing accessibility from the start.
... get started prerequisites to get the most out of this module, it would be a good idea to either work through at least the first two modules of the html, css, and javascript topics, or perhaps even better, work through the relevant parts of the accessibility module as you work through the related technology topics.
... this article starts off the module with a good look at what accessibility is — this includes what groups of people we need to consider and why, what tools different people use to interact with the web, and how we can make accessibility part of our web development workflow.
Advanced styling effects - Learn web development
a simple box shadow let's look at a simple example to get things started.
... other box shadow features unlike text-shadow, box-shadow has an inset keyword available — putting this at the start of a shadow declaration causes it to become an inner shadow, rather than an outer shadow.
...mainly for browser compatibility — so many web developers have started implementing websites with -webkit- prefixes that it started to look like the other browsers were broken, whereas in actual fact they were following the standards.
Test your skills: Images and Form elements - Learn web development
for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the example as displayed in the image: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Test your skills: Overflow - Learn web development
try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the example as displayed in the image: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Attribute selectors - Learn web development
for example, if you had classes of box-warning and box-error and wanted to match everything that started with the string "box-", you could use [class^="box-"] to select them both (or [class|="box"] as described in section above).
... (aside: it may help to note that ^ and $ have long been used as anchors in so-called regular expressions to mean begins with and ends with.) the next example shows usage of these selectors: li[class^="a"] matches any attribute value which starts with a, so matches the first two list items.
... in the example below, the first selector will match a value that begins with a — it only matches the first list item because the other two list items start with an uppercase a.
Styling tables - Learn web development
a typical html table let's start by looking at a typical html table.
... to start with, make a local copy of the sample markup, download both images (noise and leopardskin), and put the three resulting files in a working directory somewhere on your local computer.
... start by adding the following css to your style.css file, again at the bottom: /* graphics and colors */ thead, tfoot { background: url(leopardskin.jpg); color: white; text-shadow: 1px 1px 1px black; } thead th, tfoot th, tfoot td { background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.5)); border: 3px solid purple; } again, there's nothing specific to tables here, but it ...
Test your skills: backgrounds and borders - Learn web development
try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... the finished example should look like the image below: try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
CSS values and units - Learn web development
it's worth understanding how these work, and the differences between them, especially when you start getting on to more complex subjects like styling text or css layout.
... to start with, we set 16px as the font size on the <html> element.
... note: at some point modern browsers were updated so that rgba() and rgb(), and hsl() and hsla() (see below), became pure aliases of each other and started to behave exactly the same.
CSS building blocks - Learn web development
get started prerequisites before starting this module, you should have: basic familiarity with using computers, and using the web passively (i.e.
... organizing your css as you start to work on larger stylesheets and big projects you will discover that maintaining a huge css file can be challenging.
... creating fancy letterheaded paper if you want to make the right impression, writing a letter on nice letterheaded paper can be a really good start.
Test your skills: position - Learn web development
for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Positioning - Learn web development
we'd like you to follow along with the exercises on your local computer, if possible — grab a copy of 0_basic-flow.html from our github repo (source code here) and use that as a starting point.
... introducing z-index all this absolute positioning is good fun, but there is another thing we haven't considered yet — when elements start to overlap, what determines which elements appear on top of which other elements?
...but we could improve this more — at the moment some of the content starts off underneath the heading.
Responsive design - Learn web development
as the mobile web started to become a reality with the first feature phones, companies who wished to embrace mobile would generally create a special mobile version of their site, with a different url (often something like m.example.com, or example.mobi).
... by using a flexible grid, you only need to add in a breakpoint and change the design at the point where the content starts to look bad.
... this meta tag exists because when the original iphone launched and people started to view websites on a small phone screen, most sites were not mobile optimized.
Using your new knowledge - Learn web development
starting point you can work in the live editor below, or you can download the starting point to work with in your own editor.
... this is a single page with the html, plus the starting point css in the head of the document.
... getting started with css how css is structured how css works using your new knowledge ...
CSS first steps - Learn web development
this module provides a gentle beginning to your path towards css mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to html.
... get started prerequisites before starting this module, you should have: basic familiarity with using computers, and using the web passively (i.e.
... getting started with css in this article we will take a simple html document and apply css to it, learning some practical things about the language along the way.
create fancy boxes - Learn web development
before we start getting into the practical side of it, make sure you are familiar with the css box model.
...it starts to get interesting when you push the properties to the limit by having negative padding and/or- margin by having border-radius larger than the actual size of the box.
...when you start fiddling with backgrounds it's like your css box is turned into a blank canvas you'll fill.
What text editors are available? - Learn web development
but we'll give you some pointers for getting started.
...as you saw when starting a new html document, many technologies use the same document structure over and over.
...in the most popular distros you can start with your graphical package manager (ubuntu software center, mintinstall, gnome software, &c.).
How much does it cost to do something on the Web? - Learn web development
to start, we suggest trying out several editors, to get a sense of which works best for you.
...most hosting providers give you a huge discount to start with.
... next steps now that you understand what kind of money your website may cost you, it's time to start designing that website and setting up your work environment.
What are browser developer tools? - Learn web development
note: before you run through the examples below, open the beginner's example site that we built during the getting started with the web article series.
... exploring the dom inspector for a start, right-click (ctrl-click) an html element in the dom inspector and look at the context menu.
... alert('hello!); document.cheeseselector('html').style.backgroundcolor = 'purple'; const mywordmark = document.createelement('img'); mybanana.setattribute('src','https://blog.mozilla.org/press/wp-content/themes/onemozilla/img/mozilla-wordmark.png'); document.queryselector('h1').appendchild(mywordmark); you'll start to see the kind of errors that the browser returns.
How do you set up a local testing server? - Learn web development
if the web address path starts with file:// followed by the path to the file on your local hard drive, a local file is being used.
... in contrast, if you view one of our examples hosted on github (or an example on some other remote server), the web address will start with http:// or https://, to show that the file has been received via http.
... enter the command to start up the server in that directory: # if python version returned above is 3.x python3 -m http.server # on windows try "python" instead of "python3", or "py -3" # if python version returned above is 2.x python -m simplehttpserver by default, this will run the contents of the directory on a local web server, on port 8000.
How to structure a web form - Learn web development
each time you want to create an html form, you must start it by using this element, nesting all the contents inside.
...for now, read the descriptions carefully as you follow the below instructions, and start to form an appreciation of which wrapper elements we are using to structure the form, and why.
... to start with, make a local copy of our blank template file and the css for our payment form in a new directory on your computer.
Other form controls - Learn web development
this is effectively the starting width, as it can be changed by resizing the <textarea>, and overriden using css.
...this is effectively the starting height, as it can be changed by resizing the <textarea>, and overriden using css.
...this is for implementing any kind of meter, for example a bar showing total space used on a disk, which turns red when it starts to get full.
Test your skills: HTML5 controls - Learn web development
create appropriate inputs for a user to update their details for: email website phone number favourite color try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Test your skills: Styling basics - Learn web development
note: you can try out solutions by editing the starting point file locally, however it may be helpful to put your code in an online tool such as codepen, jsfiddle, or glitch to work on the tasks.
... download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
UI pseudo-classes - Learn web development
for a start, we are signalling required versus optional status using color alone, which isn't great for colorblind people.
...nly and :read-write pseudo-classes, like so: input:-moz-read-only, textarea:-moz-read-only, input:read-only, textarea:read-only { border: 0; box-shadow: none; background-color: white; } textarea:-moz-read-write, textarea:read-write { box-shadow: inset 1px 1px 3px #ccc; border-radius: 5px; } firefox only supported these pseudo-classes with a prefix up to version 78; at which point it started to support the unprefixed version.
...this could be useful for adding an indicator to a list of options to remind the user what the defaults (or starting options) were, in case they want to reset their choices.
HTML basics - Learn web development
previous overview: getting started with the web next html (hypertext markup language) is the code that is used to structure a web page and its content.
...this states where the element begins or starts to take effect — in this case where the paragraph begins.
... previous overview: getting started with the web next in this module installing basic software what will your website look like?
How the Web works - Learn web development
previous overview: getting started with the web how the web works provides a simplified view of what happens when you view a webpage in a web browser on your computer or phone.
... this theory is not essential to writing web code in the short term, but before long you'll really start to benefit from understanding what's happening in the background.
...here it is", and then starts sending the website's files to the browser as a series of small chunks called data packets (the shop gives you your goods, and you bring them back to your house).
Document and website structure - Learn web development
prerequisites: basic html familiarity, as covered in getting started with html.
...we'll wait for this until you start to study css layout as part of the css topic.
... html layout elements in more detail it's good to understand the overall meaning of all the html sectioning elements in detail — this is something you'll work on gradually as you start to get more experience with web development.
Structuring a page of content - Learn web development
starting point to get this assessment started, you should go and grab the zip file containing all the starting assets.
... you need to add a suitable wrapper for: the header the navigation menu the main content the welcome text the image sidebar the footer you should also: apply the provided css to the page by adding another <link> element just below the existing one provided at the start.
... previous overview: introduction to html in this module getting started with html what’s in the head?
Test your skills: Advanced HTML text - Learn web development
try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
... try updating the live code below to recreate the finished example: download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Introduction to HTML - Learn web development
get started prerequisites before starting this module, you don't need any previous html knowledge, but you should have at least basic familiarity with using computers and using the web passively (i.e., just looking at it and consuming content).
...both are parts of our getting started with the web complete beginner's module.
... getting started with html covers the absolute basics of html, to get you started — we define elements, attributes, and other important terms, and show where they fit in the language.
Multimedia and Embedding - Learn web development
let's start looking at how to make the web come alive with more interesting content!
... get started prerequisites before starting this module, you should have a reasonable understanding of the basics of html, as previously covered in introduction to html.
... images in html there are other types of multimedia to consider, but it is logical to start with the humble <img> element used to embed a simple image in a webpage.
HTML table advanced features and accessibility - Learn web development
you'll learn more about this when you go through our css modules (introduction to css is a good place to start; we also have an article specifically on styling tables).
...if you look back at the "items sold august 2016" table at the start of this section of the article, you'll see that the "clothes" cell sits above the "trousers", "skirts", and "dresses" cells.
... finally, try making another copy of the starter files, and this time make the table more accessible using id and headers attributes.
General asynchronous programming concepts - Learn web development
each thread can only do a single task at once: task a --> task b --> task c each task will be run sequentially; a task has to complete before the next one can be started.
...if you start task a running and then immediately try to run task b, you'll get an error, because the image won't be available yet.
... we'll start to look at how we can write asynchronous code in the next article.
Making decisions in your code — conditionals - Learn web development
it starts with a test condition — select.value === 'black'.
...ner('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the...
...ner('load', updatecode); // stop tab key tabbing out of textarea and // make it write a tab at the caret position instead textarea.onkeydown = function(e){ if (e.keycode === 9) { e.preventdefault(); insertatcaret('\t'); } if (e.keycode === 27) { textarea.blur(); } }; function insertatcaret(text) { const scrollpos = textarea.scrolltop; const caretpos = textarea.selectionstart; const front = (textarea.value).substring(0, caretpos); const back = (textarea.value).substring(textarea.selectionend, textarea.value.length); textarea.value = front + text + back; caretpos = caretpos + text.length; textarea.selectionstart = caretpos; textarea.selectionend = caretpos; textarea.focus(); textarea.scrolltop = scrollpos; } // update the saved usercode every time the...
JavaScript First Steps - Learn web development
get started prerequisites before starting this module, you don't need any previous javascript knowledge, but you should have some familiarity with html and css.
... you are advised to work through the following modules before starting on javascript: getting started with the web (which includes a really basic javascript introduction).
... useful string methods now we've looked at the very basics of strings, let's move up a gear and start thinking about what useful operations we can do on strings with built-in methods, such as finding the length of a text string, joining and splitting strings, substituting one character in a string for another, and more.
JavaScript object basics - Learn web development
objective: to understand the basic theory behind object-oriented programming, how this relates to javascript ("most things are objects"), and how to start working with javascript objects.
...as you'll see in the object-oriented javascript for beginners article, when we start creating constructors and so on, this is very useful — it always ensures that the correct values are used when a member's context changes (for example, two different person object instances may have different names, but we want to use their own name when saying their greeting).
... in the next article we'll start to look at object-oriented programming (oop) theory, and how such techniques can be used in javascript.
JavaScript — Dynamic client-side scripting - Learn web development
get started prerequisites javascript is arguably more difficult to learn than related technologies such as html and css.
...start by working through the following modules: getting started with the web introduction to html introduction to css having previous experience with other programming languages might also help.
... client-side web apis when writing client-side javascript for web sites or applications, you won't go very far before you start to use apis — interfaces for manipulating different aspects of the browser and operating system the site is running on, or even data from other web sites or services.
What is web performance? - Learn web development
does the site load quickly, allow the user to start interacting with it quickly, and offer reassuring feedback if something is taking time to load (e.g.
... making the site usable as soon as possible: this basically means loading your web site assets in a sensible order so that the user can start to actually use it really quickly.
...the measurement of how long it takes the site to get to a usable start after it has started loading is called time to interactive.
Framework main features - Learn web development
at this point you can choose which framework you'd like to start learning first: react ember vue note: we only have three framework tutorial series available now, but we hope to have more available in the future.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new...
... todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Vue conditional rendering: editing existing todos - Learn web development
creating an editing component we can start by creating a separate component to handle the editing functionality.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer...
... functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Adding a new todo form: Vue events, methods, and models - Learn web development
our app is now starting to feel interactive, but one issue is that we've completely ignored its look and feel up to now.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer functionality, conditional rendering routing in ember ember resources and troubleshooting vue ...
... getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Rendering a list of Vue components - Learn web development
while we'll eventually add a mechanism to add new todo items, we can start with some mock to do items.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer...
... functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Vue resources - Learn web development
this is the best place to start learning vue in depth.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer...
... functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Styling Vue components with CSS - Learn web development
to start with, create a file called reset.css in the src/assets directory.
... previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer...
... functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Accessibility/LiveRegionDevGuide
the event.any_data field holds the entire text string while event.detail1 is the start index while event.detail2 is the text string length.
...when atomic is set to "false", the start index and end index/run length are used as given.
...in this case the start index is 0 and the end index/run length is the length of the text - 1.
Accessible Toolkit Checklist
in autocomplete text fields, make sure that the left or right arrow closes the popup and starts moving through the text letter by letter msaa support, including accessible value that holds text, protected for password fields and readonly for read-only fields checkboxes space bar to toggle msaa support, including checkbox state and statechange event sliders keyboard support for moving slider: arrow keys, home, end, pgup, pgdn msaa ...
...ue, value change events progress bars msaa support including accessible name, value, name and value change events grouped navigation widgets menus arrow keys, enter, escape alt alone enters main menu after leaving menus, focus is restored to where it was modified and unmodified mnemonics msaa support (including focus events, menu start and end events, radio and checkbox menu items) static text and group boxes msaa support radio groups only the selected radio button is in the tab order the other radio buttons can be selected and focused with up/down arrow.
... typing letter or several letters to navigate (same letter goes to each item starting with that, different letters go to first item starting with that entire string).
Frequently Asked Questions for Lightweight themes
start looking here for designs that fit your style.
...you can easily preview a design and install it without needing to restart.
...to get started read more about how to create a theme.
Creating Sandboxed HTTP Connections
introduction starting with gecko 1.8.1 (firefox 2), it is possible to create sandboxed http connections which don't affect the user's cookies.
... onstartrequest - gets called when a new request is initiated.
...ring, null, null); // get a channel for that nsiuri gchannel = ioservice.newchannelfromuri(uri); // get an listener var listener = new streamlistener(callbackfunc); gchannel.notificationcallbacks = listener; gchannel.asyncopen(listener, null); function streamlistener(acallbackfunc) { this.mcallbackfunc = acallbackfunc; } streamlistener.prototype = { mdata: "", // nsistreamlistener onstartrequest: function (arequest, acontext) { this.mdata = ""; }, ondataavailable: function (arequest, acontext, astream, asourceoffset, alength) { var scriptableinputstream = components.classes["@mozilla.org/scriptableinputstream;1"] .createinstance(components.interfaces.nsiscriptableinputstream); scriptableinputstream.init(astream); this.mdata += scriptableinputstr...
Capturing a minidump
if firefox is not already running, then open windbg from the start menu (start->all programs->debugging tools for windows->windbg).
... if firefox is already running, open windbg from the start menu (start->all programs->debugging tools for windows->windbg).
...from the menu, select debug → go, and firefox should start.
Debugging Frame Reflow
it provides the following information for each frame at the start of its reflow reflow reason available width, available height computed width, computed height the previous and the next frame in flow and a count number.
...the second table reflow is started at rowg 00b984a4 r=2 a=1500,uc c=1500,uc cnt=879 where the previous information is used.
...the reflow finishes at the same level where it started.
Debugging JavaScript
you can also start the browser console when you launch firefox, by launching firefox from the command line and passing --jsconsole as a flag: /path/to/firefox --jsconsole log to the browser console using the standard console api after importing console.jsm: let console = (cu.import("resource://gre/modules/console.jsm", {})).console; console.log("hello from firefox code"); error console this is obsolete and is ...
... go to about:config and set the following two prefs: devtools.chrome.enabled: true devtools.debugger.remote-enabled: true after you restart the browser, you can access the browser debugger through tools > web developer > browser toolbox.
... under microsoft windows you additionally need to start firefox via the following command to have a native console : firefox.exe -console using normal javascript object inspection, you can write a function that dumps a whole object, similar to this ddumpobject().
How Mozilla's build system works
config.status starts with the main moz.build file and then recurses into all referenced files and directories.
...make starts processing the makefile in the root directory and then recursively descends into child directories until it's done.
... when make is invoked, it starts at the export sub-tier of the first tier, and traverses all the directories in that tier.
Simple Thunderbird build
to also build lightning when building thunderbird (deprecated) note: the lightning calendar add-on was integrated into thunderbird starting with version 74.
... add the following line to your mozconfig file: ac_add_options --enable-calendar to add that line you can do this in the source/ directory: echo 'ac_add_options --enable-calendar' >> mozconfig building before you start, make sure that the version you checked out is not busted.
... for hg tip, you should see green bs on https://treeherder.mozilla.org/#/jobs?repo=comm-central to start the build, cd into the source directory, and run: ./mach build mach is our command-line tool to streamline common developer tasks.
Windows SDK versions
quick start follow the instructions for whichever version of visual c++ you're using.
... restart the msys console.
... delete your entire object directory and start over.
pymake
for example: instead of make -f client.mk to start a build, you would type python build/pymake/make.py -f client.mk.
... type touch .profile using any appropriate text editor open .profile and add the following line in the file (assuming your mozilla-central is at c:/mozilla-central, if not, adjust your path accordingly.) alias pymake=c:/mozilla-central/build/pymake/make.py save your .profile edit and close the shell, then restart the shell.
... this should come back with "no makefile found." if it does, your pymake alias is connected and you are ready to type in pymake -f client.mk to start the build.
mozbrowserscrollviewchange
apcz) starts or stops.
... details the details property returns an anonymous javascript object with the following properties: state a domstring representing the current state of scrolling in the viewport — available values are started and stopped.
... example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserscrollviewchange", function( event ) { console.log("scrolling has " + event.details.state + "."); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
Browser API
mozbrowseraudioplaybackchange sent when audio starts or stops playing within the browser <iframe> content.
... mozbrowserloadstart sent when the browser <iframe> starts to load a new page.
...apcz) starts or stops.
Roll your own browser: An embedding how-to
it should include all of the base support that you need to get a web browser started up.
... somewhere during the start of your application, you must initialize xpcom.
... other initialization must be done to start up event queues and load some string bundles.
How to get a stacktrace for a bug report
a stacktrace will tell mozilla developers what crashed and provide a starting point for investigating its cause.
...be sure that you check the "tell mozilla about this crash" checkbox and click the restart button.
... you can prefix a "bp-" to the beginning of an id to make bugzilla turn it into a link: bp-a70759c6-1295-4160-aa30-bc4772090918 how to get the crash id if firefox crashes on startup if firefox crashes on startup you can still access your submitted crash reports.
How to Report a Hung Firefox
please check the box to send the crash report to mozilla start firefox.
...please check the box to send the crash report to mozilla start firefox.
...please check the box to send the crash report to mozilla start firefox.
AddonInstall
once you have an instance the install() method is used to start automatic download and installation.
... methods install() starts or continues the install process.
... void install( ) cancel() cancels the install process, it cannot be restarted after this.
Add-on Manager
detecting add-on changes requires gecko 7.0(firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) you can also get lists of add-ons that, at startup, were changed in various ways.
... the getstartupchanges() method lets you find out which add-ons were installed, removed, updated, enabled, or disabled at application startup.
... for example, to take a look at the add-ons that were disabled at startup: components.utils.import("resource://gre/modules/addonmanager.jsm"); let addonids = addonmanager.getstartupchanges(addonmanager.startup_change_disabled); if (addonids.length > 0) { // addonids is now an array of the add-on ids that have been disabled alert("note: " + addonids.length + " add-ons have been disabled."); } open add-on manager tab the add-on manager tab can be opened programatically with the function browseropenaddonsmgr which is available on chrome window of "navigator:browser" type.
PerfMeasurement.jsm
method overview static bool canmeasuresomething(); void reset(); void start(); void stop(); member fields recorded data variables these variables provide access to the recorded data.
...start() starts measuring the performance indicators that were specified when the perfmeasurement object was created.
... void start(); parameters none.
Index
12 localization quick start guide guide, translation this guide is filled with all of the basic, technical information you need to get involved in the mozilla l10n program.
... 27 localizing without a specialized tool from the create a new localization document, an interested localizer can follow a technical step-by-step process that starts the localization process by focusing on how to localize two of the primary types of localization files (dtd and properties) used in the mozilla source code.
...first things first, we need to give you a brief introduction to what svn is and where you can find the necessary tools to get started.
Localizing with Mozilla Translator
getting started with mozillatranslator mt uses products as groups of localization files with a common root directory (for instance, you may have a product for thunderbird, other for seamonkey, other for dom, other for toolkit, etc.) you update your repository copy using your favorite repository tool, and then update the product(s) in mt.
... if you are starting a new localization, all strings will be marked as new or updated.mt puts a fuzzy flag on each flag and saves it in its database.
...now, you want to start working directly on mozilla-central (and l10n-central).
Creating localizable web applications
*/), or one line directly above the gettext function call (block comments, in php they start with # ...
...when extracting strings with xgettext you will be able to include only comments starting with this prefix using the --add-comments=prefix option, for example xgettext --add-comments=l10n.
...px; padding: 6px 6px 6px 10px; } .button .arrow { background: transparent url(../img/main-sprites.png) no-repeat scroll -651px 1px; padding: 6px 15px; } html[dir='rtl'] .button .arrow { /* flip the arrow to point to the left*/ background: transparent url(../img/main-sprites.png) no-repeat scroll -601px 1px; } html/php: <button type="submit" class="button"><span><?= _('get started'); ?></span><span class="arrow"></span></button> don't put captions in the images image 1.
Mozilla Development Strategies
if you have problems finding smaller, easier bugs to work on, start by looking for crashers.
... if you're working on something massive, start a branch if you are working on something big, and you want to be able to check in incrementally without getting reviews, create a branch.
... here's how to create a branch: from your linux or mac os x box: # start from your trunk tree on your local disk cd mozilla find .
Mozilla Quirks Mode Behavior
obsolete since gecko 10.0 however, html5 requires this behavior, and starting in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7), this also works in standards mode (bug 80784, bug 93077).
...[see nstableframe::getdeflationforbackground and figure out what really differs, and when it started differing.] gecko had bug 248239, where table cells acted as they had box-sizing:border-box applied for the purpose of the height property.
... html parser in quirks mode, we parsed html comments in a non-sgml way compatible with other browsers instead of treating "--" as the comment start and end delimiter.
Investigating leaks using DMD heap scan mode
with that command line in hand, you can start firefox.
... once it has started, go through the steps you need to reproduce your leak.
... caveat: i think block_analyzer.py does not attempt to clamp the address you pass into it, so if it is an offset from the start of the block, it won’t find it.
Leak-hunting strategies and tips
a good general pattern for finding and fixing leaks is to start with a task that you want not to leak (for example, reading email).
... start finding and fixing leaks by running part of the task under nstracerefcnt logging, gradually building up from as little as possible to the complete task, and fixing most of the leaks in the first steps before adding additional steps.
...seeing a leaked globalwindowimpl, nsxulpdglobalobject, nsxbldocglobalobject, or nsxpcwrappedjs is a sign that there could be significant numbers of js objects leaked.) for example, start with bringing up the mail window and closing the window without doing anything.
Measuring performance using the PerfMeasurement.jsm code module
it doesn't, however, start to record data.
... now we want to benchmark a function that is pretty fast (but not fast enough), so we run it several thousand times: for (let i = 0; i < 10000; i++) { set_up_some_state(); monitor.start(); code_to_be_benchmarked(); monitor.stop(); clean_up_afterward(); } we call the perfmeasurement object's start() method when we want to start recording, and stop() when we want to stop recording.
... the monitor object automatically accumulates counts over start/stop cycles (that is, it doesn't automatically zero the counters each time you start recording).
Profile Manager
starting profile manager to start profile manager, just launch profilemanager.exe (on windows) or profilemanager-bin (on linux and mac).
... a dialog will appear that allows you to specify the profile's name, and optionally the profile's path, and the version of firefox (or other application) that will be used with this profile: launching firefox with a profile to launch firefox with a specific profile, select the profile in the main window, and hit the "start firefox" button: firefox will be launched with that profile, and profile manager will terminate.
... launch option command line argument run firefox in offline mode -offline run firefox in safe mode -safe-mode start firefox with a console -console start new instance -no-remote note: it isn't possible to start a second instance of firefox without passing it the -no-remote command line argument.
Leak And Bloat Tests
startup main mail window open address book and message composition windows close address book and message composition windows quit the application future improvements will be discussed on the discussion page of the mozilla wiki.
..."local folders"); user_pref("mail.server.server1.type", "none"); user_pref("mail.server.server1.username", "nobody"); user_pref("mail.server.server2.check_new_mail", false); user_pref("mail.server.server2.directory-rel", "[profd]mail/tinderbox"); user_pref("mail.server.server2.download_on_biff", true); user_pref("mail.server.server2.hostname", "tinderbox"); user_pref("mail.server.server2.login_at_startup", false); user_pref("mail.server.server2.name", "tinderbox@invalid.com"); user_pref("mail.server.server2.type", "pop3"); user_pref("mail.server.server2.username", "tinderbox"); user_pref("mail.smtp.defaultserver", "smtp1"); user_pref("mail.smtpserver.smtp1.hostname", "tinderbox"); user_pref("mail.smtpserver.smtp1.username", "tinderbox"); user_pref("mail.smtpservers", "smtp1"); user_pref("mail.s...
...tartup.enabledmailcheckonce", true); user_pref("mailnews.start_page_override.mstone", "1.9pre"); user_pref("mail.shell.checkdefaultclient", false); // ensure os x and outlook/oe books are disabled user_pref("ldap_2.servers.osx.position", 0); user_pref("ldap_2.servers.oe.position", 0); preferences in generated profile, but not set: user_pref("mail.root.none", "/home/moztest/.thunderbird/t7i1txfw.minimum/mail"); user_pref("mail.root.pop3", "/home/moztest/.thunderbird/t7i1txfw.minimum/mail"); user_pref("mail.server.server1.directory", "/home/moztest/.thunderbird/t7i1txfw.minimum/mail/local folders"); user_pref("mail.server.server2.directory", "/home/moztest/.thunderbird/t7i1txfw.minimum/mail/tinderbox"); user_pref("mail.attachment.store.version", 1); user_pref("mail.folder.views.version", 1); use...
PR_CreateThread
syntax #include <prthread.h> prthread* pr_createthread( prthreadtype type, void (*start)(void *arg), void *arg, prthreadpriority priority, prthreadscope scope, prthreadstate state, pruint32 stacksize); parameters pr_createthread has the following parameters: type specifies that the thread is either a user thread (pr_user_thread) or a system thread (pr_system_thread).
... start a pointer to the thread's root function, which is called as the root of the new thread.
... description if you want the thread to start up waiting for the creator to do something, enter a lock before creating the thread and then have the thread's root function enter and exit the same lock.
PR_MemMap
offset the starting offset of the section of file to be mapped.
... returns the starting address of the memory region to which the section of file is mapped.
...the section of the file starts at offset and has the length len.
An overview of NSS Internals
this is particularly important for applications that might need to close a database and reinitialize nss using a different one, without restarting.
...an arena is requested once processing of a task starts, and all memory allocations that are logically associated to that task are requested from the associated arena.
...new certificate authorities enter the global pki market, and in order to get started with their business, they might make deals with established cas and receive so-called cross-signing-certificates.
Rhino scopes and contexts
in general, variables are looked up by starting at the current variable object (which is different depending on what code is being executed in the program), traversing its prototype chain, and then traversing the parent chain.
...when we start executing f, the scope chain will start with the function's activation object and will end with the top-level scope (see diagram below).
...when rhino looks up a variable, it starts in the current scope, walks the prototype chain, then goes to the parent scope and its prototype chain, until there are no more parent scopes left.
Scripting Java
one example of this is the thread class: its constructor takes a runnable that contains a single method run that will be called when the new thread is started.
... js> t = new java.lang.thread(r) thread[thread-2,5,main] js> t.start() js> running the final js prompt and the output from the new thread may appear in either order, depending on thread scheduling.
... here is the simplified runnable example: js> t = java.lang.thread(function () { print("\nrunning"); }); thread[thread-0,5,main] js> t.start() js> running rhino also allows use of javascript functions as implementations of java interfaces with more than one method if all the methods have the same signature.
SpiderMonkey Build Documentation
xecutables." you can try configuring like so: cc=clang cxx=clang++ ../configure it is also possible that baldrdash may fail to compile with /usr/local/cellar/llvm/7.0.1/lib/clang/7.0.1/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found /usr/local/cellar/llvm/7.0.1/lib/clang/7.0.1/include/inttypes.h:30:15: fatal error: 'inttypes.h' file not found, err: true this is because, starting from mohave, headers are no longer installed in /usr/include.
...start-shell-msvc2013.bat or start-shell-msvc2013-x64.bat) determines whether the compiler toolchain will target 32-bit or 64-bit builds.
...mac os x 10.5), you can use the following: ar=ar cc="gcc -m64" cxx="g++ -m64" ../configure --target=x86_64-apple-darwin10.0.0 to build a 64-bit windows version, you can use the following: $src/configure --host=x86_64-pc-mingw32 --target=x86_64-pc-mingw32 note: you must have started your mozillabuild shell with the proper -x64.bat script in order for the 64-bit compilers to be in your path.
Index
the new string contains the same characters as if it were created with the javascript method str.substr(start, length).
... 416 js_newucstring jsapi reference, spidermonkey js_newstring creates and returns a new string, using the memory starting at buf and ending at buf + length as the character storage.
... 524 shell global objects javascript, needscontent, spidermonkey these are the global objects that are set up automatically by the spidermonkey js command-line interpreter when you start the program.
SpiderMonkey Internals
semantic and lexical feedback are used to disambiguate hard cases such as missing semicolons, assignable expressions ("lvalues" in c parlance), and whether / is the division symbol or the start of a regular expression.
... self-hosting of built-in functions in js starting with firefox 17, spidermonkey has the ability to implement built-in functions in self-hosted js code.
...they have similar structure, generally starting with class definitions and continuing with internal constructors, finalizers, and helper functions.
JS_AddFinalizeCallback
callback syntax typedef enum jsfinalizestatus { jsfinalize_group_start, jsfinalize_group_end, jsfinalize_collection_end } jsfinalizestatus; typedef void (* jsfinalizecallback)(jsfreeop *fop, jsfinalizestatus status, bool iscompartment, void *data); name type description fop jsfreeop * a pointer to an instance of jsfreeop.
...added in spidermonkey 38 name description jsfinalize_group_start called when preparing to sweep a group of compartments, before anything has been swept.
... see also mxr id search for js_addfinalizecallback mxr id search for js_removefinalizecallback mxr id search for jsfinalizestatus mxr id search for jsfinalize_group_start mxr id search for jsfinalize_group_end mxr id search for jsfinalize_collection_end mxr id search for jsfinalizecallback jsfreeop js_setgccallback bug 723286 - separated from js_setgccallback as js_setfinalizecallback bug 996785 - replaced with js_addfinalizecallback ...
JS_NewDependentString
syntax jsstring * js_newdependentstring(jscontext *cx, js::handlestring str, size_t start, size_t length); name type description cx jscontext * the context in which to create the new string.
... start size_t the start index of the substring.
...the new string contains the same characters as if it were created with the javascript method str.substr(start, length).
TPS Tests
even if you opt not to use restmail, do not use your personal firefox account, as tps will delete and replace the data in it many times, not to mention the first run is very likely to fail, since it expects a clean start).
... note: be prepared not to use your computer for 15 or so minutes after starting a full run of tps, as it will open and close a fairly large number of firefox windows.
...this means you may want to run a tps test twice to see if it really failed, or it just started with garbage.
Querying Places
a new session starts when the user types a new url or follows a bookmark (xxx link to more details about what constitutes a session).
... bookmark queries there is a quick-start for doing simple bookmark queries in retrieving part of the bookmarks tree.
... // |query| and |options| are objects created in the previous section query.setparents([placesutils.bookmarks.toolbarguid], 1); let result = placesutils.history.executequery(query, options); serializing queries query and options objects can be serialized into a string starting with "place:" using queriestoquerystring.
Using the Places history service
when the user starts browsing (for example, by typing in a link or following a bookmark), a new session id is created.
...this can be and is calledbefore the page is actually added to history, since the page isn't added until it actually starts loading.
... nsinavhistoryservice.endupdatebatch: ends a batch operation previously started with beginupdatebatch.
How to build an XPCOM component in JavaScript
orld;1", queryinterface: xpcomutils.generateqi([components.interfaces.nsihelloworld]), hello: function() { return "hello world!"; } }; var components = [helloworld]; if ("generatensgetfactory" in xpcomutils) var nsgetfactory = xpcomutils.generatensgetfactory(components); // firefox 4.0 and higher else var nsgetmodule = xpcomutils.generatensgetmodule(components); // firefox 3.x note: starting with firefox 4.0 you will need to declare your component in chrome.manifest; classdescription and contractid properties on the other hand are no longer required.
... restart application.
... restart application.
Building the WebLock UI
client code overview before we get started on the actual user interface, we should establish how the client code is to access the weblock component and use its interfaces to control the web locking of the browser.
... the xul that defines the radiogroup in the web lock manager dialog is this: <radiogroup> <radio label="lock"/> <radio label="unlock" selected="true"/> </radiogroup> since the weblock component always starts up in the unlocked position, you can add the selected="true" attribute and value on the unlock radio button and reset it dynamically as the user takes action.
...once it's installed and registered, the weblock component itself is ready to go: xpcom finds it and adds it to the list of registered components, and then weblock observes the xpcom startup event and initializes itself.
Creating the Component Code
this is the object that contains the business logic, that implements functionality such as starting a network download, implementing interfaces that listen to the download progress, or providing a new content type handler.
...starting from the outside in, onion peel view of xpcom component creation represents the sequence for constructing an xpcom object.
...see getting called at startup for an example of this.
Replace
void replace( index_type acutstart, index_type acutlength, const self_type& astring ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
... void replace( index_type acutstart, size_type acutlength, const char_type* adata, size_type adatalength = pr_uint32_max ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
... void replace( index_type acutstart, index_type acutlength, char_type achar ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
Replace
void replace( index_type acutstart, index_type acutlength, const self_type& astring ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
... void replace( index_type acutstart, size_type acutlength, const char_type* adata, size_type adatalength = pr_uint32_max ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
... void replace( index_type acutstart, index_type acutlength, char_type achar ); parameter acutstart [in] the starting index of the section to remove, measured in storage units.
IAccessibleHyperlink
startindex() and endindex() are indices with respect to the text exposed by iaccessibletext.
...method overview [propget] hresult anchor([in] long index, [out] variant anchor ); [propget] hresult anchortarget([in] long index, [out] variant anchortarget ); [propget] hresult endindex([out] long index ); [propget] hresult startindex([out] long index ); [propget] hresult valid([out] boolean valid ); methods anchor() returns an object that represents the link anchor, as appropriate for the link at the specified index.
...startindex() [propget] hresult startindex( [out] long index ); parameters index the 0 based character offset at which the textual representation of the hyperlink starts.
amIWebInstallListener
toolkit/mozapps/extensions/amiwebinstalllistener.idlscriptable starts all installs.
... return value true if the caller should start the installs.
... return value true if the caller should start the installs.
nsICachingChannel
the value of this attribute is usually only settable during the processing of a channel's onstartrequest.
...the listener will only see onstartrequest followed by onstoprequest.
...this value is undefined before the channel fires its onstartrequest notification and after the channel fires its onstoprequest notification.
nsIFeedProgressListener
1.0 66 introduced gecko 1.8 inherits from: nsifeedresultlistener last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) method overview void handleentry(in nsifeedentry entry, in nsifeedresult result); void handlefeedatfirstentry(in nsifeedresult result); void handlestartfeed(in nsifeedresult result); void reporterror(in astring errortext, in long linenumber, in boolean bozo); methods handleentry() called after each entry or item is processed.
... handlestartfeed() called as soon as a reasonable start to a feed is detected; this lets your code know that the feed does appear to be an actual feed rather than some other sort of document.
... void handlestartfeed( in nsifeedresult result ); parameters result an nsifeedresult describing the current state of the feed at the moment parsing begins.
nsIHTMLEditor
boolean breakisvisible( in nsidomnode anode ); parameters anode return value candrag() decides if a drag should be started (for example, based on the current selection and mousepoint).
... getelementorparentbytagname() return the input node or a parent matching the given atagname, starting the search at the supplied node.
... anode the node in the document to start the search.
nsIMemoryReporter
as of gecko 6.0, the path should start with "explicit/" if the memory report accounts for all memory reported under sub-paths.
...each reporter starts with an empty string for this value, indicating that it applies to the current process; this is true even for reporters in a child process.
... units_count_cumulative 2 the amount contains the number of times some event has occurred since the application started up.
nsIProcess
this value is only available after the process has started; in addition, some platforms may not offer this value at all.
...once initialized, you can start the process executing by calling run().
... run() starts executing the process.
nsIRequest
inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) for example nsichannel typically passes itself as the nsirequest argument to the nsistreamlistener on each onstartrequest, ondataavaliable, and onstoprequest invocation.
... validate_once_per_session 1 << 13 disables validation of expired content, provided it has already been validated (at least once) since the start of this session.
...requests do not necessarily start out pending; in some cases, requests have to be explicitly initiated (for example nsichannel implementations are only pending once asyncopen returns successfully).
nsISeekableStream
inherits from: nsisupports last changed in gecko 1.7 method overview void seek(in long whence, in long long offset); void seteof(); long long tell(); constants constant value description ns_seek_set 0 specifies that the offset is relative to the start of the stream.
... tell() this method reports the current offset, in bytes, from the start of the stream.
...return value the current offset, in bytes, from the start of the stream.
nsISelectionController
void charactermove(in boolean forward, in boolean extend); boolean checkvisibility(in nsidomnode node, in short startoffset, in short endoffset); void completemove(in boolean forward, in boolean extend); void completescroll(in boolean forward); boolean getcaretenabled(); short getdisplayselection(); nsiselection getselection(in short type); void intralinemove(in boolean forward, in boolean extend); voi...
...boolean checkvisibility( in nsidomnode node, in short startoffset, in short endoffset ); parameters node nsidomnode to test.
... startoffset offset in dom to first char of textnode to test.
nsISessionStore
starting in firefox 3.5, this preference is no longer used.
...starting with gecko 1.9.1, it returns a reference to the reopened tab as an nsidomnode object.
... nsisessionstartup json ...
nsISupportsArray
an enumeratebackwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the xpcom interface guidelines boolean enumerateforwards(in nsisupportsarrayenumfunc afunc, in voidptr adata); violates the xpcom interface guidelines boolean equals([const] in nsisupportsarray other); violates the xpcom interface guidelines long getindexof(in nsisupports apossibleelement); long getindexofstartingat(in nsisupports apossibleelement, in unsigned long astartindex); long getlastindexof(in nsisupports apossibleelement); long indexof([const] in nsisupports apossibleelement); violates the xpcom interface guidelines long indexofstartingat([const] in nsisupports apossibleelement, in unsigned long astartindex); violates the xpcom interface guidelines boolean insertelementat(in nsisupports...
...pt] boolean enumerateforwards( in nsisupportsarrayenumfunc afunc, in voidptr adata ); parameters afunc adata return value violates the xpcom interface guidelines equals() boolean equals( [const] in nsisupportsarray other ); parameters other return value getindexof() long getindexof( in nsisupports apossibleelement ); parameters apossibleelement return value getindexofstartingat() long getindexofstartingat( in nsisupports apossibleelement, in unsigned long astartindex ); parameters apossibleelement astartindex return value getlastindexof() long getlastindexof( in nsisupports apossibleelement ); parameters apossibleelement return value violates the xpcom interface guidelines indexof() long indexof( [const] in nsisupports apossibleelement ); ...
...parameters apossibleelement return value violates the xpcom interface guidelines indexofstartingat() long indexofstartingat( [const] in nsisupports apossibleelement, in unsigned long astartindex ); parameters apossibleelement astartindex return value violates the xpcom interface guidelines insertelementat() boolean insertelementat( in nsisupports aelement, in unsigned long aindex ); parameters aelement aindex return value violates the xpcom interface guidelines insertelementsat() boolean insertelementsat( in nsisupportsarray aother, in unsigned long aindex ); parameters aother aindex return value violates the xpcom interface guidelines lastindexof() long lastindexof( [const] in nsisupports apossibleelement ); parameters apossibleelem...
nsITimer
note: re-setting the delay on a one-shot timer that has already fired doesn't restart the timer.
... call one of the init() methods to restart a one-shot timer.
... type_repeating_slack 1 after firing, the timer is stopped and not restarted until its callback completes.
nsIWebContentHandlerRegistrar
cu.import('resource://gre/modules/services.jsm'); var nsiwchr = cc["@mozilla.org/embeddor.implemented/web-content-handler-registrar;1"] .getservice(ci.nsiwebcontenthandlerregistrar); var htmlcontentwindow = undefined; var registeruri = 'http://mail.live.com/secure/start?action=compose&to=%s'; var myurihostname = services.io.newuri(registeruri, null, null).host; // this section here is long and daunting, but its just finding a suitable contentwindow var domwindows = services.wm.getenumerator(null); while (domwindows.hasmoreelements()) { var adomwindow = domwindows.getnext(); if (adomwindow.gbrowser) { if (adomwindow.gbrowser.tabcontainer) { ...
... permission denied to add http://mail.live.com/secure/start?action=compose&to=%s as a content or protocol handler'permission denied to add http://mail.live.com/secure/start?action=compose&to=%s as a content or protocol handler' when calling method: [nsiwebcontenthandlerregistrar::registerprotocolhandler] if the host names do match then a confirmation like this will be seen: this domain check can be bypassed by setting the preference of gecko.handlers...
...oolpref('gecko.handlerservice.allowregisterfromdifferenthost', true); } var htmlcontentwindow = services.wm.getmostrecentwindow('navigator:browser'); //because we set the preference to true above, we need any window that has a browser, just pass the domwindow and the registerprotocolhandler will get the contentwindow from it nsiwchr.registerprotocolhandler("mailto", "http://mail.live.com/secure/start?action=compose&to=%s", "outlook.com live mail", htmlcontentwindow); if (!allowregisterfromdifferenthost) { //it this variable is false, than we had set the pref to true obviously.
nsIWindowsShellService
constants valid starting keys for the windows registry.
...string getregistryentry( in long ahkeyconstant, in string asubkeyname, in string avaluename ); parameters ahkeyconstant the starting key, using the constants defined above.
... shortcutmaintenance() provides the shell service an opportunity to do some win7+ shortcut maintenance needed on initial startup of the browser.
NS_CStringCutData
#include "nsstringapi.h" nsresult ns_cstringcutdata( nsacstring& astring, pruint32 acutstart, pruint32 acutlength ); parameters astring [in] a nsacstring instance to be modified.
... acutstart [in] the starting index of the section to remove, measured in storage units.
...pass pr_uint32_max to specify the length from acutstart to the end of the string.
NS_StringCutData
#include "nsstringapi.h" nsresult ns_stringcutdata( nsastring& astring, pruint32 acutstart, pruint32 acutlength ); parameters astring [in] a nsastring instance to be modified.
... acutstart [in] the starting index of the section to remove, measured in storage units.
...pass pr_uint32_max to specify the length from acutstart to the end of the string.
Status, Recent Changes, and Plans
you may want to skip directly to the getting started guide, the reference manual, or the faq.
... plans for nscomptr bug 59212: as soon as we test on more compilers, start recommending already_addrefed as a function result.
... added an entire section to the getting started guide on nscomptrs in function signatures added references to recent bugs influencing the use of nscomptr machinery: bug 59212, and bug 59414 fixed comparisons 1 and 3, as per comments by morten welinder updated examples to prefer direct initialization over copy initialization.
Address book sync client design
this interface is defined in mozilla/mailnews/addrbook/public/nsiabsyncdriver.idl #include "nsrootidl.idl" #include "nsiabsynclistener.idl" [scriptable, uuid(91fdfee1-efbc-11d3-8f97-000073757374)] interface nsiabsyncdriver : nsiabsynclistener { void kickit(); }; as you can see, this is a very simple interface which allows for the starting of the address book sync operation.
... * */ void onstartauthoperation(); /** * notify the observer that the ab sync operation has been completed.
...this method is * called only once, at the beginning of a sync transaction * */ void onstartoperation(in print32 atransactionid, in pruint32 amsgsize); /** * notify the observer that progress as occurred for the ab sync operation */ void onprogress(in print32 atransactionid, in pruint32 aprogress, in pruint32 aprogressmax); /** * notify the observer with a status message for sync operation */ void onstatus(in print32 atransactionid, in wstring ...
Index
2 account provisioner the account provisioner is the dialog that first comes up when starting thunderbird.
...this may seem like a lot of infrastructure just to read messages from a flat file, but it allows us to do it asynchronously, and to have reading local messages fit into the same kind of mechanisms that reading nntp and imap messages do - running urls, getting onstart/stoprunningurl notifications when the url starts/stops, etc.
... 107 use sqlite thunderbird if you'd like to use an sqlite database in your extension you'll need to look over the storage docs for an api reference, however this code should get you started.
MailNews fakeserver
onstartup none server's response called when a connection is made.
... server.start(port); // set up a nsimsgincomingserver locally localserver.someactionrequiringconnection(); server.performtest(); // nothing will be executed until the connection is closed // localserver.closecachedconnections() is generally a good way to do so server.resettest(); // set up second test server.performtest(); transaction = server.playtransaction(); // finished with tests ...
...topped none if the server is stopped helper for performtest istestfinished none if the test is finished helper for performtest playtransaction none the transaction the transaction is an object with two properties: us, and them; us is an array of responses we sent, them an array of commands received resettest none nothing prepares the server for the next test without closing the connection start port number nothing starts the server listening stop none nothing stops the server and closes the connection using fakeserver in qa testing debug output from fakeservers it is possible to get the fakeservers to dump to the console the commands they have sent and received.
Building a Thunderbird extension 6: Adding JavaScript
window.addeventlistener("load", function(e) { startup(); }, false); window.setinterval( function() { startup(); }, 60000); //update date every minute function startup() { var mypanel = document.getelementbyid("my-panel"); var date = new date(); var day = date.getday(); var datestring = date.getfullyear() + "." + (date.getmonth()+1) + "." + date.getdate(); mypanel.label = "date: " + datestring; } the first part registers a new event lis...
...the event listener then calls our startup function which gets our <statusbarpanel>-element with the id my-panel from the document's dom tree.
...this allows us to call the startup function repeatedly with an interval of 60000ms (every minute).
Thunderbird extensions
there are similarities with firefox extensions, but there are also differences that may confound the starting thunderbird developer.
... documentation getting started with thunderbird a brave, young developer wants to develop an add-on for thunderbird.
... start by reading the tutorial and learn how to build a thunderbird extension.
Zombie compartments
restart the browser.
... restart the browser.
... restartless add-ons should also take special care that all their compartments get destroyed after disabling or uninstalling the add-on.
Plug-in Development Overview - Plugins
the server looks for the mime type registered by a plug-in, based on the file extension, and starts sending the file to the browser.
... when it starts up, the browser checks for plug-in modules for the platform and registers them.
... starting in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7), you can get the origin of the document in a secure, convenient way by calling npn_getvalue() to retrieve the value of the variable npnvdocumentorigin.
Accessibility Inspector - Firefox Developer Tools
accessing the accessibility inspector when you first open any of the other developer tools, the accessibility features are turned off (unless you've already got them turned on in another browser tab, or got the firefox accessibility engine started already, e.g., you might be a screenreader user or tester).
...starting in firefox 79, it is automatically enabled when you do one of the following: choose accessibility in the tools > web developer menu.
...for a start, you can investigate items that don't have a proper text equivalent — images without alt text and form elements without proper labels have a name property of null, for example.
Browser Toolbox - Firefox Developer Tools
note: if you want to debug a specific add-on that is restartless or sdk-based then try the add-on debugger.
...altogether you will have access to the following developer tools: debugger (note: if you want to debug a specific add-on that is restartless or sdk-based then try the add-on debugger.) console style editor performance network monitor page inspector accessibility inspector you can debug chrome: and about: pages using the normal debugger, just as if they were ordinary content pages.
... note: this change is not persistent across browser restarts.
Migrating from Firebug - Firefox Developer Tools
the devtools display an element {} rule for this purpose, which requires a single click into it to start editing the properties.
...a profile can be created via console.profile() and console.profileend() like in firebug or via the "start recording performance" button in the performance tool.
... developer toolbar display of error count when there are javascript errors on a page, the firebug start button shows a badge with their number.
Examine and edit CSS - Firefox Developer Tools
you can also tab through the different existing properties and values, and start editing them by pressing enter or space.
... as you start typing a property name, you'll see a list of autocomplete suggestions.
...the default choice is the most common property that starts with the letters you've typed.
Page inspector keyboard shortcuts - Firefox Developer Tools
end end end expand currently selected node right arrow right arrow right arrow collapse currently selected node left arrow left arrow left arrow (when a node is selected) move inside the node so you can start stepping through attributes.
... enter return enter step forward through the attributes of a node tab tab tab step backward through the attributes of a node shift + tab shift + tab shift + tab (when an attribute is selected) start editing the attribute enter return enter hide/show the selected node h h h focus on the search box in the html pane ctrl + f cmd + f ctrl + f edit as html f2 f2 f2 stop editing html f2 / ctrl +enter f2 / cmd + return f2 / ctrl + enter copy the selected node's outer html ctrl + c cmd + c ctrl + c scroll the selected node into view s s s find the next match in the markup, when searching is active enter return enter ...
...cos linux focus on the search box in the css pane ctrl + f cmd + f ctrl + f clear search box content (only when the search box is focused, and content has been entered) esc esc esc step forward through properties and values tab tab tab step backward through properties and values shift + tab shift + tab shift + tab start editing property or value (rules view only, when a property or value is selected, but not already being edited) enter or space return or space enter or space cycle up and down through auto-complete suggestions (rules view only, when a property or value is being edited) up arrow , down arrow up arrow , down arrow up arrow , down arrow choose current auto-complet...
Animating CSS properties - Firefox Developer Tools
it looks like this: it has two controls: a button to start/stop the animation, and a radio group to choose to animate using margin, or to animate using transform.
... there's also a video version of this walkthrough: animating using margin leaving the "use margin" option set, start the animation, open the performance tool, and make a recording.
...we're averaging nearly 60fps, and apart from one dip near the start, we're getting a consistently high frame rate.
Firefox Developer Tools
note: if you are just getting started with web development and using developer tools, our learning docs will help you — see getting started with the web and what are browser developer tools?
... for good starting points.
... contribute if you want to help improve the developer tools, these resources will get you started.
Animation.play() - Web APIs
WebAPIAnimationplay
the play() method of the web animations api's animation interface starts or resumes playing of an animation.
... if the animation is finished, calling play() restarts the animation, playing it from the beginning.
...cake.addeventlistener("mousedown", growalice, false); cake.addeventlistener("touchstart", growalice, false); specifications specification status comment web animationsthe definition of 'play()' in that specification.
Animation - Web APIs
WebAPIAnimation
animation.starttime gets or sets the scheduled time when an animation's playback should begin.
... animation.play() starts or resumes playing of an animation, or begins the animation again if it previously finished.
... animation.reverse() reverses playback direction, stopping at the start of the animation.
AnimationEvent() - Web APIs
it is case-sensitive and can be: 'animationstart', 'animationend', or 'animationiteration'.
...for an "animationstart" event, elapsedtime is 0.0 unless there was a negative value for animation-delay, in which case the event will be fired with elapsedtime containing (-1 * delay).
... pseudoelement optional is a domstring, starting with "::", containing the name of the pseudo-element the animation runs on.
AudioBuffer.copyFromChannel() - Web APIs
syntax myarraybuffer.copyfromchannel(destination, channelnumber, startinchannel); parameters destination a float32array to copy the channel's samples to.
... startinchannel optional an optional offset into the source channel's buffer from which to begin copying samples.
... the value of startinchannel is outside the current range of samples that already exist in the source buffer; that is, it's greater than its current length.
AudioBuffer.copyToChannel() - Web APIs
syntax myarraybuffer.copytochannel(source, channelnumber, startinchannel); parameters source a float32array that the channel data will be copied from.
... startinchannel optional an optional offset to copy the data to.
... if startinchannel is greater than audiobuffer.length, an index_size_err will be thrown.
AudioBufferSourceNode.loop - Web APIs
when looping is enabled, the sound begins playing at the time specified as the start point when start() is called.
... when the time specified by the loopend property is reached, playback continues at the time specified by loopstart example in this example, the audiocontext.decodeaudiodata function is used to decode an audio track and put it into an audiobuffersourcenode.
...ffer = 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.
BaseAudioContext.createPeriodicWave() - Web APIs
var real = new float32array(2); var imag = new float32array(2); var ac = new audiocontext(); var osc = ac.createoscillator(); real[0] = 0; imag[0] = 0; real[1] = 1; imag[1] = 0; var wave = ac.createperiodicwave(real, imag, {disablenormalization: true}); osc.setperiodicwave(wave); osc.connect(ac.destination); osc.start(); osc.stop(2); this works because a sound that contains only a fundamental tone is by definition a sine wave here, we create a periodicwave with two values.
... the first value is the dc offset, which is the value at which the oscillator starts.
... 0 is good here, because we want to start the curve at the middle of the [-1.0; 1.0] range.
Using the CSS Typed Object Model - Web APIs
we start with some html: a paragraph with a link, as well as a definition list to which we will add all the css property / value pairs.
...let's start by adding some css to our example, including a custom property and an inhertable property: p { font-weight: bold; } a { --color: red; color: var(--color); } instead of getting all the properties, we create an array of properties of interest and use the stylepropertymapreadonly.get() method to get each of their values: <p> <a href="https://example.com">link</a> </p> <dl id="regurgit...
... summary this should get you started with understanding the css typed om.
CanvasRenderingContext2D.bezierCurveTo() - Web APIs
the starting point is the latest point in the current path, which can be changed using moveto() before creating the bézier curve.
... html <canvas id="canvas"></canvas> javascript // define canvas and context const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // define the points as {x, y} let start = { x: 50, y: 20 }; let cp1 = { x: 230, y: 30 }; let cp2 = { x: 150, y: 80 }; let end = { x: 250, y: 100 }; // cubic bézier curve ctx.beginpath(); ctx.moveto(start.x, start.y); ctx.beziercurveto(cp1.x, cp1.y, cp2.x, cp2.y, end.x, end.y); ctx.stroke(); // start and end points ctx.fillstyle = 'blue'; ctx.beginpath(); ctx.arc(start.x, start.y, 5, 0, 2 * math.pi); // start point...
... ctx.arc(end.x, end.y, 5, 0, 2 * math.pi); // end point ctx.fill(); // control points ctx.fillstyle = 'red'; ctx.beginpath(); ctx.arc(cp1.x, cp1.y, 5, 0, 2 * math.pi); // control point one ctx.arc(cp2.x, cp2.y, 5, 0, 2 * math.pi); // control point two ctx.fill(); result in this example, the control points are red and the start and end points are blue.
CanvasRenderingContext2D.ellipse() - Web APIs
syntax void ctx.ellipse(x, y, radiusx, radiusy, rotation, startangle, endangle [, anticlockwise]); the ellipse() method creates an elliptical arc centered at (x, y) with the radii radiusx and radiusy.
... the path starts at startangle and ends at endangle, and travels in the direction given by anticlockwise (defaulting to clockwise).
... startangle the angle at which the ellipse starts, measured clockwise from the positive x-axis and expressed in radians.
CanvasRenderingContext2D.fillRect() - Web APIs
syntax void ctx.fillrect(x, y, width, height); the fillrect() method draws a filled rectangle whose starting point is at (x, y) and whose size is specified by width and height.
... parameters x the x-axis coordinate of the rectangle's starting point.
... y the y-axis coordinate of the rectangle's starting point.
CanvasRenderingContext2D.rect() - Web APIs
syntax void ctx.rect(x, y, width, height); the rect() method creates a rectangular path whose starting point is at (x, y) and whose size is specified by width and height.
... parameters x the x-axis coordinate of the rectangle's starting point.
... y the y-axis coordinate of the rectangle's starting point.
CanvasRenderingContext2D.strokeRect() - Web APIs
syntax void ctx.strokerect(x, y, width, height); the strokerect() method draws a stroked rectangle whose starting point is at (x, y) and whose size is specified by width and height.
... parameters x the x-axis coordinate of the rectangle's starting point.
... y the y-axis coordinate of the rectangle's starting point.
Manipulating video using canvas - Web APIs
this method's job is to prepare the variables needed by the chroma-key processing code, and to set up an event listener so we can detect when the user starts playing the video.
... in response to the user beginning playback, this code fetches the width and height of the video, halving each (we will be halving the size of the video when we perform the chroma-keying effect), then calls the timercallback() method to start watching the video and computing the visual effect.
... the timer callback the timer callback is called initially when the video starts playing (when the "play" event occurs), then takes responsibility for establishing itself to be called periodically in order to launch the keying effect for each frame.
Basic animations - Web APIs
setinterval(function, delay) starts repeatedly executing the function specified by function every delay milliseconds.
...han canvas cleary = imgh; } else { cleary = canvasysize; } // get canvas context ctx = document.getelementbyid('canvas').getcontext('2d'); // set refresh rate return setinterval(draw, speed); } function draw() { ctx.clearrect(0, 0, clearx, cleary); // clear the canvas // if image is <= canvas size if (imgw <= canvasxsize) { // reset, start from beginning if (x > canvasxsize) { x = -imgw + x; } // draw additional image1 if (x > 0) { ctx.drawimage(img, -imgw + x, y, imgw, imgh); } // draw additional image2 if (x - imgw > 0) { ctx.drawimage(img, -imgw * 2 + x, y, imgw, imgh); } } // image is > canvas size else { // ...
...reset, start from beginning if (x > (canvasxsize)) { x = canvasxsize - imgw; } // draw aditional image if (x > (canvasxsize-imgw)) { ctx.drawimage(img, x - imgw + 1, y, imgw, imgh); } } // draw image ctx.drawimage(img, x, y,imgw, imgh); // amount to move x += dx; } below is the <canvas> in which the image is scrolled.
Canvas tutorial - Web APIs
this tutorial describes how to use the <canvas> element to draw 2d graphics, starting with the basics.
... the examples provided should give you some clear ideas about what you can do with canvas, and will provide code snippets that may get you started in building your own content.
... before you start using the <canvas> element is not very difficult, but you do need a basic understanding of html and javascript.
CharacterData - Web APIs
characterdata.deletedata() removes the specified amount of characters, starting at the specified offset, from the characterdata.data string; when this method returns, data contains the shortened domstring.
... characterdata.replacedata() replaces the specified amount of characters, starting at the specified offset, with the specified domstring; when this method returns, data contains the modified domstring.
... characterdata.substringdata() returns a domstring containing the part of characterdata.data of the specified length and starting at the specified offset.
ConstantSourceNode - Web APIs
start() schedules a sound to playback at an exact time.
...the three nodes are set up like this: gainnode2 = context.creategain(); gainnode3 = context.creategain(); gainnode2.gain.value = gainnode3.gain.value = 0.5; volumeslidercontrol.value = gainnode2.gain.value; constantnode = context.createconstantsource(); constantnode.connect(gainnode2.gain); constantnode.connect(gainnode3.gain); constantnode.start(); gainnode2.connect(context.destination); gainnode3.connect(context.destination); this code starts by creating the gain nodes and setting them and the volume control that will adjust their value all to 0.5.
...after starting the constant source by calling its start() method.
DOMHighResTimeStamp - Web APIs
the starting time can be either a specific time determined by the script for a site or app, or the time origin.
... example to determine how much time has elapsed since a particular point in your code, you can do something like this: let starttime = performance.now(); /* ...
...*/ let elapsedtime = performance.now() - starttime; upon completion, the value of elapsedtime is the number of milliseconds that have elapsed since you recorded the starting time in line 1.
DataTransfer.types - Web APIs
the datatransfer.types read-only property returns an array of the drag data formats (as strings) that were set in the dragstart event.
... <!doctype html> <html lang=en> <title>examples of datatransfer.{types,items} properties</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #target { border: 1px solid black; } </style> <script> function dragstart_handler(ev) { console.log("dragstart: target.id = " + ev.target.id); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree ev.datatransfer.setdata("text/plain", ev.target.id); ev.datatransfer.effectallowed = "move"; } function drop_handler(ev) { console.log("drop: target.id = " + ev.target.id); ev.preventdefault(); // get the id of...
... + "].kind = " + ev.datatransfer.items[i].kind + " ; type = " + ev.datatransfer.items[i].type); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } </script> <body> <h1>examples of <code>datatransfer</code>.{<code>types</code>, <code>items</code>} properties</h1> <ul> <li id="i1" ondragstart="dragstart_handler(event);" draggable="true">drag item 1 to the drop zone</li> <li id="i2" ondragstart="dragstart_handler(event);" draggable="true">drag item 2 to the drop zone</li> </ul> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html living standa...
DataTransferItemList.clear() - Web APIs
the drag data store in which this list is kept is only writable while handling the dragstart event.
... html <div> <p id="source" ondragstart="dragstart_handler(event);" ondragend="dragend_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> css div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } javascript function dragstart...
..._handler(ev) { console.log("dragstart"); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree var datalist = ev.datatransfer.items; datalist.add(ev.target.id, "text/plain"); // add some other items to the drag payload datalist.add("<p>...
Document.cookie - Web APIs
WebAPIDocumentcookie
s example #1: simple usage document.cookie = "name=oeschger"; document.cookie = "favorite_food=tripe"; function 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.
... function doonce() { if (!document.cookie.split('; ').find(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('read...
... notes starting with firefox 2, a better mechanism for client-side storage is available - whatwg dom storage.
Document.evaluate() - Web APIs
WebAPIDocumentevaluate
for example, if you know the content you are looking for is somewhere inside the body tag, you can use this: document.evaluate(".//h2", document.body, null, xpathresult.any_type, null); notice in the above document.body has been used as the context instead of document so the xpath starts from the body element.
... (in this example, the "." is important to indicate that the querying should start from the context node, document.body.
... if the "." was left out (leaving //h2) the query would start from the root node (html) which would be more wasteful.) see introduction to using xpath in javascript for more information.
EffectTiming.easing - Web APIs
frames(<integer>) specifies a frames timing function, which breaks the animation down into a number of equal time intervals but also displays the start (0%) and end (100%) states for an equal amount of time to the other intervals.
... steps(<integer>[, [ start | end ] ]?) specifies a step timing function, which breaks the animation down into a number of equal time intervals.
... step-start equivalent to steps(1, start) step-end equivalent to steps(1, end).
EffectTiming - Web APIs
properties delay optional the number of milliseconds to delay the start of the animation.
... iterationstart optional describes at what point in the iteration the animation should start.
... 0.5 would indicate starting halfway through the first iteration for example, and with this value set, an animation with 2 iterations would end halfway through a third iteration.
Element.animate() - Web APIs
WebAPIElementanimate
delay optional the number of milliseconds to delay the start of the animation.
... iterationstart optional describes at what point in the iteration the animation should start.
... 0.5 would indicate starting halfway through the first iteration for example, and with this value set, an animation with 2 iterations would end halfway through a third iteration.
Element - Web APIs
WebAPIElement
compositionstart fired when a text composition system such as an input method editor starts a new composition session.
... also available via the ontouchmove property touchstart fired when one or more touch points are placed on the touch surface.
... also available via the ontouchstart property specifications specification status comment css pseudo-elements level 4the definition of 'element' in that specification.
Introduction to the File and Directory Entries API - Web APIs
the app can restart uploads after an interruption, such as the browser being closed or crashing, connectivity getting interrupted, or the computer getting shut down.
... big concepts before you start using the file and directory entries api, you need to understand a few concepts: the file and directory entries api is a virtual representation of a file system the file and directory entries api can use different storage types browsers impose storage quota the file and directory entries api has asynchronous and synchronous versions when using the asynchronous api, always use the error cal...
... for testing purposes, you can bypass the restriction on chrome by starting the browser with the --allow-file-access-from-files flag.
GlobalEventHandlers.onanimationend - Web APIs
that's because we don't want the box to start animating right away.
... we'll add the animation style later to start animating the box.
... function log(msg, event) { let logbox = document.getelementbyid("log"); logbox.innerhtml += msg; if (event) { logbox.innerhtml += " <code>"+ event.animationname + "</code> at time " + event.elapsedtime.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.gete...
HTMLInputElement - Web APIs
selectionstart unsigned long: returns / sets the beginning index of the selected text.
...possible values are: forward if selection was performed in the start-to-end direction of the current locale backward for the opposite direction none if the direction is unknown size unsigned long: returns / sets the element's size attribute, containing visual size of the control.
... the following properties have been added: autocomplete, autofocus, dirname, files, formaction, formenctype, formmethod, formnovalidate, formtarget, height, indeterminate, labels, list, max, min, multiple, pattern, placeholder, required, selectiondirection, selectionend, selectionstart, step, validationmessage, validity, valueasdate, valueasnumber, width, and willvalidate.
InputDeviceCapabilities API - Web APIs
for example, let's say we have a web page that implements both a touchstart and a mousedown event.
... we can assume that if the touchstart event is triggered that the user's device has a touch interface.
...it would be useful to know if a touchstart event were also triggered so that we don't take the same action twice.
KeyboardEvent.code - Web APIs
angle is the current amount of rotation applied to the ship, in degrees; it starts at 0° (pointing straight up).
... function refresh() { let x = position.x - (shipsize.width/2); let y = position.y - (shipsize.height/2); let transform = "translate(" + x + " " + y + ") rotate(" + angle + " 15 15) "; spaceship.setattribute("transform", transform); } finally, the addeventlistener() method is used to start listening for keydown events, acting on each key by updating the ship position and rotation angle, then calling refresh() to draw the ship at its new position and angle.
...most real games would watch for keydown events, start motion when that happens, and stop the motion when the corresponding keyup occurs, instead of relying on key repeats.
KeyframeEffect.KeyframeEffect() - Web APIs
keyframeoptions optional either an integer representing the animation's duration (in milliseconds), or an object containing one or more of the following: delay optional the number of milliseconds to delay the start of the animation.
... iterationstart optional describes at what point in the iteration the animation should start.
... 0.5 would indicate starting halfway through the first iteration for example, and with this value set, an animation with 2 iterations would end halfway through a third iteration.
KeyframeEffectOptions - Web APIs
delay optional the number of milliseconds to delay the start of the animation.
... iterationstart optional describes at what point in the iteration the animation should start.
... 0.5 would indicate starting halfway through the first iteration for example, and with this value set, an animation with 2 iterations would end halfway through a third iteration.
LockedFile.truncate() - Web APIs
if the method is called with no argument, the operation removes all the bytes starting at the index set in lockedfile.location.
... if the method is called with an argument, the operation removes all the bytes starting at the index corresponding to the parameter and regardless of the value of lockedfile.location.
... syntax var request = instanceoflockedfile.truncate(start); parameters start optional a number representing the index where to start the operation.
MediaRecorder.onerror - Web APIs
invalidstateerror an attempt was made to stop or pause or an inactive recorder, start or resume an active recorder, or otherwise manipulate the mediarecorder while in the wrong state.
... example this example creates a new mediarecorder instance and starts recording using the user agent's default media format.
... " + "is not allowed due to security " + "restrictions."); break; default: shownotification("a problem occurred while trying " + "to record the video."); break; } }; /* this would be a good place to create a worker to handle writing the buffers to disk periodically */ recorder.start(100); /* 100ms time slices per buffer */ return recorder; } specifications specification status comment mediastream recordingthe definition of 'mediarecorder.onerror' in that specification.
MediaRecorder - Web APIs
mediarecorder.start() begins recording media; this method can optionally be passed a timeslice argument with a value in milliseconds.
... mediarecorder.onstart an eventhandler called to handle the start event, which occurs when media recording starts.
... example if (navigator.mediadevices) { console.log('getusermedia supported.'); var constraints = { audio: true }; var chunks = []; 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.onst...
Using the MediaStream Recording API - Web APIs
keeping the interface constrained to the viewport, regardless of device height, with calc() the calc() function is one of those useful little utility features that's cropped up in css that doesn't look like much initially, but soon starts to make you think "wow, why didn't we have this before?
...first of all, mediarecorder.start() is used to start recording the stream once the record button is pressed: record.onclick = function() { mediarecorder.start(); console.log(mediarecorder.state); console.log("recorder started"); record.style.background = "red"; record.style.color = "black"; } when the mediarecorder is recording, the mediarecorder.state property will return a value of "recording".
...we register an event handler to do this using mediarecorder.ondataavailable: let chunks = []; mediarecorder.ondataavailable = function(e) { chunks.push(e.data); } note: the browser will fire dataavailable events as needed, but if you want to intervene you can also include a timeslice when invoking the start() method — for example start(10000) — to control this interval, or call mediarecorder.requestdata() to trigger an event when you need it.
MessageEvent - Web APIs
if the onmessage event is attached using addeventlistener, the port is manually started using its start() method: myworker.port.start(); when the port is started, both scripts post messages to the worker and handle messages sent from it using port.postmessage() and port.onmessage, respectively: first.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.port.postme...
...the ports associated with that worker are accessible in the connect event's ports property — we then use messageport start() method to start the port, and the onmessage handler to deal with messages sent from the main threads.
... onconnect = function(e) { var port = e.ports[0]; port.addeventlistener('message', function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); }); port.start(); // required when using addeventlistener.
MessagePort: messageerror event - Web APIs
.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.textcontent = event.data; }); myport.addeventlistener('messageerror', (event) => { console.error(event.data); }); myport.start(); }); note that the ...
...listener must call messageport.start() before any messages will be delivered to this port.
... this is only needed when using the addeventlistener() method: if the receiver uses onmessage instead, start() is called implicitly: window.addeventlistener('message', (event) => { const myport = event.ports[0]; myport.onmessage = (event) => { received.textcontent = event.data; }; myport.onmessageerror = (event) => { console.error(event.data); }; }); specifications specification status html living standard living standard ...
Navigation Timing API - Web APIs
examples calculate the total page load time to compute the total amount of time it took to load the page, you can use the following code: const perfdata = window.performance.timing; const pageloadtime = perfdata.loadeventend - perfdata.navigationstart; this subtracts the time at which navigation began (navigationstart) from the time at which the load event handler returns (loadeventend).
... calculate request response time you can calculate the time elapsed between the beginning of a request and the completion of getting the response using code like this: const connecttime = perfdata.responseend - perfdata.requeststart; here, the time at which the request was initiated (requeststart).
... calculate page render time as another example of an interesting piece of data you can obtain using the navigation timing api that you can't otherwise easily get, you can get the amount of time it took to render the page: const rendertime = perfdata.domcomplete - perfdata.domloading; this is obtained by starting with the time at which loading of the dom and its dependencies is complete (domcomplete) and subtracting from it the time at which parsing of the dom began (domloading).
OscillatorNode.setPeriodicWave() - Web APIs
var real = new float32array(2); var imag = new float32array(2); var ac = new audiocontext(); var osc = ac.createoscillator(); real[0] = 0; imag[0] = 0; real[1] = 1; imag[1] = 0; var wave = ac.createperiodicwave(real, imag); osc.setperiodicwave(wave); osc.connect(ac.destination); osc.start(); osc.stop(2); this works because a sound that contains only a fundamental tone is by definition a sine wave.
...the first value is the dc offset, which is the value at which the oscillator starts.
... 0 is good here, because we want to start the curve at the middle of the [-1.0; 1.0] range.
OscillatorNode - Web APIs
oscillatornode.start() specifies the exact time to start playing the tone.
... examples the following example shows basic usage of an audiocontext to create an oscillator node and to start playing a tone on it.
... // create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(440, audioctx.currenttime); // value in hertz oscillator.connect(audioctx.destination); oscillator.start(); specifications specification status comment web audio apithe definition of 'oscillatornode' in that specification.
PannerNode.coneInnerAngle - Web APIs
to help us visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector.
... about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.currenttime + 2); panner.orientationy.setvalueattime(y2, context.currenttime + 2); panner.orientationz.setvalueattime(z2, context.currenttime + 2); finally, let's connect all our nodes and start the oscillator!
... osc.connect(panner) .connect(context.destination); osc.start(0); specifications specification status comment web audio apithe definition of 'coneinnerangle' in that specification.
PannerNode.coneOuterAngle - Web APIs
to help us visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector.
... about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.currenttime + 2); panner.orientationy.setvalueattime(y2, context.currenttime + 2); panner.orientationz.setvalueattime(z2, context.currenttime + 2); finally, let's connect all our nodes and start the oscillator!
... osc.connect(panner) .connect(context.destination); osc.start(0); specifications specification status comment web audio apithe definition of 'coneouterangle' in that specification.
PannerNode.coneOuterGain - Web APIs
to help us visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector.
... about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.currenttime + 2); panner.orientationy.setvalueattime(y2, context.currenttime + 2); panner.orientationz.setvalueattime(z2, context.currenttime + 2); finally, let's connect all our nodes and start the oscillator!
... osc.connect(panner) .connect(context.destination); osc.start(0); specifications specification status comment web audio apithe definition of 'coneoutergain' in that specification.
PannerNode.orientationX - Web APIs
to help us visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector.
... about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.currenttime + 2); panner.orientationy.setvalueattime(y2, context.currenttime + 2); panner.orientationz.setvalueattime(z2, context.currenttime + 2); finally, let's connect all our nodes and start the oscillator!
... osc.connect(panner) .connect(context.destination); osc.start(0); specifications specification status comment web audio apithe definition of 'orientationx' in that specification.
PannerNode.orientationY - Web APIs
to help us visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector.
... about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.currenttime + 2); panner.orientationy.setvalueattime(y2, context.currenttime + 2); panner.orientationz.setvalueattime(z2, context.currenttime + 2); finally, let's connect all our nodes and start the oscillator!
... osc.connect(panner) .connect(context.destination); osc.start(0); specifications specification status comment web audio apithe definition of 'orientationy' in that specification.
PannerNode.orientationZ - Web APIs
to help us visualise how the orientation vector affects, we can use the right-hand rule: first, let's start by writing a utility function to figure out our orientation vector.
... about make the sound audible // if we set it to +/-22.5, the sound volume will be 0, as the threshold is exclusive const [x2, y2, z2] = yrotationtovector(-22.4); panner.orientationx.setvalueattime(x2, context.currenttime + 2); panner.orientationy.setvalueattime(y2, context.currenttime + 2); panner.orientationz.setvalueattime(z2, context.currenttime + 2); finally, let's connect all our nodes and start the oscillator!
... osc.connect(panner) .connect(context.destination); osc.start(0); specifications specification status comment web audio apithe definition of 'orientationz' in that specification.
PannerNode.refDistance - Web APIs
the distance at which the volume reduction starts taking effect.
... const context = new audiocontext(); // all our test tones will last this many seconds const note_length = 6; // this is how far we'll move the sound const z_distance = 20; // this function creates a graph for the test tone with a given refdistance // and schedules it to move away from the listener along the z (depth-wise) axis // at the given start time, resulting in a decrease in volume (decay) const scheduletesttone = (refdistance, starttime) => { const osc = new oscillatornode(context); const panner = new pannernode(context); panner.refdistance = refdistance; // set the initial z position, then schedule the ramp panner.positionz.setvalueattime(0, starttime); panner.positionz.linearramptovalueattime(z_distance, starttime + n...
...ote_length); osc.connect(panner) .connect(context.destination); osc.start(starttime); osc.stop(starttime + note_length); }; // this tone should decay immediately and fairly quickly scheduletesttone(1, context.currenttime); // this tone should decay slower and later than the previous one scheduletesttone(4, context.currenttime + note_length); // this tone should decay only slightly, and only start decaying fairly late scheduletesttone(7, context.currenttime + note_length * 2); after running this code, the resulting waveforms should look something like this: specifications specification status comment web audio apithe definition of 'refdistance' in that specification.
Using the Payment Request API - Web APIs
creating a new payment request object a payment request always starts with the creation of a new paymentrequest object — using the paymentrequest() constructor.
...sa', 'mastercard'], supportedtypes: ['debit', 'credit'] } }]; } function buildshoppingcartdetails() { // hardcoded for demo purposes: return { id: 'order-123', displayitems: [ { label: 'example item', amount: {currency: 'usd', value: '1.00'} } ], total: { label: 'total', amount: {currency: 'usd', value: '1.00'} } }; } starting the payment process once the paymentrequest object has been created, you call the paymentrequest.show() method on it to initiate the payment request.
... paymentrequest.canmakepayment() can be used to check whether the paymentrequest object is capable of making a payment before you start the payment process.
PerformanceResourceTiming.domainLookupEnd - Web APIs
if the user agent has the domain information in cache, domainlookupstart and domainlookupend represent the times when the user agent starts and ends the domain data retrieval from the cache.
... example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
... function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var va...
Performance API - Web APIs
the now() method returns a domhighrestimestamp whose value that depends on the navigation start and scope.
...the timing property returns a performancetiming object containing latency-related performance information such as the start of navigation time, start and end times for redirects, start and end times for responses, etc.
... resource timing level 2 working draft adds the nexthopprotocol, workerstart, transfersize, encodedbodysize, and decodedbodysize properties to the performanceresourcetiming interface.
Using Performance Timeline - Web APIs
function log(s) { var o = document.getelementsbytagname("output")[0]; o.innerhtml += s + " <br>"; } function do_work (n) { for (var i=0 ; i < n; i++) { var m = math.random(); } } function print_perf_entry(pe) { log("..name: " + pe.name + "; entrytype: " + pe.entrytype + "; starttime: " + pe.starttime + "; duration: " + pe.duration); } function print_performanceentries() { if (performance.mark === undefined) { log("...
... function print_performanceentry(ev) { var properties = ["name", "entrytype", "starttime", "duration"]; // create a few performance entries performance.mark("start"); do_work(50000); performance.mark("stop"); performance.measure("measure-1"); var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("perfentry[" + i + "]"); for (var j=0; j < properties.length; j++) { // check each property in window.performance var supported = pr...
...t, obs) { var perfentries = list.getentries(); // should only have 'mark' entries for (var i=0; i < perfentries.length; i++) { print_perf_entry(perfentries[i]); } }); // subscribe to only the 'mark' event observe_mark.observe({entrytypes: ['mark']}); } function print_perf_entry(pe) { log("name: " + pe.name + "; entrytype: " + pe.entrytype + "; starttime: " + pe.starttime + "; duration: " + pe.duration); } the performance observer entry list interface has the same three getentries*() methods as the performance interface and these methods are used to retrieve observed performance entries within the observer callback.
PeriodicWave - Web APIs
var real = new float32array(2); var imag = new float32array(2); var ac = new audiocontext(); var osc = ac.createoscillator(); real[0] = 0; imag[0] = 0; real[1] = 1; imag[1] = 0; var wave = ac.createperiodicwave(real, imag, {disablenormalization: true}); osc.setperiodicwave(wave); osc.connect(ac.destination); osc.start(); osc.stop(2); this works because a sound that contains only a fundamental tone is by definition a sine wave here, we create a periodicwave with two values.
... the first value is the dc offset, which is the value at which the oscillator starts.
... 0 is good here, because we want to start the curve at the middle of the [-1.0; 1.0] range.
Using the Permissions API - Web APIs
this starts off by querying the permission status using permissions.query().
... revoking permissions starting in firefox 47, you can now revoke existing permissions, using the permissions.revoke() method.
... function revokepermission() { navigator.permissions.revoke({name:'geolocation'}).then(function(result) { report(result.state); }); } the revoke() function has been disabled by default starting in firefox 51, since its design has been brought into question in the web applications security working group.
RTCIceCandidate.usernameFragment - Web APIs
the usernamefragment and password both change every time an ice restart occurs.
... example although the webrtc infrastructure will filter out obsolete candidates for you after an ice restart, you can do it yourself if you're trying to absolutely minimize the number of messages going back and forth.
...to avoid including candidates obsoleted by an ice restart, we can use code like this: const ssnewcandidate = signalmsg => { let candidate = new rtcicecandidate(signalmsg.candidate); let receivers = pc.getreceivers(); receivers.foreach(receiver => { let parameters = receiver.transport.getparameters(); if (parameters.usernamefragment === candidate.usernamefragment) { return; } }); pc.addicecandidate(candidate) .catch(re...
Range() - Web APIs
WebAPIRangeRange
the range() constructor returns a newly created range object whose start and end is the global document object.
... syntax range = new range() example in this example we create a new range with the range() constructor, and set its beginning and end positions using the range.setstartbefore() and range.setendafter() methods.
... html <p>first paragraph.</p> <p>second paragraph.</p> <p>third paragraph.</p> <p>fourth paragraph.</p> javascript const paragraphs = document.queryselectorall('p'); // create new range const range = new range(); // start range at second paragraph range.setstartbefore(paragraphs[1]); // end range at third paragraph range.setendafter(paragraphs[2]); // get window selection const selection = window.getselection(); // add range to window selection selection.addrange(range); result specification specification status comment domthe definition of 'range.range()' in that specification.
Range.collapsed - Web APIs
WebAPIRangecollapsed
the range.collapsed read-only property returns a boolean flag indicating whether the start and end points of the range are at the same position.
... it returns true if the start and end boundary points of the range are the same point in the dom, false if not.
... syntax iscollapsed = range.collapsed; example let range = document.createrange(); range.setstart(startnode, startoffset); range.setend(endnode, endoffset); iscollapsed = range.collapsed; specifications specification status comment domthe definition of 'range.collapsed' in that specification.
Range.endOffset - Web APIs
WebAPIRangeendOffset
if the endcontainer is a node of type text, comment, or cdatasection, then the offset is the number of characters from the start of the endcontainer to the boundary point of the range.
... for other node types, the endoffset is the number of child nodes between the start of the endcontainer and the boundary point of the range.
... syntax endrangeoffset = range.endoffset; example var range = document.createrange(); range.setstart(startnode,startoffset); range.setend(endnode,endoffset); endrangeoffset = range.endoffset; specifications specification status comment domthe definition of 'range.endoffset' in that specification.
Range.insertNode() - Web APIs
WebAPIRangeinsertNode
the range.insertnode() method inserts a node at the start of the range.
... the new node is inserted at the start boundary point of the range.
... syntax range.insertnode(newnode); parameters newnode the node to insert at the start of the range.
ReadableStream.ReadableStream() - Web APIs
underlyingsource can contain the following: start(controller) this is a method, called immediately when the object is constructed.
...the start() function generates a random string of text every second and enqueues it into the stream.
... 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(...
ReadableStreamDefaultController - Web APIs
the start() function generates a random string of text every second and enqueues it into the stream.
... note that a readablestreamdefaultcontroller object is provided as the parameter of the start() and pull() functions.
... 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() { // ...
ReportingObserver - Web APIs
methods reportingobserver.disconnect() stops a reporting observer that had previously started observing from collecting reports.
... reportingobserver.observe() instructs a reporting observer to start collecting reports in its report queue.
... examples in our deprecation_report.html example, we create a simple reporting observer to observe usage of deprecated features on our web page: let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { 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(); later on in the example we deliberately use the deprecated version of mediadevices.getusermedia(): if(navigator.mozgetusermedia) { navigator.mozgetusermedia( constraints, succ...
Reporting API - Web APIs
the callback runs when observation starts an options dictionary that allows you to specify the type of reports to collect, and whether the reports that were generated before the observer was able to be created should be observable (buffered: true).
... methods are then available on the observer to start collecting reports (reportingobserver.observe()), retrieve the reports currently in the report queue (reportingobserver.takerecords()), and disconnect the observer so it can no longer collect records (reportingobserver.disconnect()).
... examples in our deprecation_report.html example, we create a simple reporting observer to observe usage of deprecated features on our web page: let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { 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(); later on in the example we deliberately use the deprecated version of mediadevices.getusermedia(): if(navigator.mozgetusermedia) { navigator.mozgetusermedia( constraints, succ...
Selection.setBaseAndExtent() - Web APIs
syntax sel.setbaseandextent(anchornode,anchoroffset,focusnode,focusoffset) parameters anchornode the node at the start of the selection.
... anchoroffset the number of child nodes from the start of the anchor node that should be excluded from the selection.
... focusoffset the number of child nodes from the start of the focus node that should be included in the selection.
Sensor APIs - Web APIs
} else if (event.error.name === 'notreadableerror' ) { console.log('cannot connect to the sensor.'); } }); accelerometer.addeventlistener('reading', () => reloadonshake(accelerometer)); accelerometer.start(); } catch (error) { // handle construction errors.
... const sensor = new absoluteorientationsensor(); sensor.start(); sensor.onerror = event => { if (event.error.name === 'securityerror') console.log("no permissions to use absoluteorientationsensor."); }; the following table describes for each sensor type, the name required for the permissions api, the <iframe> element's allow attribute and the feature-policy directive.
...nsor = new magnetometer({frequency: 60}); magsensor.addeventlistener('reading', e => { console.log("magnetic field along the x-axis " + magsensor.x); console.log("magnetic field along the y-axis " + magsensor.y); console.log("magnetic field along the z-axis " + magsensor.z); }) magsensor.addeventlistener('error', event => { console.log(event.error.name, event.error.message); }) magsensor.start(); interfaces absoluteorientationsensorsecure context describes the device's physical orientation in relation to the earth's reference coordinate system.
ServiceWorkerGlobalScope - Web APIs
developers should keep in mind that the serviceworker state is not persisted across the termination/restart cycle, so each event handler should assume it's being invoked with a bare, default global state.
...an active service worker is automatically restarted to respond to events, such as serviceworkerglobalscope.onfetch or serviceworkerglobalscope.onmessage.
...therefore it also has the following property available to it: globalfetch.fetch() starts the process of fetching a resource.
SharedWorker - Web APIs
if the onmessage event is attached using addeventlistener, the port is manually started using its start() method: myworker.port.start(); when the port is started, both scripts post messages to the worker and handle messages sent from it using port.postmessage() and port.onmessage, respectively: first.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.port.postme...
...the ports associated with that worker are accessible in the connect event's ports property — we then use messageport start() method to start the port, and the onmessage handler to deal with messages sent from the main threads.
... onconnect = function(e) { var port = e.ports[0]; port.addeventlistener('message', function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); }); port.start(); // required when using addeventlistener.
SpeechSynthesisUtterance - Web APIs
start fired when the utterance has begun to be spoken.
... also available via the onstart property.
... inside the inputform.onsubmit handler, we stop the form submitting with preventdefault(), use the constructor to create a new utterance instance containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method.
StaticRange.StaticRange() - Web APIs
the four required rangespec properties are: startcontainer the node in which the starting point of the range is located.
... startoffset the offset into the starting node at which the first character of the range is found.
... exceptions invalidnodetypeerror a domexception fired if either or both of the startcontainer and/or endcontainer are a type of node which you can't include in a range.
StaticRange - Web APIs
staticrange.collapsed read only returns a boolean value which is true if the range's start and end positions are the same, resulting in a range of length 0.
... staticrange.startcontainer read only returns the dom node which contains the starting point of the range (which is in turn identified by startoffset.
... staticrange.startoffset read only returns an integer value indicating the offset into the node specified by startcontainer at which the first character of the range is located.
Using writable streams - Web APIs
the syntax skeleton looks like this: const stream = new writablestream({ start(controller) { }, write(chunk,controller) { }, close(controller) { }, abort(reason) { } }, { highwatermark, size() }); the constructor takes two objects as parameters.
... the first object can contain up to four members, all of which are optional: start(controller) — a method that is called once, immediately after the writablestream is constructed.
... controllers as you'll have noticed when studying the writablestream() syntax skeleton, the start(), write(), and close() methods can optionally have a controller parameter passed to them.
TextEncoder.prototype.encodeInto() - Web APIs
encode into a specific position encoder.encodeinto always puts its output at the start of the array.
... however, it is sometimes useful to make the output start at a particular index.
...if not, reallocate the target buffer to written + (s.length - read) * 3 and then convert the rest by taking a substring of s starting from index read and a subbuffer of the target buffer starting from index written.
TimeRanges - Web APIs
a timeranges object includes one or more ranges of time, each specified by a starting and ending time offset.
... you reference each time range by using the start() and end() methods, passing the index number of the time range you want to retrieve.
... methods timeranges.start() returns the time for the start of the range with the specified index.
TouchEvent.targetTouches - Web APIs
the targettouches read-only property is a touchlist listing all the touch objects for touch points that are still in contact with the touch surface and whose touchstart event occurred inside the same target element as the current target element.
... syntax var touches = touchevent.targettouches; return value touches a touchlist listing all the touch objects for touch points that are still in contact with the touch surface and whose touchstart event occurred inside the same target element as the current target element.
...the touchevent.targettouches property is a touchlist object that includes those tps that are currently touching the surface and started on the element that is the target of the current event.
TransformStream - Web APIs
const transformcontent = { start() {}, // required.
... const tes = { start(){this.encoder = new textencoder()}, transform(chunk, controller) { controller.enqueue(this.encoder.encode(chunk)) } } let _jstes_wm = new weakmap(); /* info holder */ class jstextencoderstream extends transformstream { constructor() { let t = {...tes} super(t) _jstes_wm.set(this, t) } get encoding() {return _jstes_wm.get(this).encoder.encoding} } similarly, textdecod...
...erstream can be written as such: const tes = { start(){ this.decoder = new textdecoder(this.encoding, this.options) }, transform(chunk, controller) { controller.enqueue(this.decoder.decode(chunk)) } } let _jstds_wm = new weakmap(); /* info holder */ class jstextdecoderstream extends transformstream { constructor(encoding = 'utf-8', {...options} = {}) { let t = {...tds, encoding, options} super(t) _jstes_wm.set(this, t) } get encoding() {return _jstds_wm.get(this).decoder.encoding} get fatal() {return _jstds_wm.get(this).decoder.fatal} get ignorebom() {return _jstds_wm.get(this).decoder.ignorebom} } chaining multiple readablestreams together this is a useful one, where multiple streams can be conjoined.
WebGLRenderingContext - Web APIs
the webgl tutorial has more information, examples, and resources on how to get started with webgl.
...this can be used to start an application using standard 2d presentation, then transition to using a vr or ar mode later.
... webglrenderingcontext.buffersubdata() updates buffer data starting at a passed offset.
WebGL constants - Web APIs
var debuginfo = gl.getextension('webgl_debug_renderer_info'); var vendor = gl.getparameter(debuginfo.unmasked_vendor_webgl); the webgl tutorial has more information, examples, and resources on how to get started with webgl.
...ion vertex_attrib_array_integer 0x88fd vertex_attrib_array_divisor 0x88fe transform feedback constant name value description transform_feedback_buffer_mode 0x8c7f max_transform_feedback_separate_components 0x8c80 transform_feedback_varyings 0x8c83 transform_feedback_buffer_start 0x8c84 transform_feedback_buffer_size 0x8c85 transform_feedback_primitives_written 0x8c88 max_transform_feedback_interleaved_components 0x8c8a max_transform_feedback_separate_attribs 0x8c8b interleaved_attribs 0x8c8c separate_attribs 0x8c8d transform_feedback_buffer 0x8c8e ...
...a9 read_framebuffer_binding 0x8caa renderbuffer_samples 0x8cab framebuffer_attachment_texture_layer 0x8cd4 framebuffer_incomplete_multisample 0x8d56 uniforms constant name value description uniform_buffer 0x8a11 uniform_buffer_binding 0x8a28 uniform_buffer_start 0x8a29 uniform_buffer_size 0x8a2a max_vertex_uniform_blocks 0x8a2b max_fragment_uniform_blocks 0x8a2d max_combined_uniform_blocks 0x8a2e max_uniform_buffer_bindings 0x8a2f max_uniform_block_size 0x8a30 max_combined_vertex_uniform_components 0x8a31 max_combined_fr...
Writing a WebSocket server in C# - Web APIs
methods: start() system.net.sockets.tcpclient accepttcpclient() waits for a tcp connection, accepts it and returns it as a tcpclient object.
... here's a barebones server implementation: ​using system.net.sockets; using system.net; using system; class server { public static void main() { tcplistener server = new tcplistener(ipaddress.parse("127.0.0.1"), 80); server.start(); console.writeline("server has started on 127.0.0.1:80.{0}waiting for a connection...", environment.newline); tcpclient client = server.accepttcpclient(); console.writeline("a client connected."); } } tcpclient methods: system.net.sockets.networkstream getstream() gets the stream which is the communication channel.
...te)(encoded[i] ^ mask[i % 4]); } put together wsserver.cs // // csc wsserver.cs // wsserver.exe using system; using system.net; using system.net.sockets; using system.text; using system.text.regularexpressions; class server { public static void main() { string ip = "127.0.0.1"; int port = 80; var server = new tcplistener(ipaddress.parse(ip), port); server.start(); console.writeline("server has started on {0}:{1}, waiting for a connection...", ip, port); tcpclient client = server.accepttcpclient(); console.writeline("a client connected."); networkstream stream = client.getstream(); // enter to an infinite cycle to be able to handle every change in stream while (true) { while (!stream.dataavai...
Writing WebSocket servers - Web APIs
client handshake request even though you're building a server, a client still has to start the websocket handshake process by contacting the server and requesting a websocket connection.
...once the server sends these headers, the handshake is complete and you can start swapping data!
...client: fin=0, opcode=0x1, msg="and a" server: (listening, new message containing text started) client: fin=0, opcode=0x0, msg="happy new" server: (listening, payload concatenated to previous message) client: fin=1, opcode=0x0, msg="year!" server: (process complete message) happy new year to you too!
Fundamentals of WebXR - Web APIs
as browser developers built support for webvr and allowed developers to experiment, it became clear that in order to finish an api for virtual environments on the web, it would make more sense to start a new specification than to try to "fix" webvr.
...basic headsets typically start around 90° or so, while the best headsets generally have a field of view of around 150°.
... webxr application life cycle starting up and shutting down a webxr session movement, orientation, and motion: a webxr example ...
WebXR Device API - Web APIs
webxr application life cycle an overview of the overall life cycle of a webxr application, from startup to shutdown.
... creating a mixed reality experience starting up and shutting down a webxr session before actually presenting a scene using an xr device such as a headset or goggles, you need to create a webxr session bound to a rendering layer that draws the scene for presentation in each of the xr device's displays so that the 3d effect can be presented to the user.
... rendering and the webxr frame animation callback starting with how you schedule frames to be rendered, this guide then continues to cover how to determine the placement of objects in the view and how to then render them into the webgl buffer used for each of the two eyes' views of the scene.
Background audio processing using AudioWorklet - Web APIs
high level overview before we start looking at the use of audioworklet on a step-by-step basis, let's start with a brief high-level overview of what's involved.
... let's start at the inside and work our way out.
... in order to ensure the context is usable, this starts by creating the context if it's not already available, then adds the module containing the processor to the worklet.
Web Audio API - Web APIs
they typically start with one or more sources.
... web audio api target audience the web audio api can seem intimidating to those that aren't familiar with audio or music terms, and as it incorporates a great deal of functionality it can prove difficult to get started if you are a developer.
... if you are more familiar with the musical side of things, are familiar with music theory concepts, want to start building instruments, then you can go ahead and start building things with the advance tutorial and others as a guide (the above linked tutorial covers scheduling notes, creating bespoke oscillators and envelopes, as well as an lfo among other things.) if you aren't familiar with the programming basics, you might want to consult some beginner's javascript tutorials first and then come back here ...
Window.print() - Web APIs
WebAPIWindowprint
desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetprintchrome full support 1notes full support 1notes notes starting with chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.edge full support 12firefox full support 1ie full support 5opera full support 6notes ...
...full support 6notes notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.safari full support 1.1webview android full support 1notes full support 1notes notes starting with webview 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.chrome android full support 18notes full support 18notes notes starting with chrome 46, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.firefo...
...x android no support nonotes no support nonotes notes see bug 1247609.opera android full support 10.1notes full support 10.1notes notes starting with opera 33, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-modals.safari ios full support 1samsung internet android full support 1.0notes full support 1.0notes notes starting with samsung internet 5.0, this method is blocked inside an <iframe> unless its sandbox attribute has the value allow-mo...
Window.requestAnimationFrame() - Web APIs
the callback function is passed one single argument, a domhighrestimestamp similar to the one returned by performance.now(), indicating the point in time when requestanimationframe() starts to execute callback functions.
...the element moves at a speed of 0.1px/ms to the right, so its relative position (in css pixels) can be calculated in function of the time elapsed since the start of the animation (in milliseconds) with 0.1 * elapsed.
... const element = document.getelementbyid('some-element-you-want-to-animate'); let start; function step(timestamp) { if (start === undefined) start = timestamp; const elapsed = timestamp - start; // `math.min()` is used here to make sure that the element stops at exactly 200px.
Using XMLHttpRequest - Web APIs
note: starting with gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27), synchronous requests on the main thread have been deprecated due to the negative effects to the user experience.
...it starts with "xml" because when it was created the main format that was originally used for asynchronous data exchange were xml handling responses there are several types of response attributes defined by the living standard specification for the xmlhttprequest() constructor.
... note: starting in gecko 9.0, progress events can now be relied upon to come in for every chunk of data received, including the last chunk in cases in which the last packet is received and the connection closed before the progress event is fired.
XRPermissionDescriptor.requiredFeatures - Web APIs
the user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case.
... xrreferencespace local-floor similar to the local type, except the starting position is placed in a safe location for the viewer to stand, where the value of the y axis is 0 at floor level.
... xrreferencespace usage notes examples in this example, permissions are checked to ensure that the user has granted permission for the site or app to use immersive augmented reality mode with the local-floor reference space (presumably since the user is unlikely to start to fly).
XRSession.cancelAnimationFrame() - Web APIs
example in the example below we see code which starts up a webxr session if immersive vr mode is supported.
... once started, the session schedules its first frame to be rendered by calling requestanimationframe().
... const xr = navigator.xr; let requesthandle = null; 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 && requesth...
XRSystem: isSessionSupported() - Web APIs
if no session is already underway, we request the vr session and, if successful, set up the session in a method called onsessionstarted(), not shown.
...ssionsupported('immersive-vr') .then((issupported) => { if (issupported) { userbutton.addeventlistener('click', onbuttonclicked); userbutton.innerhtml = 'enter xr'; userbutton.disabled = false; } }); } function onbuttonclicked() { if (!xrsession) { navigator.xr.requestsession('immersive-vr') .then((session) => { xrsession = session; // onsessionstarted() not shown for reasons of brevity and clarity.
... onsessionstarted(xrsession); }); } else { // button is a toggle button.
XRSystem: requestSession() - Web APIs
xrsession.requestanimationframe(onxranimationframe); }).catch(function(error) { // "immersive-vr" sessions are not supported console.warn("'immersive-vr' isn't supported, or an error occurred activating vr!"); }); verifying webxr support and using a button to start vr mode the following example shows how to use both issessionsupported() and requestsession().
...ed); 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.
... onsessionstarted(xrsession); }); } else { // button is a toggle button.
ARIA: timer role - Accessibility
the timer role indicates to assistive technologies that an element is a numerical counter listing the amount of elapsed time from a starting point or the remaining time until an end point.
... <div id="clock" role="timer" aria-live="off">20</div> <button onclick="starttimer('clock')">start</button> /* basic javascript to update a timer */ function starttimer(timername) { // get the number of seconds let timer = document.getelementbyid(timername), seconds = parseint(timer.innertext); // remove a second // updated the content of timer timer.innertext = --seconds // if timer != 0, settimeout if (seconds) { settimeout( function() { ...
... starttimer(timername); }, 1000); } } the first time the function executes, the entirety of the string that is added will be announced.
ARIA: listbox role - Accessibility
typing one or more letters will navigate the list items (same letter goes to each item starting with that, different letters go to the first item starting with that entire string).
... type-ahead is recommended for all listboxes, especially those with more than seven options: type a character: focus moves to the next item with a name that starts with the typed character.
... type multiple characters in rapid succession: focus moves to the next item with a name that starts with the string of characters typed.
Operable - Accessibility
2.2.2 pausing, stopping, hiding (a) for moving/blinking content that starts automatically, lasts longer than 5 seconds, and is shown alongside other content, controls should be provided to pause, stop, or hide it.
... for auto-updating information that starts automatically and is shown alongside other content, controls should be provided to pause, stop, or hide it, or to control the frequency of updates.
... 2.2.6 timeouts (aaa) added in 2.1 if there is a timeout (caused by user inactivity) warn users at the start of a process so they will not be surprised that a timeout exists (or only allow the timeout to occur after 20 hours of inactivity.
@keyframes - CSS: Cascading Style Sheets
from a starting offset of 0%.
... valid keyframe lists if a keyframe rule doesn't specify the start or end states of the animation (that is, 0%/from and 100%/to), browsers will use the element's existing styles for the start/end states.
... cascading keyframes are supported starting in firefox 14.
Border-radius generator - CSS: Cascading Style Sheets
ener('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, 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", functi...
...on(e) { document.removeeventlistener("mousemove", slidermotion); document.body.style.cursor = "auto"; slider.style.cursor = "pointer"; }); var slidermotion = function slidermotion(e) { slider.style.cursor = "e-resize"; var delta = (e.clientx - startx) / obj.sensivity | 0; var value = delta * obj.step + start_value; setvalue(obj.topic, value); } return slider; } var inputslider = function(node) { var min = node.getattribute('data-min') | 0; var max = node.getattribute('data-max') | 0; var step = node.getattribute('data-step') | 0; var value = node.getattribute('data-value') | 0; var topic = node.getattribute('data-topic'); var unit = node.getattribute('data-unit'); var name = node.getattribute('data-info'); var sensivity = node.getattribute('d...
...adius.init(); }); var borderradius = (function borderradius() { function getelembyid(id) { return document.getelementbyid(id); } /** * shadow dragging */ var previewmousetracking = (function drag() { var active = false; var lastx = 0; var lasty = 0; var subscribers = []; var init = function init(id) { var elem = getelembyid(id); elem.addeventlistener('mousedown', dragstart, false); document.addeventlistener('mouseup', dragend, false); } var dragstart = function dragstart(e) { if (e.button !== 0) return; active = true; lastx = e.clientx; lasty = e.clienty; document.addeventlistener('mousemove', mousedrag, false); } var dragend = function dragend(e) { if (e.button !== 0) return; if (active === true) { active = false; ...
Box-shadow generator - CSS: Cascading Style Sheets
> width) x = width; color.a = (x / width).tofixed(2); // should update just // alpha pointer location updateui(); notify("color", color); } var sethuegfx = function sethuegfx(hue) { var sat = color.saturation; var val = color.value; var alpha = color.a; color.sethsv(hue, 100, 100); gradient_area.style.backgroundcolor = color.gethexa(); color.a = 0; var start = color.getrgba(); color.a = 1; var end = color.getrgba(); color.a = alpha; var gradient = '-moz-linear-gradient(left, ' + start + '0%, ' + end + ' 100%)'; alpha_area.style.background = gradient; } var updateui = function updateui() { var x, y; // coordinates var size; // size of the area var offset; // pointer graphic selector offset // set color pointer loca...
...width; offset = alpha_selector.clientwidth/2; x = (color.a * size) | 0; alpha_selector.style.left = x - offset + "px"; // set picker area background var nc = new color(); nc.copy(color); if (nc.hue === 360) nc.hue = 0; nc.sethsv(nc.hue, 100, 100); gradient_area.style.backgroundcolor = nc.gethexa(); // set alpha area background nc.copy(color); nc.a = 0; var start = nc.getrgba(); nc.a = 1; var end = nc.getrgba(); var gradient = '-moz-linear-gradient(left, ' + start + '0%, ' + end + ' 100%)'; alpha_area.style.background = gradient; // update color info notify("color", color); notify("hue", color.hue); notify("saturation", color.saturation); notify("value", color.value); notify("r", color.r); notify("g", color.g); notify(...
...atealpha); } return { init : init, setcolor : setcolor, subscribe : subscribe, unsubscribe : unsubscribe } })(); /** * shadow dragging */ var previewmousetracking = (function drag() { var active = false; var lastx = 0; var lasty = 0; var subscribers = []; var init = function init(id) { var elem = getelembyid(id); elem.addeventlistener('mousedown', dragstart, false); document.addeventlistener('mouseup', dragend, false); } var dragstart = function dragstart(e) { if (e.button !== 0) return; active = true; lastx = e.clientx; lasty = e.clienty; document.addeventlistener('mousemove', mousedrag, false); } var dragend = function dragend(e) { if (e.button !== 0) return; if (active === true) { active = false; ...
Box alignment in grid layout - CSS: Cascading Style Sheets
to align things on the inline axis you use the properties that start with justify-, justify-content, justify-items and justify-self.
... to align things on the block axis you use the properties that start with align-, align-content, align-items and align-self.
...in this case the item will be aligned to start in both dimensions in order that the image is not distorted.
Using feature queries - CSS: Cascading Style Sheets
we can start by creating that floated layout with the following code, which gives us three columns.
...so we could start enhancing our layout by using css grid.
... summary feature queries can help you start to use newer features by enhancing a simpler display of the site used for older browsers.
Auto-placement in CSS Grid Layout - CSS: Cascading Style Sheets
the auto-placed items will place themselves before the placed items in dom order, they don’t start after the position of a placed item that comes before them.
...what this means is that the start line of the item will be set by auto-placement, and the end line will span two tracks.
...in my example i am allowing auto-placement to place the items, however i have classes that start a dt in column 1, and dd in column 2, this ensure that terms go on one side and definitions on the other - no matter how many of each we have.
CSS Logical Properties and Values - CSS: Cascading Style Sheets
reference properties for sizing block-size inline-size max-block-size max-inline-size min-block-size min-inline-size properties for margins, borders and padding border-block border-block-color border-block-end border-block-end-color border-block-end-style border-block-end-width border-block-start border-block-start-color border-block-start-style border-block-start-width border-block-style border-block-width border-color (logical keyword) border-inline border-inline-color border-inline-end border-inline-end-color border-inline-end-style border-inline-end-width border-inline-start border-inline-start-color border-inline-start-style border-inline-start-width border-inline-...
...style border-inline-width border-start-start-radius border-start-end-radius border-end-start-radius border-end-end-radius border-style (logical keyword) border-width (logical keyword) margin (logical keyword) margin-block margin-block-end margin-block-start margin-inline margin-inline-end margin-inline-start padding (logical keyword) padding-block padding-block-end padding-block-start padding-inline padding-inline-end padding-inline-start properties for floating and positioning clear (inline-end and inline-start keywords) float (inline-end and inline-start keywords) inset inset-block inset-block-end inset-block-start inset-inline inset-inline-end inset-inline-start other properties caption-side (inline-end and inline-start keywords) overflow-b...
...lock overflow-inline overscroll-behavior-block overscroll-behavior-inline resize (block and inline keywords) text-align (end and start keywords) deprecated properties offset-block-end (now inset-block-end ) offset-block-start (now inset-block-start ) offset-inline-end (now inset-inline-end ) offset-inline-start (now inset-inline-start ) guides basic concepts of logical properties and values logical properties for sizing logical properties for margins, borders and padding logical properties for floating and positioning specifications specification status comment css logical properties and values level 1 editor's draft initial definition.
Basic concepts of CSS Scroll Snap - CSS: Cascading Style Sheets
using scroll-snap-align the scroll-snap-align property can take a value of start, end, or center — indicating the point the content should snap to in the scroll container.
...when we snap to the start of the second and third sections, the scrolling stops 40 pixels away from the start of the section.
... the scroll-snap-stop property the scroll-snap-stop property tells the browser whether it should snap to each defined snap point — meaning that in our examples above we would stop at the start of each section — or be able to skip past sections.
CSS values and units - CSS: Cascading Style Sheets
we had a grid area named content we would use it without quotes: .item { grid-area: content; } in comparison, a data type that is a <string>, such as a string value of the content property, must be quoted: .item::after { content: "this is my content."; } while you can generally create any name you want, including using emojis, the identifier can't be none, unset, initial, or inherit, start with a digit or two dashes, and generally you don't want it to be any other pre-defined css keyword.
... left | right | none | inline-start | inline-end such values are used without quotes: .box { float: left; } css-wide values in addition to the pre-defined keywords that are part of the specification for a property, all css properties accept the css-wide property values initial, inherit, and unset, which explicitly specify defaulting behaviors.
...the syntax starts with the name of the function immediately followed by a left parenthesis ( followed by the argument(s) to the notation followed by a right parenthesis ).
Inline formatting context - CSS: Cascading Style Sheets
inline boxes are laid out one after the other, in the direction sentences run in the writing mode in use: in a horizontal writing mode, boxes are laid out horizontally, starting on the left.
... in a vertical writing mode they would be laid out vertically starting at the top.
... note: i am using the logical, flow-relative properties — padding-inline-start rather than padding-left — so that they work in the inline dimension whether the text is horizontal or vertical.
animation-delay - CSS: Cascading Style Sheets
the animation can start later, immediately from its beginning, or immediately and partway through the animation.
...for example, if you specify -1s as the animation delay time, the animation will begin immediately but will start 1 second into the animation sequence.
... if you specify a negative value for the animation delay, but the starting value is implicit, the starting value is taken from the moment the animation is applied to the element.
appearance (-moz-appearance, -webkit-appearance) - CSS: Cascading Style Sheets
starting with gecko/firefox 80, these uses were changed to -moz-default-appearance, which should never be used outside of internal stylesheets.
... scalethumbend div { color: black; -moz-appearance: scalethumbend; -webkit-appearance: scalethumbend; } <div>lorem</div> firefox scalethumb-horizontal div { color: transparent; -moz-appearance: scalethumb-horizontal; -webkit-appearance: scalethumb-horizontal; } <div>lorem</div> firefox scalethumbstart div { color: black; -moz-appearance: scalethumbstart; -webkit-appearance: scalethumbstart; } <div>lorem</div> firefox scalethumbtick div { color: black; -moz-appearance: scalethumbtick; -webkit-appearance: scalethumbtick; } <div>lorem</div> firefox scalethumb-vertical div { color: black; -moz...
...available on the web starting in ios 10.1 and macos 10.12.1 obsolete values the following values were at some point implemented for a prefixed property, but are no longer supported.
flex-wrap - CSS: Cascading Style Sheets
WebCSSflex-wrap
the cross-start is either equivalent to start or before depending on the flex-direction value.
...the cross-start is either equivalent to start or before depending flex-direction value and the cross-end is the opposite of the specified cross-start.
... wrap-reverse behaves the same as wrap but cross-start and cross-end are permuted.
grid-column-end - CSS: Cascading Style Sheets
if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid.
... span && [ <integer> || <custom-ident> ] contributes a grid span to the grid item’s placement such that the column end edge of the grid item’s grid area is n lines from the start edge.
...n && [ <integer> | <custom-ident> ] ] examples setting column end for a grid item html <div class="wrapper"> <div class="box1">one</div> <div class="box2">two</div> <div class="box3">three</div> <div class="box4">four</div> <div class="box5">five</div> </div> css .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 100px; } .box1 { grid-column-start: 1; grid-column-end: 4; grid-row-start: 1; grid-row-end: 3; } .box2 { grid-column-start: 1; grid-row-start: 3; grid-row-end: 5; } * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f;...
grid-row-end - CSS: Cascading Style Sheets
if a negative integer is given, it instead counts in reverse, starting from the end edge of the explicit grid.
... span && [ <integer> || <custom-ident> ] contributes a grid span to the grid item’s placement such that the row end edge of the grid item’s grid area is n lines from the start edge.
...span && [ <integer> | <custom-ident> ] ] examples setting row end for a grid item html <div class="wrapper"> <div class="box1">one</div> <div class="box2">two</div> <div class="box3">three</div> <div class="box4">four</div> <div class="box5">five</div> </div> css .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 100px; } .box1 { grid-column-start: 1; grid-column-end: 4; grid-row-start: 1; grid-row-end: 3; } .box2 { grid-column-start: 1; grid-row-start: 3; grid-row-end: 5; } * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f;...
inset-block - CSS: Cascading Style Sheets
the inset-block css property defines the logical block start and end offsets of an element, which maps to physical offsets depending on the element's writing mode, directionality, and text orientation.
... /* <length> values */ inset-block: 3px 10px; inset-block: 2.4em 3em; inset-block: 10px; /* value applied to start and end */ /* <percentage>s of the width or height of the containing block */ inset-block: 10% 5%; /* keyword value */ inset-block: auto; /* global values */ inset-block: inherit; inset-block: initial; inset-block: unset; constituent properties this property is a shorthand for the following css properties: inset-block-end inset-block-start syntax values the inset-block property takes the same values as the left property.
... formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-height of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'>{1,2} examples setting block start and end offsets html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; position: relative; inset-block: 20px 50px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'inset-block' in that specification.
inset-inline - CSS: Cascading Style Sheets
the inset-inline css property defines the logical start and end offsets of an element in the inline direction, which maps to physical offsets depending on the element's writing mode, directionality, and text orientation.
... /* <length> values */ inset-inline: 3px 10px; inset-inline: 2.4em 3em; inset-inline: 10px; /* value applied to start and end */ /* <percentage>s of the width or height of the containing block */ inset-inline: 10% 5%; /* keyword value */ inset-inline: auto; /* global values */ inset-inline: inherit; inset-inline: initial; inset-inline: unset; constituent properties this property is a shorthand for the following css properties: inset-inline-end inset-inline-start syntax values the inset-inline property takes the same values as the left property.
... formal definition initial valueautoapplies topositioned elementsinheritednopercentageslogical-width of containing blockcomputed valuesame as box offsets: top, right, bottom, left properties except that directions are logicalanimation typea length, percentage or calc(); formal syntax <'top'>{1,2} examples setting inline start and end offsets html <div> <p class="exampletext">example text</p> </div> css div { background-color: yellow; width: 120px; height: 120px; } .exampletext { writing-mode: vertical-lr; position: relative; inset-inline: 20px 50px; background-color: #c8c800; } result specifications specification status comment css logical properties and values level 1the definition of 'inset-inline' in that specification.
padding-block - CSS: Cascading Style Sheets
the padding-block css shorthand property defines the logical block start and end padding of an element, which maps to physical padding properties depending on the element's writing mode, directionality, and text orientation.
... /* <length> values */ padding-block: 10px 20px; /* an absolute length */ padding-block: 1em 2em; /* relative to the text size */ padding-block: 10px; /* sets both start and end values */ /* <percentage> values */ padding-block: 5% 2%; /* relative to the nearest block container's width */ /* global values */ padding-block: inherit; padding-block: initial; padding-block: unset; these values corresponds to the padding-top and padding-bottom, or padding-right, and padding-left property depending on the values defined for writing-mode, direction, and text-orientation.
... constituent properties this property is a shorthand for the following css properties: padding-block-end padding-block-start syntax values the padding-block property takes the same values as the padding-left property.
repeating-conic-gradient() - CSS: Cascading Style Sheets
the colors transition as as if spun around the center of a circle, starting at the top if no from <angle> is declared, and going clockwise for the the size of the angle that is the different between the largest and smallest color angle, then repeating.
...the colors of the gradient are determined by the angled color stops, their starting points, ending points, and, in between, and optional angled color-stop points.
...rather, the starting point is the first color stop declared, and the last color stop is the last color stop angle declared..
scroll-margin - CSS: Cascading Style Sheets
the child elements are styled as follows: .scroller > div { flex: 0 0 250px; width: 250px; background-color: #663399; color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; scroll-snap-align: start; } .scroller > div:nth-child(2n) { background-color: #fff; color: #663399; } the most relevant part here is scroll-snap-align: start, which specifies that the left-hand edges (the "starts" along the x axis, in our case) are the designated snap points.
... note: here we are setting scroll-margin on all sides at once, but only the start edge is really relevant.
... it would work just as well here to only set a scroll margin on that one edge, for example with scroll-margin-inline-start: 1rem, or scroll-margin: 0 0 0 1rem.
scroll-snap-align - CSS: Cascading Style Sheets
syntax /* keyword values */ scroll-snap-align: none; scroll-snap-align: start end; /* when two values set first is block, second inline */ scroll-snap-align: center; /* global values */ scroll-snap-align: inherit; scroll-snap-align: initial; scroll-snap-align: unset; values none the box does not define a snap position in that axis.
... start the start alignment of this box's scroll snap area, within the scroll container's snapport is a snap position in this axis.
... formal definition initial valuenoneapplies toall elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax [ none | start | end | center ]{1,2} specifications specification status comment css scroll snap module level 1the definition of 'scroll-snap-align' in that specification.
text-align-last - CSS: Cascading Style Sheets
syntax /* keyword values */ text-align-last: auto; text-align-last: start; text-align-last: end; text-align-last: left; text-align-last: right; text-align-last: center; text-align-last: justify; /* global values */ text-align-last: inherit; text-align-last: initial; text-align-last: unset; values auto the affected line is aligned per the value of text-align, unless text-align is justify, in which case the effect is the same as setting text-align-last to start.
... start the same as left if direction is left-to-right and right if direction is right-to-left.
... formal definition initial valueautoapplies toblock containersinheritedyescomputed valueas specifiedanimation typediscrete formal syntax auto | start | end | left | right | center | justify examples justifying the last line <p>integer elementum massa at nulla placerat varius.
transition-delay - CSS: Cascading Style Sheets
the transition-delay css property specifies the duration to wait before starting a property's transition effect when its value changes.
... a positive value will delay the start of the transition effect for the given length of time.
... syntax /* <time> values */ transition-delay: 3s; transition-delay: 2s, 4ms; /* global values */ transition-delay: inherit; transition-delay: initial; transition-delay: unset; values <time> denotes the amount of time to wait between a property's value changing and the start of the transition effect.
Index - Developer guides
WebGuideIndex
4 getting started ajax, api, advanced, javascript, webmechanics, xmlhttprequest this article guides you through the ajax basics and gives you some simple hands-on examples to get you started.
...this is a fairly complex and nascent subject with a lot of variables, so in this article, we'll introduce you to the subject and let you know how you can get started.
... 29 index guide, index found 31 pages: 30 introduction to web development beginner, css, codingscripting, development, html, javascript, web whether you're just getting started with web development, or are just expanding your horizons into new realms of web awesomeness, the links here should help you get started.
User input and controls - Developer guides
if you want to use touch events, you need to add event listeners and specify handler functions, which will be called when the event gets fired: element.addeventlistener("touchstart", handlestart, false);
 element.addeventlistener("touchcancel", handlecancel, false);
 element.addeventlistener("touchend", handleend, false);
 element.addeventlistener("touchmove", handlemove, false); where element is the dom element you want to register the touch events on.
... <div draggable="true" ondragstart="event.datatransfer.setdata('text/plain', 'this text may be dragged')">
 this text <strong>may</strong> be dragged.
... 
</div> in which we: set the draggable attribute to true on the element that you wish to make draggable add a listener for the dragstart event and set the drag data within this listener note: you can find more information in the mdn drag & drop documentation.
<body>: The Document Body element - HTML: Hypertext Markup Language
WebHTMLElementbody
tag omission the start tag may be omitted if the first thing inside it is not a space character, comment, <script> element or <style> element.
... the end tag may be omitted if the <body> element has contents or has a start tag, and is not immediately followed by a comment.
... onhashchange function to call when the fragment identifier part (starting with the hash ('#') character) of the document's current address has changed.
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
WebHTMLElementinput
if they aren't grouped together in source order, if one of the group is checked, tabbing into the group starts when the first one in the group is encountered, skipping all those that aren't checked.
... for the input types whose domain of possible values is periodic (that is, at the highest possible value, the values wrap back around to the beginning rather than ending), it's possible for the values of the max and min properties to be reversed, which indicates that the range of permitted values starts at min, wraps around to the lowest possible value, then continues on until max is reached.
... tag omission must have a start tag and must not have an end tag.
HTML elements reference - HTML: Hypertext Markup Language
WebHTMLElement
<listing> the html listing element (<listing>) renders text between the start and end tags without interpreting the html in between and using a monospaced font.
... <plaintext> the html plaintext element (<plaintext>) renders everything following the start tag as raw text, ignoring any following html.
... <xmp> the html example element (<xmp>) renders text between the start and end tags without interpreting the html in between and using a monospaced font.
HTML: Hypertext Markup Language
WebHTML
get started beginner's tutorials our html learning area features multiple modules that teach html from the ground up — no previous knowledge required.
...this module gets you started with creating the client-side/front-end parts of forms.
... preloading content with rel="preload" the preload value of the <link> element's rel attribute allows you to write declarative fetch requests in your html <head>, specifying resources that your pages will need very soon after loading, which you therefore want to start preloading early in the lifecycle of a page load, before the browser's main rendering machinery kicks in.
Link prefetching FAQ - HTTP
starting in gecko 1.9.1 (firefox 3.5), https content can be prefetched.
...from this, we receive document start & stop notifications, and we approximate idle time as the period between the last document stop and the next document start.
... yes, only http:// (and, starting in gecko 1.9.1 https://) urls can be prefetched.
Proxy Auto-Configuration (PAC) file - HTTP
examples proxy w3proxy.netscape.com:8080; proxy mozilla.netscape.com:8081 primary proxy is w3proxy:8080; if that goes down start using mozilla:8081 until the primary proxy comes up again.
... proxy w3proxy.netscape.com:8080; proxy mozilla.netscape.com:8081; direct same as above, but if both proxies go down, automatically start making direct connections.
...as an example, to set different proxies based on the protocol the startswith() function can be used: function findproxyforurl(url, host) { if (url.startswith("http:")) return "proxy http-proxy.mydomain.com:8080"; else if (url.startswith("ftp:")) return "proxy ftp-proxy.mydomain.com:8080"; else if (url.startswith(“gopher:")) return "proxy gopher-proxy.mydomain.com:8080"; else if (url.startswith("https:") || url.startswith("snews:")) retu...
Introduction - JavaScript
if you are new to javascript, start with the articles in the learning area and the javascript guide.
... getting started with javascript getting started with javascript is easy: all you need is a modern web browser.
... hello world to get started with writing javascript, open the web console in multi-line mode, and write your first "hello world" javascript code: (function(){ "use strict"; /* start of your code */ function greetme(yourname) { alert('hello ' + yourname); } greetme('world'); /* end of your code */ })(); press cmd+enter or ctrl+enter (or click the run button) to watch it unfold in your browser!
Character classes - JavaScript
do not start matching in the middle of a word) // \d{4} indicates a digit, four times // \b indicates another boundary (i.e.
... do not end matching in the middle of a word) console.table(randomdata.match(regexpfourdigits)); // ['8787', '3512', '8735'] looking for a word (from the latin alphabet) starting with a var aliceexcerpt = "i’m sure i’m not ada,’ she said, ‘for her hair goes in such long ringlets, and mine doesn’t go in ringlets at all."; var regexpwordstartingwitha = /\b[aa]\w+/g; // \b indicates a boundary (i.e.
... do not start matching in the middle of a word) // [aa] indicates the letter a or a // \w+ indicates any character *from the latin alphabet*, multiple times console.table(aliceexcerpt.match(regexpwordstartingwitha)); // ['ada', 'and', 'at', 'all'] looking for a word (from unicode characters) instead of the latin alphabet, we can use a range of unicode characters to identify a word (thus being able to deal with text in other languages like russian or arabic).
Regular expressions - JavaScript
'dbbd' myre lastindex the index at which to start the next match.
... regexp.prototype.unicode y perform a "sticky" search that matches starting at the current position in the target string.
...if the m flag is used, ^ and $ match at the start or end of any line within the input string instead of the start or end of the entire string.
Using Promises - JavaScript
chaining a common need is to execute two or more asynchronous operations back to back, where each subsequent operation starts when the previous operation succeeds, with the result from the previous step.
...you can capture these for analysis and handling by your code—or just to avoid having them cluttering up your output—by adding a handler for the unhandledrejection event, like this: window.addeventlistener("unhandledrejection", event => { /* you might start here by adding code to examine the promise specified by event.promise and the reason in event.reason */ event.preventdefault(); }, false); by calling the event's preventdefault() method, you tell the javascript runtime not to do its default action when rejected promises go unhandled.
... we can start operations in parallel and wait for them all to finish like this: promise.all([func1(), func2(), func3()]) .then(([result1, result2, result3]) => { /* use result1, result2 and result3 */ }); sequential composition is possible using some clever javascript: [func1, func2, func3].reduce((p, f) => p.then(f), promise.resolve()) .then(result3 => { /* use result3 */ }); basically, we reduce an arr...
Warning: String.x is deprecated; use String.prototype.x instead - JavaScript
string generics have been removed starting with firefox 68.
...warning: string.replace is deprecated; use string.prototype.replace instead warning: string.search is deprecated; use string.prototype.search instead warning: string.slice is deprecated; use string.prototype.slice instead warning: string.split is deprecated; use string.prototype.split instead warning: string.startswith is deprecated; use string.prototype.startswith instead warning: string.substr is deprecated; use string.prototype.substr instead warning: string.substring is deprecated; use string.prototype.substring instead warning: string.tolocalelowercase is deprecated; use string.prototype.tolocalelowercase instead warning: string.tolocaleuppercase is ...
... we could also build the array of methods with the following, but the // getownpropertynames() method is non-shimable: // object.getownpropertynames(string).filter(function(methodname) { // return typeof string[methodname] === 'function'; // }); methods = [ 'contains', 'substring', 'tolowercase', 'touppercase', 'charat', 'charcodeat', 'indexof', 'lastindexof', 'startswith', 'endswith', 'trim', 'trimleft', 'trimright', 'tolocalelowercase', 'normalize', 'tolocaleuppercase', 'localecompare', 'match', 'search', 'slice', 'replace', 'split', 'substr', 'concat', 'localecompare' ], methodcount = methods.length, assignstringgeneric = function(methodname) { var method = string.prototype[methodname]; string[methodname] = functio...
Object.prototype.constructor - JavaScript
function parentwithstatic() {} parentwithstatic.startposition = { x: 0, y:0 } // static member property parentwithstatic.getstartposition = function getstartposition() { return this.startposition } function child(x, y) { this.position = { x: x, y: y } } child = object.assign(parentwithstatic) child.prototype = object.create(parentwithstatic.prototype) child.prototype.constructor = child child.prototype.getoffsetbyinitialposition = f...
...unction getoffsetbyinitialposition() { let position = this.position let startposition = this.constructor.getstartposition() // error undefined is not a function, since the constructor is child return { offsetx: startposition.x - position.x, offsety: startposition.y - position.y } }; for this example we need either to stay parent constructor to continue to work properly or reassign static properties to child's constructor: ...
... let startposition = this.constructor.parentconstructor.getstartposition() ...
RegExp - JavaScript
flags in constructor starting with ecmascript 6, new regexp(/ab+c/, 'i') no longer throws a typeerror ("can't supply flags when constructing one regexp from another") when the first argument is a regexp and the second flags argument is present.
... regexp.lastindex the index at which to start the next match.
... using regular expression on multiple lines let s = 'please yes\nmake my day!' s.match(/yes.*day/); // returns null s.match(/yes[^]*day/); // returns ["yes\nmake my day"] using a regular expression with the sticky flag the sticky flag indicates that the regular expression performs sticky matching in the target string by attempting to match starting at regexp.prototype.lastindex.
String.prototype.anchor() - JavaScript
the anchor() method creates a string beginning with an <a name="..."> start tag, then some text, and then an </a> end tag.
... syntax str.anchor(name) parameters name a string representing a name value to put into the generated <a name="..."> start tag.
... return value a string beginning with an <a name="name"> start tag, then the text str, and then an </a> end tag description don't use this method.
String.prototype.matchAll() - JavaScript
return value an iterator (which is not a restartable iterable).
... examples regexp.exec() and matchall() prior to the addition of matchall to javascript, it was possible to use calls to regexp.exec (and regexes with the /g flag) in a loop to obtain all the matches: const regexp = regexp('foo[a-z]*','g'); const str = 'table football, foosball'; let match; while ((match = regexp.exec(str)) !== null) { console.log(`found ${match[0]} start=${match.index} end=${regexp.lastindex}.`); // expected output: "found football start=6 end=14." // expected output: "found foosball start=16 end=24." } with matchall available, you can avoid the while loop and exec with g.
... instead, by using matchall, you get an iterator to use with the more convenient for...of, array spread, or array.from() constructs: const regexp = regexp('foo[a-z]*','g'); const str = 'table football, foosball'; const matches = str.matchall(regexp); for (const match of matches) { console.log(`found ${match[0]} start=${match.index} end=${match.index + match[0].length}.`); } // expected output: "found football start=6 end=14." // expected output: "found foosball start=16 end=24." // matches iterator is exhausted after the for..of iteration // call matchall again to create a new iterator array.from(str.matchall(regexp), m => m[0]); // array [ "football", "foosball" ] matchall will throw an exception if the g flag is missing.
String.prototype.slice() - JavaScript
let str = 'the morning is upon us.' str.slice(-3) // returns 'us.' str.slice(-3, -1) // returns 'us' str.slice(0, -1) // returns 'the morning is upon us' this example counts backwards from the end of the string by 11 to find the start index and forwards from the start of the string by 16 to find the end index.
... console.log(str.slice(-11, 16)) // => "is u" here it counts forwards from the start by 11 to find the start index and backwards from the end by 7 to find the end index.
... console.log(str.slice(11, -7)) // => " is u" these arguments count backwards from the end by 5 to find the start index and backwards from the end by 1 to find the end index.
Uint8Array - JavaScript
uint8array.prototype.byteoffset returns the offset (in bytes) of the uint8array from the start of its arraybuffer.
... uint8array.prototype.fill() fills all the elements of an array from a start index to an end index with a static value.
... uint8array.prototype.subarray() returns a new uint8array from the given start and end element index.
Animation performance and frame rate - Web Performance
it looks like this: it has two controls: a button to start/stop the animation, and a radio group to choose to animate using margin, or to animate using transform.
... there's also a video version of this walkthrough: animating using margin leaving the "use margin" option set, start the animation, open the performance tool, and make a recording.
...we're averaging nearly 60fps, and apart from one dip near the start, we're getting a consistently high frame rate.
CSS and JavaScript animation performance - Web Performance
even if an element is in the middle of a transition, the new transition starts from the current style immediately instead of jumping to the end css state.
... css animations, on the other hand, allow developers to make animations between a set of starting property values and a final set rather than between two states.
... css animations consist of two components: a style describing the css animation, and a set of key frames that indicate the start and end states of the animation's style, as well as possible intermediate points.
Add to Home screen - Progressive web apps (PWAs)
the most relevant one to a2hs is the splash screen displayed when the app icon on the home screen is tapped and it first starts to load (this currently appears only when apps have been added to the home screen by chrome).
... start_url: provides a path to the asset that should be loaded when the added-to-home screen app is launched.
...hey, at least it isn't cats.", "display": "fullscreen", "icons": [ { "src": "icon/fox-icon.png", "sizes": "192x192", "type": "image/png" } ], "name": "awesome fox pictures", "short_name": "foxes", "start_url": "/pwa-examples/a2hs/index.html" } appropriate icon as shown in the above manifest listing, we are including a 192 x 192 px icon for use in our app.
Media - Progressive web apps (PWAs)
this is the 14th and last section of part i of the css getting started tutorial.
... in css, you can use @import at the start of a stylesheet to import another stylesheet from a url, optionally specifying the media type.
... example this rule sets the page margins to one inch on all four sides: @page {margin: 1in;} this rule ensures that every h1 element starts on a new page: h1 {page-break-before: always;} more details for full details of css support for paged media, see paged media in the css specification.
SVG Presentation Attributes - SVG: Scalable Vector Graphics
rofile color-rendering cursor direction display dominant-baseline enable-background fill fill-opacity fill-rule filter flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-orientation-horizontal glyph-orientation-vertical image-rendering kerning letter-spacing lighting-color marker-end marker-mid marker-start mask opacity overflow pointer-events shape-rendering solid-color solid-opacity stop-color stop-opacity stroke stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering transform unicode-bidi vector-effect visibility word-spacing writing-mode attributes alignment-baselin...
... value: <funciri>|none|inherit; animatable: yes marker-start it defines the arrowhead or polymarker that will be drawn at the first vertex of the given <path> element or basic shape.
... value: start|middle|end|inherit; animatable: yes text-decoration sets the appearance of decorative lines on text.
x1 - SVG: Scalable Vector Graphics
WebSVGAttributex1
two elements are using this attribute: <line>, and <lineargradient> html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <line x1="1" x2="5" y1="1" y2="9" stroke="red" /> <line x1="5" x2="5" y1="1" y2="9" stroke="green" /> <line x1="9" x2="5" y1="1" y2="9" stroke="blue" /> </svg> line for <line>, x1 defines the x coordinate of the starting point of the line.
...fault value 0 animatable yes example html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <line x1="1" x2="5" y1="1" y2="9" stroke="red" /> <line x1="5" x2="5" y1="1" y2="9" stroke="green" /> <line x1="9" x2="5" y1="1" y2="9" stroke="blue" /> </svg> lineargradient for <lineargradient>, x1 defines the x coordinate of the starting point of the gradient vector used to map the gradient stop values.
... the exact behavior of this attribute is influenced by the gradientunits attributs value <length> | <percentage> default value 0% animatable yes example html,body,svg { height:100% } <svg viewbox="0 0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- by default the gradient vector start at the left bounding limit of the shape it is applied to --> <lineargradient x1="0%" id="g0"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="1" y="1" width="8" height="8" fill="url(#g0)" /> <!-- here the gradient vector start at 80% of the left bounding limit of the shape it is applied to --> <lineargradient x1="80%" id="g1"> <stop offset="0" stop-color="black" /...
<linearGradient> - SVG: Scalable Vector Graphics
value type: <url> ; default value: none; animatable: yes spreadmethod this attribute indicates how the gradient behaves if it starts or ends inside the bounds of the shape containing the gradient.
... value type: pad|reflect|repeat ; default value: pad; animatable: yes x1 this attribute defines the x coordinate of the starting point of the vector gradient along which the linear gradient is drawn.
... value type: <iri> ; default value: none; animatable: yes y1 this attribute defines the y coordinate of the starting point of the vector gradient along which the linear gradient is drawn.
Introduction - SVG: Scalable Vector Graphics
starting from there, the svg image can become arbitrarily complex.
... before you start there are a number of drawing applications available such as inkscape which are free and use svg as their native file format.
... before starting you should have a basic understanding of xml or another markup language such as html.
Patterns - SVG: Scalable Vector Graphics
WebSVGTutorialPatterns
there are also x and y attributes available if you want to offset the start point of this rectangle somewhere within your drawing.
...the pattern also had to be offset by 10 pixels so that it would start in the upper-left corner of our box, so the x and y attributes of the pattern had to be adjusted to 10÷200 = 0.05.
...atterncontentunits="objectboundingbox"> <rect x="0" y="0" width=".25" height=".25" fill="skyblue"/> <rect x="0" y="0" width=".125" height=".125" fill="url(#gradient2)"/> <circle cx=".125" cy=".125" r=".1" fill="url(#gradient1)" fill-opacity="0.5"/> </pattern> now, because the pattern content is in the same unit system as the pattern, we don't have to offset the box so that the pattern starts in the correct place, and if the object size was changed to a larger one, the pattern would automatically scale so that it had the same number of objects and repeats inside it.
mimeTypes.rdf corruption - SVG: Scalable Vector Graphics
the latter is more common, so we'll start with that.
...one way to check is to create a new profile and restart mozilla using that profile.
... microsoft windows one way to fix this in microsoft windows is to start regedit (start > run > regedit) and search for "svg".
Transport Layer Security - Web security
a tls connection starts with a handshake phase where a client and server agree on a shared secret and important parameters, like cipher suites, are negotiated.
...uring your site, mozilla provides a helpful tls configuration generator that will generate configuration files for the following web servers: apache nginx lighttpd haproxy amazon web services cloudformation elastic load balancer using the configurator is a recommended way to create the configuration to meet your needs; then copy and paste it into the appropriate file on your server and restart the server to pick up the changes.
... tls handshake timeout values if the tls handshake starts to become slow or unresponsive for some reason, the user's experience can be affected significantly.
substring - XPath
syntax substring(string ,start [,length] ) arguments string the string to evaluate.
... start the position withinstring the substring begins length(optional) the length of the substring.
... if omitted, the returned string will contain every character from thestart position to the end ofstring.
WebAssembly Concepts - WebAssembly
there are a number of online wasm assembler choices, such as: wasmfiddle wasmfiddle++ wasmexplorer these are great resources for people who are trying to figure out where to start, but they lack some of the tooling and optimizations of emscripten.
...for a start, emscripten implements popular c/c++ libraries like sdl, opengl, openal, and parts of posix.
...you can get started with installing the necessary toolchain, compiling a sample rust program to a webassembly npm package, and using that in a sample web app, over at our compiling from rust to webassembly article.
Compiling an Existing C Module to WebAssembly - WebAssembly
that's a pretty good starting point.
... $ git clone https://github.com/webmproject/libwebp to start off simple, expose webpgetencoderversion() from encode.h to javascript by writing a c file called webp.c: #include "emscripten.h" #include "src/webp/encode.h" emscripten_keepalive int version() { return webpgetencoderversion(); } this is a good simple program to test whether you can get the source code of libwebp to compile, as it doesn't require any parameters or complex data structures to invoke this function.
...after exposing the function to javascript using cwrap, you can use that number to find the start of our buffer and copy the image data: const api = { version: module.cwrap('version', 'number', []), create_buffer: module.cwrap('create_buffer', 'number', ['number', 'number']), destroy_buffer: module.cwrap('destroy_buffer', '', ['number']), }; const image = await loadimage('./image.jpg'); const p = api.create_buffer(image.width, image.height); module.heap8.set(image.data, p); // ...
page-mod - Archive of obsolete content
the option takes a single string that may take any one of the following values: "start": load content scripts immediately after the document element is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) has been loaded, at the time the window.onload event fires var pagemod = r...
...equire("sdk/page-mod"); pagemod.pagemod({ include: "*", contentscript: 'window.alert("matched!");', contentscriptwhen: "start" }); if you specify "start" for contentscriptwhen, your scripts will not be able to interact with the document's dom right away (although they could listen for window.onload or domcontentloaded themselves).
page-worker - Archive of obsolete content
this may take one of the following values: "start": load content scripts immediately after the document element for the page is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the page has been loaded, at the time the window.onloa...
...this may have one of the following values: "start": load content scripts immediately after the document element for the page is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the page has been loaded, at the time the window.onload event ...
High-Level APIs - Archive of obsolete content
simple-prefs store preferences across application restarts.
... simple-storage lets an add-on store data so that it's retained across firefox restarts.
content/symbiont - Archive of obsolete content
this may take one of the following values: "start": load content scripts immediately after the document element for the page is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the page has been loaded, at the time the window.onloa...
...this may have one of the following values: "start": load content scripts immediately after the document element for the page is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the page has been loaded, at the time the window.onload event ...
loader/sandbox - Archive of obsolete content
evaluate code module provides evaluate function that lets you execute code in the given sandbox: evaluate(scope, 'var a = 5;'); evaluate(scope, 'a + 2;'); //=> 7 more details about evaluated script may be passed via optional arguments that may improve exception reporting: // evaluate code as if it was loaded from 'http://foo.com/bar.js' and // start from 2nd line.
... line : number evaluate the code starting at this line.
Storing annotations - Archive of obsolete content
you should see something like this: restart firefox, right-click the widget again, and check that the annotation is still there.
...if the annotation does not reappear when you restart firefox, double check you installed the add-on and didn't just use cfx run again.
Listening for Load and Unload - Archive of obsolete content
it is loaded when it is installed, when it is enabled, or when firefox starts.
... options.loadreason options.loadreason is one of the following strings describing the reason your add-on was loaded: install enable startup upgrade downgrade exports.onunload() if your add-on exports a function called onunload(), that function will be called when the add-on is unloaded.
Unit Testing - Archive of obsolete content
what happens here is that jpm test: looks in the test directory of your package loads any modules whose names start with the word test- (note the hyphen after "test" in the module name.
... jpm test will include a module called "test-mycode.js", but will exclude modules called "test_mycode.js" or "testmycode.js".) calls each exported function whose name starts with "test", passing it an assert object as its only argument.
Tutorials - Archive of obsolete content
getting started installation how to install the jpm tool, which you will use for developing add-ons.
... getting started walkthrough of creating a simple add-on with the sdk, using jpm.
Add-on SDK - Archive of obsolete content
tutorials getting started how to install the sdk and use the jpm tool to develop, test, and package add-ons.
... guides contributor's guide learn how to start contributing to the sdk and about the most important idioms used in the sdk code such as modules, classes and inheritance, private properties, and content processes.
Boxes - Archive of obsolete content
mmm"/> <label value="nnn"/> <label value="ooo"/> <label value="ppp"/> <label value="qqq"/> <label value="rrr"/> <label value="sss"/> <label value="ttt"/> <label value="uuu"/> <label value="vvv"/> <label value="www"/> <label value="xxx"/> <label value="yyy"/> <label value="zzz"/> </hbox> </window> images if you put image in the contents, you should probably add align="start" attribute to the box.
... this keeps the image from stretching inside the box: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <box align="start" style="display:block"> <image src="chrome://global/skin/icons/error.png" style="padding:5px"/> <textbox /> <image src="chrome://global/skin/icons/error.png" style="padding:5px"/> <button label="hello"/> <image src="chrome://global/skin/icons/error.png" style="padding:5px"/> </box> </window> ...
Finding window handles - Archive of obsolete content
note: starting in gecko 17.0, nsibasewindow.nativehandle provides the handle (hwnd [widows], gdkwindow* [linux], nswindow* [macosx],...) of a top-level window, for all plateforms, as a string.
... note: starting in gecko 2.0, only the top level browser window has an hwnd.
Sidebar - Archive of obsolete content
// toggle the bookmarks sidebar (close it if it's open or // open it if it's currently closed) sidebarui.toggle("viewbookmarkssidebar"); // show the history sidebar, whether it's hidden or already showing sidebarui.show("viewhistorysidebar"); // hide the sidebar, if one is showing sidebarui.hide(); avoid opening the sidebar on startup.
... users have been known to complain about this "feature", and if two or more extensions try to open their sidebars on startup, the user will see a flurry of sidebars opening and closing with which ever extension going last "winning".
Windows - Archive of obsolete content
you could improve this code by checking the event.target element and only setting the startpos if the element matches some criteria.
... example var startpos = null; function mousedown(event) { startpos = [event.clientx, event.clienty]; } function mousemove(event) { if (startpos) { var newx = event.screenx - startpos[0]; var newy = event.screeny - startpos[1]; window.moveto(newx, newy); } } function mouseup(event) { startpos = null; } window.addeventlistener("mousedown", mousedown, false); window.addeventlistener("mouseup", mouseup, false); window.addeventlistener("mousemove", mousemove, false); xul titlebar element xul applications can take advantage of the titlebar element to achieve a similar result without extra javascript code.
Communication between HTML and your extension - Archive of obsolete content
next i started investigating events, there are only a handful of events and the w3c documentation is pretty complete.
...i started to research custom events on google but everything that i found was far too complicated for what i wanted to achieve.
Deploying a Plugin as an Extension - Archive of obsolete content
you'll have to restart firefox so the plugin will be available.
... after restarting firefox, the extension manager will include an entry for the rhapsody player engine.
Extension Etiquette - Archive of obsolete content
the mozilla extensions (inspector/reporter/talkback) believe starting with a verb is the best way.
... preferences' internal names internal firefox preference names for extensions or to be clear, the name of the preference as it appears in the about:config, should start with "extensions.," then the name of the extension, with a dot, then the name of the preference.
Inline options - Archive of obsolete content
this code should be in bootstrap.js (within the startup() function) for restartless extensions or in an xpcom component or a javascript code module (not an overlay!) for traditional extensions.
... note: starting in gecko 13.0, you can also listen for the addon-options-hidden notification, which has the same subject and data as above, to find out when the ui is about to be removed.
Appendix D: Loading Scripts - Archive of obsolete content
speed: script tags may or may not be loaded from pre-compiled bytecode in the fastload cache (gecko 1.x) or startup cache (gecko 2), which means they don't necessarily need to read as source and compiled with each restart.
...he script that will be executed: let script = string(); // evaluate the script: components.utils.evalinsandbox(script, sandbox, // the javascript version "1.8", // the apparent script filename: "zz-9://plural/zed/alpha", // the apparent script starting line number: 42); the following code will execute a simple script loaded from a local file in the same directory as the current script.
Appendix F: Monitoring DOM changes - Archive of obsolete content
auto, auto, auto); } to { clip: rect(0px, auto, auto, auto); } \n\ }\n'; let properties = [ 'animation-duration: 0.0001s;', 'animation-name: ' + event + ' !important;' ]; properties = properties.map(function (prop) ' ' + watchnodes.namespace + prop) .join('\n'); doc.addeventlistener('animationstart', listener, false); function listener(event) { if (event.animationname == event) callback.call(this, event); } style.textcontent = ' ' + preamble + selector + '{' + properties + '}'; (doc.head || doc.documentelement).appendchild(style); // this will only work in chrome privileged code.
... style = components.utils.getweakreference(style); return function unwatch() { if (style.get()) { style.get().ownerdocument.removeeventlistener('animationstart', listener, false); style.get().parentnode.removechild(style.get()); } }; } watchnodes.namespace = 'mozcsskeyframerule' in window ?
Connecting to Remote Content - Archive of obsolete content
http debugging when you start debugging http requests, you may find it hard to know exactly what data was sent, especially with post data.
... if you click on the "start tamper" button, for every request made you will get a popup dialog for tampering with it before it is sent.
Local Storage - Archive of obsolete content
in the initialization method of your one of your "common" or startup objects, add the following code: let formatter = new log4moz.basicformatter(); let root = log4moz.repository.rootlogger; let logfile = this.getlocaldirectory(); // remember this?
... there are two paths you can take when creating the local database you'll be using for your extension: generate the database file (through mozistorageservice.opendatabase(), all tables (through mozistorageconnection.createtable(), and initial data when your extension starts up for the first time.
Useful Mozilla Community Sites - Archive of obsolete content
hopefully this guide has helped you get started with add-on development and you're on your way to joining the large mozilla add-ons developer community.
...now all you need is a good idea (in case you didn't have one already) and get started.
XPCOM Objects - Archive of obsolete content
void getchildlist(in string astartingat, out unsigned long acount,[array, size_is(acount), retval] out string achildarray); this method returns an array of strings.
... the first parameter is an input that tells the method where to start looking.
Using the Stylesheet Service - Archive of obsolete content
e;1"] .getservice(components.interfaces.nsistylesheetservice); var ios = components.classes["@mozilla.org/network/io-service;1"] .getservice(components.interfaces.nsiioservice); var u = ios.newuri("chrome://myext/content/myext.css", null, null); if(sss.sheetregistered(u, sss.user_sheet)) sss.unregistersheet(u, sss.user_sheet); registering stylesheets on startup via the category manager stylesheets may also be registered on startup via the agent-style-sheets and user-style-sheets categories.
... registered style sheets are not remembered across restarts.
Add-ons - Archive of obsolete content
extensions support in seamonkey 2 starting with seamonkey 2 alpha 1 seamonkey supports toolkit/-style extensions.
... how to convert an overlay extension to restartless first off, what kind of add-on are we talking about here?
XUL user interfaces - Archive of obsolete content
copy and paste the content from here, making sure that you scroll to get all of it: <?xml version="1.0"?> <?xml-stylesheet type="text/css" href="style7.css"?> <!doctype window> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="css getting started - xul demonstration" onload="init();"> <script type="application/javascript" src="script7.js"/> <label class="head-1" value="xul demonstration"/> <vbox> <groupbox class="demo-group"> <caption label="day of week calculator"/> <grid> <columns> <column/> <column/> </columns> <rows> <row> <label class="text-prompt" value="date:" ...
...copy and paste the content from here, making sure that you scroll to get all of it: /*** xul demonstration ***/ window { -moz-box-align: start; background-color: -moz-dialog; font: -moz-dialog; padding: 2em; } .head-1 { font-weight: bold; font-size: 200%; padding-left: 5px; } /* the group box */ .demo-group { padding: 1em; } .demo-group grid { margin-bottom: 1em; } .demo-group column { margin-right: .5em; } .demo-group row { margin-bottom: .5em; } .demo-group .buttons { -moz-box-pack: end; } ...
CSS3 - Archive of obsolete content
css grid layout candidate recommendation add a grid layout to the css display property and several new css properties to control it: grid, grid-area, grid-auto-columns, grid-auto-flow, grid-auto-position, grid-auto-rows, grid-column, grid-column-start, grid-column-end, grid-row, grid-row-start, grid-row-end, grid-template, grid-template-areas, grid-template-rows, and grid-template-columns.
... the css text-align property with the value start, end, start end, and match-parent for a better support of documents with multiple directionalities of text.
List of Mozilla-Based Applications - Archive of obsolete content
font management tool firecast digital signage and interactive kiosk tools also used in firecast easystart mozilla firefox web browser web browser usage stats from global stats fossamail email client for windows platform, based on mozilla thunderbird developed by moonchild productions, creator of the pale moon web browser flickr uploadr image upload tool see flickr uploadr: open source and powered by xulrunner foxkeh clock clock fri...
...ng uses mozilla rhino phloneme publishing tool for vocab collab phped php editor embedded mozilla browser in product pidgin im client uses nss plain old webserver extension and standalone webserver 5,000 users and 30,000 downloads poe::xul framework for remote xul application in poe postbox email client started as a fork of thunderbird printgroove jt suite print process software uses xulrunner and spidermonkey prism (was webrunner) single-site browser xulrunner application pro/engineer wildfire cadcam product psycrunner chat, messenger, multicast toolkit about 1,000 users – xulrunner version of psyczilla extension pyjamas-desktop ...
Creating a Web based tone generator - Archive of obsolete content
<!doctype html> <html> <head> <title>javascript audio write example</title> </head> <body> <input type="text" size="4" id="freq" value="440"><label for="hz">hz</label> <button onclick="start()">play</button> <button onclick="stop()">stop</button> <script type="text/javascript"> function audiodatadestination(samplerate, readfn) { // initialize the audio output.
...requestsounddata(sounddata) { if (!frequency) { return; // no sound selected } var k = 2* math.pi * frequency / samplerate; for (var i=0, size=sounddata.length; i<size; i++) { sounddata[i] = math.sin(k * currentsoundsample++); } } var audiodestination = new audiodatadestination(samplerate, requestsounddata); function start() { currentsoundsample = 0; frequency = parsefloat(document.getelementbyid("freq").value); } function stop() { frequency = 0; } </script> </body> </html> ...
Images, Tables, and Mysterious Gaps - Archive of obsolete content
almost no matter when you started creating web pages, odds are pretty high you have one or more designs based on the classic "convoluted tables and lots of images" paradigm.
...we start with a simple case, illustrated in figure 1: a one-cell table containing an image.
Source code directories overview - Archive of obsolete content
it is a good document for a new mozilla developer to start learning about the mozilla code base.
... xpfe contains the c interfaces, c code and xul for implementing the "cross platform front end." essentially, this is where the mozilla program starts and manages other components to accomplish tasks.
Bonsai - Archive of obsolete content
start at the main bonsai query page or seamonkey tree control page here are some example queries that will give you a taste of what bonsai is capable of: today's checkins to the mozilla source mainline.
... checkins to any branch of xfe by ramiro between 26-feb-1998 and 12-may-1998 differences between revisions 3.1 and 3.3 of the file mozilla/cmd/xfe/forms.c that's a small sample, but it should be enough to get you started.
Bookmark Keywords - Archive of obsolete content
the quickest way to start is to simply look up any random bug in the bugzilla system-- the actual number doesn't matter.
... here's where the power starts to show up.
Structure of an installable bundle - Archive of obsolete content
basic structure of a bundle a bundle may include any of the following files: path from the root of the bundle description version information /install.rdf extension/theme install manifest /application.ini application launch manifest /bootstrap.js the bootstrap script for extensions not requiring a restart (those with <em:bootstrap>true</em:bootstrap> in their install.rdf).
...to facilitate the first case, the extension/app loader has special sub-directories specifically for platform-specific files (starting with toolkit/gecko 1.8, firefox/thunderbird 1.5).
Enabling the behavior - updating the status periodically - Archive of obsolete content
we use it inside the loadtinderboxstatus function to make that function run a second (1,000 milliseconds) after startup and a minute (60,000 milliseconds) after each invocation.
... with this code in place, restarting mozilla should cause the tinderbox status panel to display the current tinderbox state.
Making it into a dynamic overlay and packaging it up for distribution - Archive of obsolete content
to make our xpi we'll start out by creating a directory to hold the files we're going to add to the xpi.
... start out by creating a directory called tinderstatus-installer.
Extension Frequently Asked Questions - Archive of obsolete content
if you're looking for a place to get started, try our tutorial, building an extension or mozillazine's getting started tutorial.
... use the extension wizard to generate a template to start with.
Block and Line Layout Cheat Sheet - Archive of obsolete content
mflags ll_endsinwhitespace set to true by default when starting line layout.
... ll_understandsnwhitespace ll_textstartswithnbsp ll_firstletterstyleok ll_istopofpage ll_updatedband ll_impactedbyfloaters ll_lastfloaterwasletterframe ll_canplacefloater ll_knowstrictmode ll_instrictmode ll_lineendsinbr perframedata (why isn't this just stored in the frame?) mflags pfd_relativepos pfd_istextframe pfd_isnonemptytextframe pfd_isnonwhitespacetextframe pfd_isletterframe pfd_issticky pfd_isbullet perspandata in nslinelayout, a "span" is a container inline frame, and a "frame" is one of its children.
Content states and the style system - Archive of obsolete content
for each selector in this list we check whether it might have stopped matching the node or started matching it.
... the way we determine whether the selector might have stopped or started matching the node is by just checking whether it matches with the caveat that all the state-dependent pseudo-classes corresponding to the states that changed must be treated as matching (whether they actually do and whether they're negated or not).
Layout System Overview - Archive of obsolete content
this is a major benefit for large documents because the user does not have to wait for the 200th page of text to be read in before the first page can be displayed - they can start reading something right away.
...the most basic is a list of all of the frames starting at the root frame.
Style System Overview - Archive of obsolete content
compute*data use either a default or a start struct as the basis for the computation.
... a start struct is a cached struct in the rule tree that we can just copy and add to.
Gecko Coding Help Wanted - Archive of obsolete content
where's a good place to start?
...roc is willing to work closely with anyone with reasonable c++ experience to get them started on this.
Simple Storage - Archive of obsolete content
the jetpack.storage.simple namespace provides an easy way to persist data across browser restarts.
...the text will be remembered across browser restarts as a note.
Simple Storage - Archive of obsolete content
the jetpack.storage.simple namespace provides an easy way to persist data across browser restarts.
...the text will be remembered across browser restarts as a note.
Makefile.mozextension.2 - Archive of obsolete content
note that the original makefile.mozextention merely repeats the steps in getting started with extension development - mozillazine knowledge base (2008).
..., all of the < > will be quoted as & lt ; so again it will be corrupt :( therefore, here is a direct link to this makefile: makefile.mozextension2 ## file: makefile.mozextension2 ## based on http://kb.mozillazine.org/makefile_for_packaging_an_extension ## "this makefile.mozextention is for the test extension" ## the original makefile.mozextention reconstructs http://kb.mozillazine.org/getting_started_with_extension_development # call with: # make -f makefile.mozextension2 make_structure ## (without args for 'all') # note: @echo silent; without @ the command is written in stdout project=test project_name=testworld #~ project_id={xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} project_id=test@testworld.ext project_version=1.0 project_desc="a $(project_name) project with advanced features" project...
File object - Archive of obsolete content
getting started in order to use the file object from your javascript programs, you must enable it by setting the make variable js_has_file_object during the compilation of your spidermonkey engine.
...filenames starting and ending with the pipe symbol (|) are interpreted as pipes.
Static Analysis for Windows Code under Linux - Archive of obsolete content
we highly recommend you to read the cross compiling manual and the dehydra build manual before you start the following reading.
...ion glib_prefix=$home/moztools libidl_prefix=$home/moztools #disable xpcom stdcall calling convention because of gcc 4.3.0 bug cppflags="-dmoz_disable_xpcom_stdcall" #specify the cxx and static analysis #point cxx to the cross compile g++ with plugin support cxx=$home/mingw-install/bin/i686-mingw32-g++ ac_add_options --with-static-checking=$home/dehydra/dehydra-gcc/gcc_dehydra.so then, you can start building your mozilla.
Abc Assembler Tests - Archive of obsolete content
when run, the assembler tests include the abcasm/abs_helper.as file which defines the following functions: start(summary:string):void - start a new test section described by summary end():void - test section finished compare_stricteq(name:string, expected:*, actual:*):void - compare the results of a testcase where name is the testcase name compare_typeerror(name:string, expected:*, actual:*):void - special function for comparing typeerrors (runtimeerrors) - will only compare the first 22 chars of expected ...
... * * ***** end license block ***** */ function main() { getlocal0 pushscope findproperty start pushstring "instructions that start with the letter l" callpropvoid start 1 newfunction .function_id(runtest) getlocal0 call 0 findproperty end callpropvoid end 0 returnvoid } function runtest() { // test null <= null == true findproperty compare_stricteq pushstring "null lessequals null" // testname pushtrue // expected pushnull pushnull ...
Cmdline tests - Archive of obsolete content
two use cases for the cmdline testsuite: use case 1: test the interactive cmdline debugger test contents: start avmshell -d test.abc, set breakpoint on a line, show local variable value, quit from cmdutils import * def run(): r=runtestlib() r.run_test( 'debugger locals', '%s -d testdata/debug.abc'%r.avmrd, input='break 53\ncontinue\nnext\ninfo locals\nnext\ninfo locals\nquit\n', expectedout=['local1 = undefined','local2 = 10','local2 = 15'] ) use case 2: test -memstats retur...
...ns memory logs to stdout test contents: start avmshell -memstats test.abc, assert stdout contains 'gross stats', 'sweep m reclaimed n pages.' from cmdutils import * def run(): r=runtestlib() r.run_test(name='memstats', command="%s -memstats testdata/memstats.abc" % r.avm, expectedout=[ 'gross stats', 'managed fragmentation', 'gross stats end', 'sweep\\([0-9]+\\) reclaimed [0-9]+ whole pages' ] ...
Running Tamarin acceptance tests - Archive of obsolete content
$ cd tamarin-redux/test/acceptance $ export asc=/users/build/hg/tamarin-redux/utils/asc.jar $ export builtinabc=/users/build/hg/tamarin-redux/generated/builtin.abc $ export shellabc=/users/build/hg/tamarin-redux/generated/shell_toplevel.abc $ export avm=/users/build/hg/tamarin-redux/objdir-release/shell/avmshell $ python runtests.py tamarin tests started: 2010-09-28 10:37:06.410676 current configuration: x64-mac-tvm-release avm version: 5260:6d1899261bac executing 2532 tests against vm: /users/build/hg/builds/5260-6d1899261bac/mac/avmshell_64 2532 running abcasm/abs_helper.as skipping...
...tests complete at 2010-09-28 10:39:26.751797 start date: 2010-09-28 10:38:07.221457 end date : 2010-09-28 10:39:26.751797 test time : 0:01:19.530340 passes : 59291 failures : 0 expected failures : 75 tests skipped : 76 the -f flag tells runtests.py to force recompilation of all the scripts.
Tuning Pageload - Archive of obsolete content
nglayout.initialpaint.delay this is a preference that specifies a delay, in milliseconds, after the data from the server has started coming in.
...the idea here is twofold.this reduces ugly visual jitter as the new page comes in by not starting painting till after we have a bunch of the data.this makes overall page load time shorter by not doing extra repaints very early on.
URIs and URLs - Archive of obsolete content
this is done by ns_escapeurl which is now part of xpcom, but started as part of necko.
... noteable differences necko does not support certain deprecated forms of relative urls, based on the following part of rfc 2396: if the scheme component is defined, indicating that the reference starts with a scheme name, then the reference is interpreted as an absolute uri and we are done.
Creating XPI Installer Modules - Archive of obsolete content
since we are not updating the mozilla ui to provide special access to this window (e.g., an item in the tasks menu or elsewhere), the measure of the success of the installation of the barley package is that the user can, as before, invoke our software by using a special startup option: mozilla -chrome chrome://barley/content this option tells mozilla to load a chrome other than the default, which is the main browser window.
...exit mozilla and restart it with mozilla -chrome chrome://barley/content and the new package displays.
initInstall - Archive of obsolete content
a relative pathname must start with plugins/, to be relative to the plug-ins portion of that namespace or java/download/, to be relative to the java portion.
...example to start installation for the royal airways plug-in, you could use this code: initinstall("royal airways tripplanner","/royalairways/ tripplanner","1.0.0.0"); ...
XPInstall API reference - Archive of obsolete content
getwinprofile getwinregistry initinstall loadresources logcomment patch performinstall refreshplugins registerchrome reseterror setpackagefolder installtrigger no properties methods compareversion enabled getversion install installchrome startsoftwareupdate installversion properties methods compareto init tostring file no properties methods copy dircreate dirgetparent dirremove dirrename diskspaceavailable execute exists isdirectory isfile macalias moddate modd...
...yexists setrootkey setvalue setvaluenumber setvaluestring valueexists winregvalue constructor other information return codes see complete list examples trigger scripts and install scripts code samples file.macalias file.windowsshortcut install.adddirectory install.addfile installtrigger.installchrome installtrigger.startsoftwareupdate windows install ...
XPJS Components Proposal - Archive of obsolete content
each .js file (let's call it a module) is started up and run in the context of a relatively 'raw' js global object.
...any subsequent requests from the component manager that would result in nsgetfactory calls into the module will force the xpjsmanager to load up a new instance of the .js file and start over.
crop - Archive of obsolete content
ArchiveMozillaXULAttributecrop
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
timeout - Archive of obsolete content
« xul reference home timeout type: integer for autocomplete textboxes, the number of milliseconds before the textbox starts searching for completions.
...the timer starts after the user types a character.
findbar - Archive of obsolete content
attributes browserid, findnextaccesskey, findpreviousaccesskey, highlightaccesskey, matchcaseaccesskey properties browser, findmode methods close, onfindagaincommand, open, startfind, togglehighlight example <browser type="content-primary" flex="1" id="content" src="about:blank"/> <findbar id="findtoolbar" browserid="content"/> attributes browserid type: string the id of the browser element to which the findbar is attached.
... you should specify true as the input parameter to perform a "find previous" operation, or false to perform a "find next." startfind( mode ) return type: no return value call this method to handle your application's "find" command.
OpenClose - Archive of obsolete content
the openpopup method is defined as follows: void openpopup(in domelement anchorelement, in string position, in long x, in long y, in boolean iscontextmenu, in boolean attributesoverride); first an example: somepopup.openpopup(anchor, "after_start", 0, 0, false, false); this example will open a popup located just underneath another element referenced by 'anchor'.
... somepopup.openpopup(anchor, "after_start", 10, -2, false, false); note that the anchor and positioning only specifies the position when the popup is opened.
selectionEnd - Archive of obsolete content
use in conjuction with the selectionstart property.
...if this value is equal to the value of the selectionstart property, no text is selected, but the value indicates the position of the caret (cursor) within the textbox.
Multiple Rules - Archive of obsolete content
a multiple rule template looks like the following: <hbox id="photoslist" datasources="template-guide-photos3.rdf" ref="http://www.xulplanet.com/rdf/myphotos"> <template> <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> </query> <rule> <where subject="?title" rel="equals" value="canal"/> <action> <button uri="?photo" image="?photo" label="view" orient="vertical"/> </action> </rule> <rule> ...
...escriptionexample equalsmatch if a value equals anothermatch a specific value lessmatch if a number is less than anothermatch only negative values with one rule, positive values with another greatermatch if a number is greater than anotherdisplay values greater than 1000 differently beforematch if a value comes before another alphabetically aftermatch if a value comes after another alphabetically startswithmatch if a value starts with a specific string endswithmatch if a value ends with a specific string containsmatch if a value contains a substringto highlight results that contain a search term here is an example using the 'contains' operator: <vbox datasources="people.xml" ref="*" querytype="xml"> <template> <query expr="person"> <assign var="?letters" expr="string-length(@name)...
Sorting Results - Archive of obsolete content
this method of sorting a seq works best for the simple query syntax since it is obvious how the starting ref relates to the end member results (they are just the children), or for extended syntax queries that follow a similar pattern.
... for more complex queries, this natural sorting will not work, because the sort service assumes that the starting ref resource is the container and the end results are the children.
Special Condition Tests - Archive of obsolete content
here is the same example using the extended template syntax: <vbox datasources="template-guide-streets.rdf" ref="http://www.xulplanet.com/rdf/myneighbourhood"> <template> <query> <content uri="?start"/> <member container="?start" child="?item"/> </query> <rule parent="vbox"> <binding subject="?item" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <action> <groupbox uri="?item"> <caption label="?title"/> </groupbox> </action> </rule> <rule> <binding subject="?item" predicate="http://www.xulplanet.com/rd...
...since the iscontainer attribute is set to true, the rule will match as long as the member value or child of the starting node is an rdf container.
Static Content - Archive of obsolete content
<menulist datasources="template-guide-photos4.rdf" ref="http://www.daml.org/2001/09/countries/country-ont#country" oncommand="applyfilter(event.target.value);"> <menupopup> <menuitem label="all"/> </menupopup> <template> <query> <content uri="?start"/> <triple subject="?country" predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" object="?start"/> <triple subject="?country" predicate="http://purl.org/dc/elements/1.1/title" object="?countrytitle"/> </query> <action> <menupopup> <menuitem uri="?country" label="?countrytitle" value="?country"/> ...
... <radiogroup datasources="template-guide-photos4.rdf" ref="http://www.daml.org/2001/09/countries/country-ont#country" onselect="applyfilter(event.target.value);"> <radio label="all" selected="true"/> <template> <query> <content uri="?start"/> <triple subject="?country" predicate="http://www.w3.org/1999/02/22-rdf-syntax-ns#type" object="?start"/> <triple subject="?country" predicate="http://purl.org/dc/elements/1.1/title" object="?countrytitle"/> </query> <action> <radio uri="?country" label="?countrytitle" value="?country"/> </action> </template...
XML Templates - Archive of obsolete content
the ref attribute isn't currently used for xml sources, as the root of the document is always the starting point for xml queries; you should just set the ref attribute to a dummy value, for example '*' which is typically used.
..." gender="female"/> <person name="julius caesar" gender="male"/> <person name="ferdinand magellan" gender="male"/> <person name="laura secord" gender="female"/> </people> <listbox datasources="#famouspeople" ref="*" querytype="xml"> <template> <query expr="person"/> <action> <listitem uri="?" label="?name"/> </action> </template> </listbox> here, an anchor reference, starting with a number sign (#) is used for the datasources attribute.
Toolbar customization events - Archive of obsolete content
beforecustomization this event is delivered when the user starts the toolbar customization process; for example, by right-clicking on a toolbar and choosing "customize".
...window.addeventlistener("beforecustomization", customizestart, false); window.addeventlistener("aftercustomization", customizeend, false); window.addeventlistener("customizationchange", customizechange, false); function customizestart(e) { let thetoolbox = e.target; /* now we know the user has started customizing */ } function customizeend(e) { let thetoolbox = e.target; /* the user has finished customizing */ } function customizechange(e) { le...
Adding Buttons - Archive of obsolete content
we'll start by creating a simple find button for the find files utility.
...you can add align="start" to the window tag to prevent the stretching.
Box Model Details - Archive of obsolete content
on="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <window id="findtext" title="find text" orient="horizontal" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <vbox flex="3"> <label control="t1" value="search text:"/> <textbox id="t1" style="min-width: 100px;" flex="1"/> </vbox> <vbox style="min-width: 150px;" flex="1" align="start"> <checkbox id="c1" label="ignore case"/> <spacer flex="1" style="max-height: 30px;"/> <button label="find"/> </vbox> </window> here, two vertical boxes are created, one for the textbox and the other for the check box and button.
...the second box has an alignment of start.
Creating a Skin - Archive of obsolete content
this section assumes that you are starting with the classic skin.
...let's start with the menus, toolbars and the overall tab panel.
Creating an Installer - Archive of obsolete content
install triggers as indicated above, the install process is started by an install trigger.
...it contains a number of methods which can be used to start an installation.
Element Positioning - Archive of obsolete content
you can use the following values: start this positions elements at the left edge for horizontal boxes and at the top edge for vertical boxes.
... start this aligns elements along the top edge for horizontal boxes and along the left edge for vertical boxes.
More Tree Features - Archive of obsolete content
each item in the tree has a level starting at 0.
...ve a number of attributes as indicated in the example below: example 2 : source view <tree enablecolumndrag="true" flex="1"> <treecols> <treecol id="runner" label="runner" flex="2" persist="width ordinal hidden" /> <splitter class="tree-splitter" /> <treecol id="city" label="home city" flex="2" persist="width ordinal hidden" /> <splitter class="tree-splitter" /> <treecol id="starttime" label="start time" flex="1" persist="width ordinal hidden" /> <splitter class="tree-splitter" /> <treecol id="endtime" label="end time" flex="1" persist="width ordinal hidden" /> </treecols> <treechildren> <treeitem> <treerow> <treecell label="joshua granville" /> <treecell label="vancouver" /> <treecell label="7:06:00" /> <treecell labe...
Skinning XUL Files by Hand - Archive of obsolete content
this article can help you get started understanding skins and creating skins for xul.
... to start creating the xul skin: add the stylesheet processing instruction to the top of your xul file.
Templates - Archive of obsolete content
nevertheless, we'll start with these other elements because trees and menus require more code.
... the content builder always starts at the place where uri="rdf:*" is specfied.
Tree View Details - Archive of obsolete content
review of the methods here is a review of the methods needed to implement hierarchical views: getlevel(row) hasnextsibling(row, afterindex) getparentindex(row) iscontainer(row) iscontainerempty(row) iscontaineropen(row) toggleopenstate(row) the afterindex argument to hasnextsibling function is used as optimization to only start looking for the next sibling after that point.
...in the code above we indicate that the starting row is the value of 'idx' plus one, which will be the first child under the parent.
Trees - Archive of obsolete content
ArchiveMozillaXULTutorialTrees
for most trees, especially when you first start to use trees, you will use one of these built-in types.
... let's start by looking at how to create a simple tree with multiple columns using the tree content view.
XUL element attributes - Archive of obsolete content
start child elements are aligned starting from the left or top edge of the box.
... start child elements are placed starting from the left or top edge of the box.
The Implementation of the Application Object Model - Archive of obsolete content
for this particular codebase, if we don't do this from start, we won't do it at all.
... let's start over on the left side of the picture.
XUL controls - Archive of obsolete content
<description> select a time for the event to start </description> more information about the description element.
... <image src="start.png"/> more information about the image element.
button - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
caption - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
checkbox - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
description - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
dialogheader - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
listbox - Archive of obsolete content
items are numbered starting at the first item displayed in the list.
... selectitemrange( startitem, enditem ) return type: no return value selects the items between the two items given as arguments, including the start and end items.
listcell - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
listitem - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
menuitem - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
menupopup - Archive of obsolete content
valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer.
... position possible values for position are: before_start, before_end, after_start, after_end, start_before, start_after, end_before, end_after, overlap, and after_pointer.
menuseparator - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
prefpane - Archive of obsolete content
methods domelement getpreferenceelement(in domelement startelement) preferenceforelement( uielement ) return type: preference element returns the preference element to which a user interface element is attached.
...nt/script0.js"> <script type="application/javascript" src="chrome://myext/content/script1.js"> </prefwindow> when opening a dialog with multiple panes you must include the toolbar feature in the call to opendialog, for example: window.opendialog("chrome://example/content/prefwin.xul", "", "chrome,toolbar"); related prefwindow preferences system documentation: introduction: getting started | examples | troubleshooting reference: prefwindow | prefpane | preferences | preference | xul attributes ...
prefwindow - Archive of obsolete content
you can also set the lastselected attribute on the prefwindow tag to the id of the pane to start with.
... should not: <prefwindow> <script src="config.js"/> <prefpane label="pane1" src="pane1.xul"/> <prefpane label="pane2" src="pane2.xul"/> </prefwindow> should: <prefwindow> <prefpane label="pane1" src="pane1.xul"/> <prefpane label="pane2" src="pane2.xul"/> <script src="config.js"/> </prefwindow> related prefpane preferences system documentation: introduction: getting started | examples | troubleshooting reference: prefwindow | prefpane | preferences | preference | xul attributes ...
radio - Archive of obsolete content
ArchiveMozillaXULradio
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
resizer - Archive of obsolete content
note: starting in gecko 2.0, you can also specify a target element using the element attribute, to use the resizer to resize the specified element instead of the window.
... bottomstart resized down and toward the start of the line (toward the left for left-to-right locales, toward the right for right-to-left locales).
richlistbox - Archive of obsolete content
items are numbered starting at the first item displayed in the list.
... selectitemrange( startitem, enditem ) return type: no return value selects the items between the two items given as arguments, including the start and end items.
<statusbarpanel> - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
tab - Archive of obsolete content
ArchiveMozillaXULtab
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
toolbarbutton - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
tree - Archive of obsolete content
ArchiveMozillaXULtree
ributes(), haschildnodes(), insertbefore(), isdefaultnamespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata startediting( row, column ) return type: no return value activates user editing of the given cell, which is specified by row index number and the nsitreecolumn in which it is located.
...und-color: #ffffaa; } treechildren::-moz-tree-cell-text(selected) { color: #000000; } treechildren::-moz-tree-cell-text(odd, selected) { color: #000000; } if using a content tree view, use the following to get the value of the id attribute for each of the selected rows of a tree: var idlist = []; var rangecount = tree.view.selection.getrangecount(); for (var i = 0; i < rangecount; i++) { var start = {}; var end = {}; tree.view.selection.getrangeat(i, start, end); for (var c = start.value; c <= end.value; c++) { idlist.push(tree.view.getitematindex(c).firstchild.id); } } the following returns a array of the indicies of the rows where the value is checked in a checkbox type column: function getcellchecked(tree, columnid) { var arr = []; var column = tree.columns.getnamedco...
treecol - Archive of obsolete content
start the text will be cropped on its left side in left-to-right text locales, and the right side in right-to-left locales.
... center the text will be cropped in the middle, showing both the start and end of the text normally.
window - Archive of obsolete content
note: starting in gecko 1.9.2, you can detect when a window is activated or deactivated by watching for the "activate" and "deactivate" events.
...--> <window id="rootwnd" title="register online!" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <vbox> <hbox> <image src="application_form.png"/> <description>register online!</description> </hbox> <groupbox align="start"> <caption label="your information"/> <radiogroup> <vbox> <hbox> <label control="your-fname" value="enter first name:"/> <textbox id="your-fname" value="johan"/> </hbox> <hbox> <label control="your-lname" value="enter last name:"/> <textbox id="your-lname" value="hernandez"/> </hbox> ...
wizardpage - Archive of obsolete content
the wizard always starts with the wizardpage that appears first in the wizard child list.
...the wizard always starts with the wizardpage that appears first in the wizard child list.
XUL - Archive of obsolete content
xul tutorial a guided tutorial that will help you get started with xul, originally from xulplanet.
... documentation xul tutorial a guided tutorial that will help you get started with xul, originally from xulplanet.
XULRunner 1.8.0.1 Release Notes - Archive of obsolete content
windows run the following command from the start menu -> run or from a command prompt: "c:\program files\mozilla xulrunner\1.8.0.1\xulrunner\xulrunner.exe" --install-app "c:\documents and settings\user\desktop\myapplication.xpi" the application will be installed to c:\program files\vendorname\applicationname mac os x run the following command in a command prompt: /library/frameworks/xul.framework/xulrunner-bin --install-app ~/desktop/myapplica...
... if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroups or the irc channel.
XULRunner 1.8.0.4 Release Notes - Archive of obsolete content
windows run the following command from the start menu -> run or from a command prompt: "c:\program files\mozilla xulrunner\1.8.0.4\xulrunner\xulrunner.exe" --install-app "c:\documents and settings\user\desktop\myapplication.xpi" the application will be installed to c:\program files\vendorname\applicationname mac os x run the following command in a command prompt: /library/frameworks/xul.framework/xulrunner-bin --install-app ~/desktop/myap...
... if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroups or the irc channel.
XULRunner 1.9.1 Release Notes - Archive of obsolete content
windows run the following command from the start menu -> run or from a command prompt: "c:\program files\mozilla xulrunner\1.9.1\xulrunner\xulrunner.exe" --install-app "c:\documents and settings\user\desktop\myapplication.xpi" the application will be installed to c:\program files\vendorname\applicationname mac os x run the following command in a command prompt: /library/frameworks/xul.framework/xulrunner-bin --install-app ~/desktop/myapplicati...
... if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroups or the irc channel.
XULRunner 1.9.2 Release Notes - Archive of obsolete content
windows run the following command from the start menu -> run or from a command prompt: "c:\program files\mozilla xulrunner\1.9.2\xulrunner\xulrunner.exe" --install-app "c:\documents and settings\user\desktop\myapplication.xpi" the application will be installed to c:\program files\vendorname\applicationname mac os x run the following command in a command prompt: /library/frameworks/xul.framework/xulrunner-bin --install-app ~/desktop/myapplicati...
...if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroups or the irc channel.
XULRunner 1.9 Release Notes - Archive of obsolete content
windows run the following command from the start menu -> run or from a command prompt: "c:\program files\mozilla xulrunner\1.9\xulrunner\xulrunner.exe" --install-app "c:\documents and settings\user\desktop\myapplication.xpi" the application will be installed to c:\program files\vendorname\applicationname mac os x run the following command in a command prompt: /library/frameworks/xul.framework/xulrunner-bin --install-app ~/desktop/myapplic...
... if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroups or the irc channel.
XULRunner 2.0 Release Notes - Archive of obsolete content
windows run the following command from the start menu -> run or from a command prompt: "c:\program files\mozilla xulrunner\2.0\xulrunner\xulrunner.exe" --install-app "c:\documents and settings\user\desktop\myapplication.xpi" the application will be installed to c:\program files\vendorname\applicationname mac os x run the following command in a command prompt: /library/frameworks/xul.framework/xulrunner-bin --install-app ~/desktop/myapplication...
...if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroups or the irc channel.
Building XULRunner with Python - Archive of obsolete content
building the batch filestart-msvc71.bat is used to launch the build console (msys from the mingw project ).
... pause exit /b 1 ) start "xulrunner with python" "%moz_bin%\xulrunner.exe" -app application.ini %opts% exit /b 0 see xulrunner:deploying_xulrunner_1.8 for general information.
Deploying XULRunner - Archive of obsolete content
after that, the app could be installed to the registered xulrunner and appear in start menus, lists of installed programs, etc.
... xulrunner 39 and later due to mac os x code signing rules and how they interact with the design of xulrunner (see bug 1105044 for the inside scoop), starting with xulrunner 39 the xulrunner library files are no longer able to reside in a xulrunner framework directory.
XULRunner - Archive of obsolete content
getting started with xulrunner a short introduction to xulrunner.
... overview development plan what xulrunner provides xulrunner faq nightly builds: unstable-trunk documentation getting started with xulrunner short tutorial on building desktop applications with xulrunner.
XUL Explorer - Archive of obsolete content
option to specify the snippet used to load the editor on startup.
...the snippets are merged with the built-in snippets at startup.
Archived Mozilla and build documentation - Archive of obsolete content
creating a skin for firefox/getting started download the latest version of firefox and install it.
... migrate apps from internet explorer to mozilla when netscape started the mozilla browser, it made the conscious decision to support w3c standards.
Gecko Compatibility Handbook - Archive of obsolete content
after restarting your browser, add the the user-agent strings that you want to test to the list (tools | user agent switcher | options | options...
... you can now start using the user-agent string you've just created by clicking tools | user agent switcher |the name you have chosen.
Mozilla release FAQ - Archive of obsolete content
the mozilla project started near the end of life of the 4.x line of netscape communicator.
...to start understanding the issues with this example, you should dig up the rfcs for the relevant protocols, any documents written on the subject, etc.
2006-10-06 - Archive of obsolete content
discussion highlights: ziga sancin suggests writing an introductory article for potential developers containing basic project information (history, list of main developers, project goals, roadmap and available communication channels, etc), tools needed to start developing and building tb, documentation on source structure as well as links to help one get started on the project.
... cédric corazza recommends that the proposed documention should be made available on the l10n cvs once it reaches a decent stage so that localizers can get a head-start on the localization before the final version is made available.
2006-10-06 - Archive of obsolete content
rc2 starts spinning and en-us builds are annoucned.
... reminder - ff2 rc2 code freeze 9/29/2006 at 9am pdt schrep started a discussion of bugs that need to be fixed for the ff2 rc2 code freeze to go ahead.
2006-12-01 - Archive of obsolete content
bon echo project status: remaining "to-do" items beltzner starts a discussion on when to offer 1.5.0.8+ users the chance to upgrade to ff2.x (now or when ff2.0.0.1 is released).
... mozilla.org staff, project drivers, and technical oversight mike connor starts a discussion about the need for a "buck stops here" group and the replacement of drivers@mozilla.org.
2006-11-10 - Archive of obsolete content
discussions hunting down the "sunbird fails to start" bug -- please help discussion about a crash when starting sunbird 0.2.
...configurable start/end hours, optimal size of grid boxes in 24 hours view.
NPN_ReloadPlugins - Archive of obsolete content
normally, if you add or remove any plug-ins, the browser does not see them until you restart gecko.
... npn_reloadplugins() lets you install a new plug-in and load it, or to remove a plug-in, without having to restart the browser.
Atomic RSS - Archive of obsolete content
ArchiveRSSModuleAtom
"getting started" box, if there is no "getting started" article yet written, should be populated with another feature article or tutorial, should one exist.
... otherwise, just comment it out getting started a guided tutorial that will help you get started with atomic rss.
Content - Archive of obsolete content
"getting started" box, if there is no "getting started" article yet written, should be populated with another feature article or tutorial, should one exist.
... otherwise, just comment it out getting started a guided tutorial that will help you get started with the rss content module.
Introduction to Public-Key Cryptography - Archive of obsolete content
red hat software uses the following procedure for forming and verifying a certificate chain, starting with the certificate being presented for authentication: the certificate validity period is checked against the current time provided by the verifier's system clock.
...otherwise, the issuer's certificate is checked to make sure it contains the appropriate subordinate ca indication in the red hat certificate type extension, and chain verification returns to step 1 to start again, but with this new certificate.
The Basics of Web Services - Archive of obsolete content
warning: xml-rpc support was removed from firefox starting with firefox 3.
... warning: soap support was removed from firefox starting with firefox 3.
Common Firefox theme issues and solutions - Archive of obsolete content
this document was started on july 27, 2012 so it will take some time to completely fill in and some issues still need to have solutions written for them.
...please see the following threads on mozillazine for solutions to this issue: http://forums.mozillazine.org/viewtopic.php?f=18&t=2131121 http://forums.mozillazine.org/viewtopic.php?f=18&t=1953371&start=60 windows 7 aero not going into full screen mode properly on win7 with aero glass support firefox doesn't always go to full screen mode from a normal window properly.
Theme changes in Firefox 3 - Archive of obsolete content
filename css file details changes to the default theme the table below lists changes made in the default theme for firefox 3; you can use this information as a starting point for figuring out the changes you need to make.
...instead a '-moz-margin-start' property must be added to .tab-drop-indicator-bar, with a value that is half of the width of the indicator image.
-ms-scroll-snap-points-x - Archive of obsolete content
snapinterval( <length-percentage>, <length-percentage> ) specifies a starting snap-point followed by the interval between all snap-points.
... starting with windows 8.1, this property is also supported for mouse, keyboard, and touchpad interaction.
-ms-scroll-snap-points-y - Archive of obsolete content
snapinterval( <length-percentage>, <length-percentage> ) specifies a starting snap-point followed by the interval between all snap-points.
... starting with windows 8.1, this property is also supported for mouse, keyboard, and touchpad interaction.
ECMAScript 2016 to ES.Next support in Mozilla - Archive of obsolete content
ecmascript 2016 array.prototype.includes() (firefox 43) typedarray.prototype.includes() (firefox 43) exponentiation operator (firefox 52) ecmascript 2017 object.values() (firefox 47) object.entries() (firefox 47) string.prototype.padstart() (firefox 48) string.prototype.padend() (firefox 48) object.getownpropertydescriptors() (firefox 50) async functions async function (firefox 52) async function expression (firefox 52) asyncfunction (firefox 52) await (firefox 52) trailing commas in function parameter lists (firefox 52) ecmascript 2018 spread in object literals and rest parameters (firefox 55) for aw...
...jects/regexp/dotall (not yet implemented; in other browsers) regexp lookbehind assertions (not yet implemented; in other browsers) regexp unicode property escapes (not yet implemented; in other browsers) regexp named capture groups (not yet implemented; in other browsers) ecmascript 2019 array.flat() (firefox 62) array.flatmap() (firefox 62) object.fromentries() (firefox 63) string.trimstart() and string.trimend() (firefox 61) optional catch binding (firefox 58) function.tostring() revision (firefox 54) symbol.description (firefox 63) well-formed json.stringify() (firefox 64) ecmascript 2020 this is the current es.next version.
Debug - Archive of obsolete content
debug.mstraceasynccallbackstarting associates the callback stack with a previously specified asynchronous operation.
... debug.mstraceasyncoperationstarting initiates a trace for an asynchronous operation.
JavaObject - Archive of obsolete content
the following example uses the startswith method to check whether thestring begins with "hello".
... var thestring = new java.lang.string("hello, world"); thestring.startswith("hello"); // returns true example: accessing inherited methods because getclass is a method of object, and java.lang.string extends object, the string class inherits the getclass method.
XForms Repeat Element - Archive of obsolete content
node set binding special startindex - optional 1-based initial value of the repeat index.
...to accommodate this, xforms 1.0 defines an alternative syntax that is functionally equivalent to the repeat element, using the following attributes: repeat-model repeat-bind repeat-nodeset repeat-startindex repeat-number additionally, when using xforms action setindex, its repeat attribute (which contains an idref) can point to any element carrying these repeat attributes.
Using the Right Markup to Invoke Plugins - Archive of obsolete content
for instance, the param name="movie" tells the flash plugin the location of the swf file to start playing.
...47, which don't understand the <param name="movie" value="animation.swf"> param element, which is supposed to tell the flash player which animation to start playing.
Create the Canvas and draw on it - Game development
before we can start writing the game's functionality, we need to create a basic structure to render the game inside.
...it takes six parameters: x and y coordinates of the arc's center arc radius start angle and end angle (what angle to start and finish drawing the circle, in radians) direction of drawing (false for clockwise, the default, or true for anti-clockwise.) this last parameter is optional.
Game over - Game development
for now we'll keep it simple, showing an alert message and restarting the game by reloading the page.
... next steps we're doing quite well so far and our game is starting to feel a lot more worth playing now you can lose!
Move the ball - Game development
first, instead of a hardcoded position at (50,50) we will define a starting point at the bottom center part of the canvas in variables called x and y, then use those to define the position the circle is drawn at.
...let's start by moving the ball drawing code to a separate function.
Paddle and keyboard controls - Game development
add the following variables near the top of your code, beside your other variables: var paddleheight = 10; var paddlewidth = 75; var paddlex = (canvas.width-paddlewidth) / 2; here we're defining the height and width of the paddle and its starting point on the x axis for use in calculations further on down the code.
...this will all change in the fifth chapter, game over, when we start to add in an endgame state for our game.
2D breakout game using pure JavaScript - Game development
lesson details all the lessons — and the different versions of the mdn breakout game we are building together — are available on github: create the canvas and draw on it move the ball bounce off the walls paddle and keyboard controls game over build the brick field collision detection track the score and win mouse controls finishing up starting with pure javascript is the best way to get a solid knowledge of web game development.
... next steps ok, let's get started!
Bounce off the walls - Game development
now that physics have been introduced, we can start implementing collision detection into the game — first we'll look at the walls.
... compare your code you can check the finished code for this lesson in the live demo below, and play with it to understand better how it works: next steps this is starting to look more like a game now, but we can't control it in any way — it's high time we introduced the player paddle and controls.
Build the brick field - Game development
count: { row: 3, col: 7 }, offset: { top: 50, left: 60 }, padding: 10 }; } this brickinfo object will hold all the information we need: the width and height of a single brick, the number of rows and columns of bricks we will see on screen, the top and left offset (the location on the canvas where we shall start to draw the bricks) and the padding between each row and column of bricks.
... now, let's start creating the bricks themselves — add an empty group first to contain the bricks, by adding the following line at the bottom of the initbricks() function: bricks = game.add.group(); we can loop through the rows and columns to create new brick on each iteration — add the following nested loop below the previous line of code: for(c=0; c<brickinfo.count.col; c++) { for(r=0; r<brickinfo.count.row; r++) { // create new brick and add it to the group } } this way we will create the exact number of bricks we need and have them all contained in a group.
Initialize the framework - Game development
before we can start writing the game's functionality, we need to create a basic structure to render the game inside.
... the id of the <canvas> to use for rendering if one already exists on the page (we've specified null because we want phaser to create its own.) the names to use for phaser's three key functions that load and start the game, and update the game loop on every frame; we will use the same names to keep it clean.
Physics - Game development
add the physics.startsystem() method at the beginning of the create function (make it the first line inside the function), as shown below: game.physics.startsystem(phaser.physics.arcade); next, we need to enable our ball for the physics system — phaser object physics is not enabled by default.
... final code check the latest code should look like this: var ball; function preload() { game.scale.scalemode = phaser.scalemanager.show_all; game.scale.pagealignhorizontally = true; game.scale.pagealignvertically = true; game.stage.backgroundcolor = '#eee'; game.load.image('ball', 'img/ball.png'); } function create() { game.physics.startsystem(phaser.physics.arcade); ball = game.add.sprite(50, 50, 'ball'); game.physics.enable(ball, phaser.physics.arcade); ball.body.velocity.set(150, 150); } function update() { } try reloading index.html again — the ball should now be moving constantly in the given direction.
2D breakout game using Phaser - Game development
reakout game we are building together — are available on github: initialize the framework scaling load the assets and print them on screen move the ball physics bounce off the walls player paddle and controls game over build the brickfield collision detection the score win the game extra lives animations and tweens buttons randomizing gameplay as a note on learning paths — starting with pure javascript is the best way to get a solid knowledge of web game development.
... next steps ok, let us get started!
Bézier curve - MDN Web Docs Glossary: Definitions of Web-related terms
a third imaginary line is drawn with its starting point moving steadily on the first helper line and the end point on the second helper line.
... on this imaginary line a point is drawn from its starting point moving steadily to its end point.
Call stack - MDN Web Docs Glossary: Definitions of Web-related terms
when a script calls a function, the interpreter adds it to the call stack and then starts carrying out the function.
... call stack list: empty in summary, then, we start with an empty call stack.
Forbidden header name - MDN Web Docs Glossary: Definitions of Web-related terms
names starting with `sec-` are reserved for creating new headers safe from apis using fetch that grant developers control over headers, such as xmlhttprequest.
... forbidden header names start with proxy- or sec-, or are one of the following names: accept-charset accept-encoding access-control-request-headers access-control-request-method connection content-length cookie cookie2 date dnt expect feature-policy host keep-alive origin proxy- sec- referer te trailer transfer-encoding upgrade via note: the user-agent header is no longer forbidden, as per spec — see forbidden header name list (this was implemented in firefox 43) — it can now be set in a fetch headers object, or via xhr setrequestheader().
Grid Lines - MDN Web Docs Glossary: Definitions of Web-related terms
repeat(3, 1fr); grid-template-rows: repeat(3, 100px); } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } <div class="wrapper"> <div class="item">item</div> </div> .wrapper { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 100px 100px; } .item { grid-column-start: 1; grid-column-end: 3; grid-row-start: 1; grid-row-end: 3; } naming lines the lines created in the explicit grid can be named, by adding the name in square brackets before or after the track sizing information.
...round-color: #fff4e6; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 100px); } .wrapper > div { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480f; } <div class="wrapper"> <div class="item">item</div> </div> .wrapper { display: grid; grid-template-columns: [col1-start] 1fr [col2-start] 1fr [col3-start] 1fr [cols-end]; grid-template-rows: [row1-start] 100px [row2-start] 100px [rows-end]; } .item { grid-column-start: col1-start; grid-column-end: col3-start; grid-row-start: row1-start; grid-row-end: rows-end; } learn more property reference grid-template-columns grid-template-rows grid-column-start grid-column-end grid-column grid-row-star...
Page load time - MDN Web Docs Glossary: Definitions of Web-related terms
page load time is the time it takes for a page to load, measured from navigation start to the start of the load event.
... let time = performance.timing; let pageloadtime = time.loadeventstart - time.navigationstart; while page load time 'sounds' like the perfect web performance metric, it isn't.
Application Context - MDN Web Docs Glossary: Definitions of Web-related terms
otherwise, when the application context is created, the user agent must immediately navigate to the start url with replacement enabled.
... please note that the start url is not necessarily the value of the start_url member: the user or user agent could have changed it when the application was added to home-screen or otherwise bookmarked.
Assessment: Accessibility troubleshooting - Learn web development
starting point to get this assessment started, you should go and grab the zip containing the files that comprise the example.
... the finished assessment site should look like so: you will see some differences/issues with the display of the starting state of the assessment — this is mainly due to the differences in the markup, which in turn cause some styling issues as the css is not applied properly.
Mobile accessibility - Learn web development
note: see get started on android with talkback for more complete documentation.
...this occurs because we are using code such as the following: div.onmousedown = function() { initialboxx = div.offsetleft; initialboxy = div.offsettop; movepanel(); } document.onmouseup = stopmove; to enable other forms of control, you need to use different, yet equivalent events — for example, touch events work on touchscreen devices: div.ontouchstart = function(e) { initialboxx = div.offsetleft; initialboxy = div.offsettop; positionhandler(e); movepanel(); } panel.ontouchend = stopmove; we've provided a simple example that shows how to use the mouse and touch events together — see multi-control-box-drag.html (see the example live also).
A cool-looking box - Learn web development
starting point to get this assessment started, you should: make local copies of the starting html and css — save them as index.html and style.css in a new directory.
...make it completely transparent at the start, gradiating to around 0.2 opacity by 30% along, and remaining at the same color until the end.
Test your skills: The Cascade - Learn web development
for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Creating fancy letterheaded paper - Learn web development
if you want to make the right impression, writing a letter on nice letterheaded paper can be a really good start.
... starting point to get this assessment started, you should: make local copies of the html and css — save them as index.html and style.css in a new directory.
Debugging CSS - Learn web development
you can click the closing curly brace in the rule to start entering a new declaration into it, at which point you can start typing the new property and devtools will show you an autocomplete list of matching properties.
...you could start by doing view source on the page and copying the html into codepen, then grab any relevant css and javascript and include it too.
Fundamental CSS comprehension - Learn web development
starting point to get this assessment started, you should: go and grab the html file for the exercise, and the associated image file, and save them in a new directory on your local computer.
... you should include .card at the start of the selector chain in all your rules, so that these rules wouldn't interfere with the styling of any other elements if the business card were to be put on a page with a load of other content.
Organizing your CSS - Learn web development
previous overview: building blocks as you start to work on larger stylesheets and big projects you will discover that maintaining a huge css file can be challenging.
...if you want to learn a lot more about sass, start with the sass basics article, then move on to their other documentation.
Pseudo-classes and pseudo-elements - Learn web development
pseudo-classes are keywords that start with a colon: :pseudo-class-name simple pseudo-class example let's look at a simple example.
...pseudo-elements start with a double colon ::.
Test your skills: tables - Learn web development
for assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Floats - Learn web development
we'll start with a really simple example involving floating a block of text around an element.
... first, we'll start off with some simple html — add the following to your html body, removing anything that was inside there before: <h1>simple float example</h1> <div class="box">float</div> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit.
Test Your Skills: Fundamental layout comprehension - Learn web development
this starting point has all of the content of your layout as displayed by the browser in normal flow.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Multiple-column layout - Learn web development
you can follow along by downloading the multicol starting point file and adding the css into the appropriate places.
... our starting point contains some very simple html; a wrapper with a class of container inside which is a heading and some paragraphs.
Normal Flow - Learn web development
starting with a solid, well-structured document that is readable in normal flow is the best way to begin any webpage.
...in addition, as normal flow is designed to make a readable document, by starting in this way you are working with the document rather than fighting against it as you make changes to the layout.
Test your skills: Media Queries and Responsive Design - Learn web development
your task download the starting point.
...you can write the code yourself, or use the starting point files linked to in the above sections.
CSS layout - Learn web development
get started prerequisites before starting this module, you should already: have basic familiarity with html, as discussed in the introduction to html module.
...this article will give you all you need to know to get started with page layout, then test your grid skills before moving on.
How CSS works - Learn web development
when you start working with browser devtools you will be navigating the dom as you select items in order to see which rules apply.
... getting started with css how css is structured how css works using your new knowledge ...
What is CSS? - Learn web development
what's next now that you have some understanding of what css is, let's move on to getting started with css, where you can start to write some css yourself.
... getting started with css how css is structured how css works using your new knowledge ...
CSS FAQ - Learn web development
LearnCSSHowtoCSS FAQ
using a correct and modern doctype declaration at the start of your html will improve browser standards compliance.
...this problem got so bad that other browsers started to implement -webkit- prefixed aliases to improve web compatibility, as specified in the compatibility living standard.
Styling links - Learn web development
to start off with, we'll write out our empty rulesets: a { } a:link { } a:visited { } a:focus { } a:hover { } a:active { } this order is important because the link styles build on one another, for example the styles in the first rule will apply to all the subsequent ones, and when a link is being activated, it is also being hovered over.
... the fourth rule — which styles the <a> element — is the most complicated here; let's go through it step by step: as in previous examples, we start by turning off the default text-decoration and outline — we don't want those spoiling our look.
What is the difference between webpage, website, web server, and search engine? - Learn web development
we'll cover these terms and technologies in more detail as we explore further, but these quick definitions will be a great start for you: web page a document which can be displayed in a web browser such as firefox, google chrome, opera, microsoft internet explorer or edge, or apple's safari.
... here is an instance of firefox showing a google search box as its default startup page: next steps dig deeper: what is a web server see how web pages are linked into a web site: understanding links on the web ...
What is a URL? - Learn web development
if the path part of the url starts with the "/" character, the browser will fetch that resource from the top root of the server, without reference to the context given by the current document.
... examples of relative urls to better understand the following examples, let's assume that the urls are called from within the document located at the following url: https://developer.mozilla.org/docs/learn sub-resources skills/infrastructure/understanding_urls because that url does not start with /, the browser will attempt to find the document in a sub-directory of the one containing the current resource.
HTML forms in legacy browsers - Learn web development
if you are reading this on mdn, you are at the right place to start.
... <button> the <button> element suffered from two issues that are now resolved: a bug in old versions of internet explorer sent the html content available between the starting and ending tag of the <button> element instead of the content of the value attribute when clicked.
Sending forms through JavaScript - Learn web development
let data = ""; // so, if the user has selected a file if ( file.dom.files[0] ) { // start a new part in our body's request data += "--" + boundary + "\r\n"; // describe it as form data data += 'content-disposition: form-data; ' // define the name of the form data + 'name="' + file.dom.name + '"; ' // provide the real name of the file + 'filename="' + file.dom.files[0].name + '"\r\n'; // and the mime type...
... of the file data += 'content-type: ' + file.dom.files[0].type + '\r\n'; // there's a blank line between the metadata and the data data += '\r\n'; // append the binary data to our body's request data += file.binary + '\r\n'; } // text data is simpler // start a new part in our body's request data += "--" + boundary + "\r\n"; // say it's form data, and name it data += 'content-disposition: form-data; name="' + text.name + '"\r\n'; // there's a blank line between the metadata and the data data += '\r\n'; // append the text data to our body's request data += text.value + "\r\n"; // once we are done, "close" the body's request data += "--" + boundary + "--"; // define what happens on successful data submission ...
Test your skills: Form structure - Learn web development
download the starting point for this task to work in your own editor or in an online editor.
...you can write the code yourself, or use the starting point files linked to in the above sections.
Your first form - Learn web development
designing your form before starting to code, it's always better to step back and take the time to think about your form.
... the <form> element all forms start with a <form> element, like this: <form action="/my-handling-form-page" method="post"> </form> this element formally defines a form.
Web forms — Working with user data - Learn web development
get started prerequisites before starting this module, you should at least work through our introduction to html.
... the different form controls basic native form controls we start off this section by looking at the functionality of the the original html <input> types in detail, looking at what options are available to collect different types of data.
Dealing with files - Learn web development
previous overview: getting started with the web next a website consists of many files: text content, code, stylesheets, media content, and so on.
...your folder structure should look something like this: previous overview: getting started with the web next in this module installing basic software what will your website look like?
Publishing your website - Learn web development
previous overview: getting started with the web next once you finish writing the code and organizing the files that make up your website, you need to put it all online so people can find it.
... previous overview: getting started with the web next in this module installing basic software what will your website look like?
Use HTML to solve common problems - Learn web development
LearnHTMLHowto
if you're new to html you should start with this.
...here is where you should start: how to create a simple web form how to structure a web form tabular information some information, called tabular data, needs to be organized into tables with columns and rows.
Assessment: Structuring planet data - Learn web development
starting point to start the assessment, make local copies of blank-template.html, minimal-table.css, and planets-data.txt in a new directory in your local computer.
... open your copy of blank-template.html, and start the table off by giving it an outer container, a table header, and a table body.
HTML Tables - Learn web development
LearnHTMLTables
get started prerequisites before starting this module, you should already have covered the basics of html — see introduction to html.
... guides this module contains the following articles: html table basics this article gets you started with html tables, covering the very basics such as rows and cells, headings, making cells span multiple columns and rows, and how to group together all the cells in a column for styling purposes.
Asynchronous JavaScript - Learn web development
get started prerequisites asynchronous javascript is a fairly advanced topic, and you are advised to work through javascript first steps and javascript building blocks modules before attempting this.
... if you are not familiar with the concept of asynchronous programming, you should definitely start with the general asynchronous programming concepts article in this module.
Build your own function - Learn web development
start by accessing the function-start.html file and making a local copy.
... next, add the following inside the <script> element: function displaymessage() { } we start off with the keyword function, which means we are defining a function.
Functions — reusable blocks of code - Learn web development
now is the time, however, for us to start talking about functions explicitly, and really exploring their syntax.
...sometimes you don't want variables to be accessible from everywhere in the code — external scripts that you call in from elsewhere could start to mess with your code and cause problems because they happen to be using the same variable names as other parts of the code, causing conflicts.
Client-side web APIs - Learn web development
get started prerequisites to get the most out of this module, you should have worked your way through the previous javascript modules in the series (first steps, building blocks, and javascript objects).
... guides introduction to web apis first up, we'll start by looking at apis from a high level — what are they, how do they work, how do you use them in your code, and how are they structured?
Perceived performance - Learn web development
relevant measurements include first meaningful paint (fmp), largest contentful paint (lcp), time to interactive (tti), render start, dom interactive, and speed index.
... first paint is reported by the browser and provides the time, in ms, of when the page starts changing; but this change can be a simple background color update or something even less noticable.
Multimedia: video - Learn web development
it delays startup, but offers significant data savings for videos with a low probability of playback.
... similar to responsive images, the correct size video is delivered to the browser, ensuring fast video startup, low buffering, and optimized playback.
Web performance - Learn web development
we do however recommend that before you work through this module, you at least get a basic idea of web development by working through our getting started with the web module.
...the following is a suggested order for working through them; you should definitely start with the first one.
Client-Server Overview - Learn web development
this can start to get really inefficient — what happens when you get to thousands of product pages?
... the web browser will then start to process the returned html, sending separate requests to get any other css or javascript files that it references (see step 7).
Website security - Learn web development
note: this is an introductory topic, designed to help you start thinking about website security, but it is not exhaustive.
...we hope you've enjoyed learning these fundamental concepts, and you're now ready to select a web framework and start programming.
Server-side website programming - Learn web development
learning pathway getting started with server-side programming is usually easier than client-side development, because dynamic websites tend to perform a lot of very similar operations (retrieving data from a database and displaying it in a page, validating user-entered data and saving it in a database, checking user permissions and logging users in, etc.), and are constructed using web frameworks that make these and other comm...
...you should start with the first module, then go on to one of the following modules, which show how to work with two very popular server-side languages using appropriate web frameworks.
Ember resources and troubleshooting - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer...
... functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Using Vue computed properties - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer...
... functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Focus management with Vue refs - Learn web development
previous overview: client-side javascript frameworks next in this module introduction to client-side frameworks framework main features react getting started with react beginning our react todo list componentizing our react app react interactivity: events and state react interactivity: editing, filtering, conditional rendering accessibility in react react resources ember getting started with ember ember app structure and componentization ember interactivity: events, classes and state ember interactivity: footer...
... functionality, conditional rendering routing in ember ember resources and troubleshooting vue getting started with vue creating our first vue component rendering a list of vue components adding a new todo form: vue events, methods, and models styling vue components with css using vue computed properties vue conditional rendering: editing existing todos focus management with vue refs vue resources svelte getting started with svelte starting our svelte todo list app dynamic behavior in svelte: working with variables and props componentizing our svelte app advanced svelte: reactivity, lifecycle, accessibility working with svelte stores typescript support in svelte deployment and next steps ...
Implementing feature detection - Learn web development
start by making local copies of our css-feature-detect.html, flex-layout.css, float-layout.css, and basic-styling.css files.
... next up, we'll start looking at automated testing.
Cross browser testing - Learn web development
get started prerequisites you should really learn the basics of the core html, css, and javascript languages first before attempting to use the tools detailed here.
... guides introduction to cross browser testing this article starts the module off by providing an overview of the topic of cross browser testing, answering questions such as "what is cross browser testing?", "what are the most common types of problems you'll encounter?", and "what are the main approaches for testing, identifying, and fixing problems?" strategies for carrying out testing next, we drill down into carrying out testing, looking at identifying a target audience (e.g.
Understanding client-side web development tools - Learn web development
get started now, with our "client-side tooling overview" prerequisites you should really learn the basics of the core html, css, and javascript languages first before attempting to use the tools detailed here.
... get started guides 1.
Accessibility API cross-reference
this table is the start of a cross-reference, so we can spot the differences and similarities in the apis.
... fill out tagged pdf column (relevant documents from pdf association) add missing aria properties fill out events cross reference table use this info to expand mozilla's accessibility api coverage to include mac, so that we can start to freeze them talk about the fact that msaa uses one interface (iaccessible), wherease gnome accessibility uses a lot of different interfaces depending on the type of object go through the atk info and make sure it's up-to-date accessible roles description & notes msaa role (role_system_*) java accessibility role gnome accessibility role (atk_role_*) mac os x accessibil...
What to do and what not to do in Bugzilla
canconfirm privilege the canconfirm privilege allows you to confirm bugs and also to start your bug reports in the confirmed state (new).
...when verifying a bug, you should remember the following: verifying duplicates is the easiest task, so start with that.
Chrome registration
starting with gecko 2.0, the root chrome.manifest is the only manifest used; you can add manifest commands to that file to load secondary manifests.
... gecko 1.9.2 note the contents.rdf manifest format is no longer supported at all starting with gecko 1.9.2; add-ons already installed using this format will continue to work but can no longer be installed.
Cookies Preferences in Mozilla
if you have the old-style prefs, they will be migrated when starting the application.
... (the old prefs are network.cookie.lifetime.enabled, network.cookie.lifetime.behavior, and network.cookie.warnaboutcookies.) true = prefs have been migrated false = migrate prefs on next startup original document information author(s): mike connor last updated date: may 22, 2004 copyright information: portions of this content are © 1998–2007 by individual mozilla.org contributors; content available under a creative commons license | details.
Creating a Firefox sidebar
it's the easiest way to create an extension with a sidebar.obsolete since gecko 57 you can also build a restartless extension yourself without the sdk.
... a sample extension to add a web panel is available as a starter.obsolete since gecko 57 if you'd like to have a deeper integration with the browser to offer more complex features, a traditional overlay extension can be an option.
Old Thunderbird build
building thunderbird before you start, make sure that the version you checked out is not busted.
... for hg tip, you should see green bs on https://treeherder.mozilla.org/#/jobs?repo=comm-central to start the build, cd into the comm-central subdirectory, and run: ./mozilla/mach build mach is our command-line tool to streamline common developer tasks.
Creating Custom Events That Can Pass Data
note that starting with version 6, firefox supports dom level 3 customevent, which lets you dispatch custom events with arbitrary data from javascript.
...as of gecko 1.8, if your event names do not start with "nsdom" and their interfaces do not start with "nsidom" then you can forget about passing data.
ESLint
in order to help people write standard-compliant code from the start and avoid wasting time during code reviews, a set of eslint configuration files have been added to the code base so that javascript can be analyzed automatically.
... more information: outline details of the rules rule source code common issues and how to solve them my editor says that "mozilla/whatever" is unknown run ./mach eslint --setup restart your editor if that doesn't work, check that you have your editor pointing to the correct node_modules folder.
Developer guide
this guide provides information that will not only help you get started as a mozilla contributor, but that you'll find useful to refer to even if you are already an experienced contributor.
... documentation topics getting started a step-by-step beginner's guide to getting involved with mozilla.
Displaying Places information using views
note: starting in gecko 2.0, you can't use the place attribute with menus.
... note: starting in gecko 2.0, nsinavhistoryresultviewer has been replaced by the more powerful nsinavhistoryresultobserver.
Frame script loading and lifetime
at the moment, frame scripts are cached until the browser restarts: this problem is tracked as bug 1051238.
... this is a problem especially for restartless add-ons; because when a new version of the add-on is installed, the old frame scripts will not be unloaded.
Performance best practices for Firefox front-end engineers
that means that finding and removing (when possible) over-painting is a good place to start reducing your burden on the main thread, which will in turn improve performance.
... explicitly define start and end animation values some optimizations in the animation code of gecko are based on an expectation that the from (0%) and the to (100%) values will be explicitly defined in the @keyframes definition.
Firefox and the "about" protocol
bout:credits lists all contributors to the firefox project about:debugging switches to the developer tools debugging page, which allows you to debug add-ons, tabs and service workers about:devtools summarizes the developer tools and provides links to documentation for each tool about:downloads displays all downloads done within firefox about:home start page of firefox when opening a new window about:license displays licensing information about:logo firefox logo about:memory provides a way to display memory usage, save it as report and run the gc and cc about:mozilla special page showing a message from "the book of mozilla" about:networking displays networking information about...
...:newtab start page when opening a new tab about:performance displays memory and performance information about firefox subprocesses/add-ons/tabs about:plugins displays information about installed plugins about:policies lists out the firefox for enterprise policies about:preferences firefox settings (also available through firefox menu > options) about:privatebrowsing start page when opening a private window about:profiles display and manage firefox profiles about:protections privacy protections report consisting of enhanced tracking protection, firefox monitor and firefox lockwise data about:restartrequired a page users are sent to when firefox requires a restart due to an update about:rea...
mozbrowseraudioplaybackchange
the mozbrowseraudioplaybackchange event is fired when audio starts or stops playing within a browser <iframe>.
... examples var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowseraudioplaybackchange", function(event) { console.log(event.details); }); related events mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserloadend
example in this example the mozbrowserloadstart and mozbrowserloadend events are used to change the icon shown on the stop/reload button between stop (x) and reload (r), as appropriate.
...er('mozbrowserloadend',function(e) { stopreload.textcontent = 'r'; console.log(e.detail.backgroundcolor); controls.style.background = e.detail.backgroundcolor; }); browser.addeventlistener('mozbrowserloadend',function() { stopreload.textcontent = 'r'; }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
HTMLIFrameElement.sendTouchEvent()
possible values are touchstart, touchend, touchmove, or touchcancel.
... examples var browser = document.queryselector('iframe'); browser.sendtouchevent("touchstart", [1], [x], [y], [2], [2], [20], [0.5], 1, 0); specification not part of any specification.
Creating a New Protocol
this is a quick-start on details of how to add a new ipdl protocol to the build.
...protocol names start with p, and protocol files must be named pprotocolname.ipdl.
Implementing Download Resuming
not only is the ability to specify a start position important, but it's also important to have some assurance that the file did not change since the initial download attempt.
...otherwise, call resumeat with the desired start position, and the previously stored entity id.
JavaScript-DOM Prototypes in Mozilla
during startup, the nsdomclassinfo code registers two different types of "global names", these are names of properties of the global object with special meaning to the dom code.
...this will cause the code to recurse down along the parent chain of the interface of interest for the name we started out resolving (i.e.
JavaScript Tips
however in addition to locating elements by tag name xul also allows you to locate an element by attribute, starting at any element in the document.
... references this was started as a reprint of neil's guide some more current info on this blog post how to remove duplicate objects from an array javascript ...
AsyncShutdown.jsm
if, for some reason, promise is never resolved/rejected, firefox will crash during shutdown to avoid blocking system shutdown, preventing the user from restarting firefox or burning through a battery.
... // execute this code during profilebeforechange // no specific guarantee about completion of profilebeforechange }); if the promise returned by condition is not resolved/rejected within one minute, the process will crash to avoid blocking system shutdown, preventing the user from restarting firefox or burning through battery.
Following the Android Toasts Tutorial from a JNI Perspective
java code let's start with the following java code, which invokes a toast and says "hello, firefox!".
... declare the types we will start by declaring the types needed.
NetUtil.jsm
note: starting in gecko 2, this method supports specifying an nsifile as the target of the uri.
... nsiuri newuri( atarget, [optional] aorigincharset, [optional] abaseuri ); parameters atarget specifies the target of the uri as either a uri string or (starting in gecko 2) as an nsifile.
Promise.jsm
to use it, you first need to import the code module into your javascript scope: components.utils.import("resource://gre/modules/promise.jsm"); note: a preliminary promise module is also available starting from gecko 17, though it didn't conform to the promises/a+ proposal until gecko 25: components.utils.import("resource://gre/modules/commonjs/promise/core.js"); // gecko 17 to 20 components.utils.import("resource://gre/modules/commonjs/sdk/core/promise.js"); // gecko 21 to 24 this implementation also includes helper functions that are specific to the add-on sdk.
... introduction for an introduction to promises, you may start from the add-on sdk documentation, keeping in mind that only the core subset is implemented in this module.
PromiseWorker.jsm
main thread file the basepromiseworker object needs to be imported: const { utils: cu } = components; const { basepromiseworker } = cu.import('resource://gre/modules/promiseworker.jsm', {}); let myworker = new basepromiseworker('path_to_worker_file.js'); you're now ready to start using promiseworker.
...worker = new promiseworker.abstractworker(); worker.dispatch = function(method, args = []) { return self[method](...args); }; worker.postmessage = function(...args) { self.postmessage(...args); }; worker.close = function() { self.close(); }; worker.log = function(...args) { dump('worker: ' + args.join(' ') + '\n'); }; self.addeventlistener('message', msg => worker.handlemessage(msg)); // start - my functionalities function resolvetest(shouldresolve) { if (shouldresolve) { return 'you sent to promiseworker argument of: `' + shouldresolve + '`'; } else { throw new error('you passed in a non-true value for shouldresolve argument and therefore this will reject the main thread promise'); } } main thread file bootstrap.js const { utils: cu } = components; const { basepromi...
SourceMap.jsm
new sourcemapgenerator(startofsourcemap) to create a new one, you must pass an object with the following properties: file: the filename of the generated source that this source map is associated with.
... sourcenode.prototype.tostringwithsourcemap(startofsourcemap) returns the string representation of this tree of source nodes, plus a sourcemapgenerator which contains all the mappings between the generated and original sources.
WebRequest.jsm
usage to import webrequest, use code like: let {webrequest} = cu.import("resource://gre/modules/webrequest.jsm", {}); the webrequest object has the following properties, each of which corresponds to a specific stage in executing a web request: onbeforerequest onbeforesendheaders onsendheaders onheadersreceived onresponsestarted oncompleted each of these objects defines two functions: addlistener(callback, filter, opt_extrainfospec) removelistener(callback) adding listeners use addlistener to add a listener to a particular event.
... onresponsestarted triggered once the browser has started to receive the response body.
Webapps.jsm
importing components.utils.import("resource://gre/modules/webapps.jsm"); // exported symbol is domapplicationregistry method overview init: function() loadcurrentregistry: function() notifyappsregistrystart: function notifyappsregistrystart() notifyappsregistryready: function notifyappsregistryready() sanitizeredirects: function sanitizeredirects(asource) _savewidgetsfullpath: function(amanifest, adestapp) appkind: function(aapp, amanifest) updatepermissionsforapp: function(aid, aispreinstalled) updateofflinecacheforapp: function(aid) installpreinstalledapp: function installpreinstalledapp(aid) removeifhttpsduplicate: function(aid) installsystemapps: functio...
...rupdatehandler: function(ahandler) unregisterupdatehandler: function(ahandler) notifyupdatehandlers: function(aapp, amanifest, azippath) _getappdir: function(aid) _writefile: function(apath, adata) dogetlist: function() doexport: function(amsg, amm) doimport: function(amsg, amm) doextractmanifest: function(amsg, amm) dolaunch: function (adata, amm) launch: function launch(amanifesturl, astartpoint, atimestamp, aonsuccess, aonfailure) close: function close(aapp) canceldownload: function canceldownload(amanifesturl, aerror) startofflinecachedownload: function(amanifest, aapp, aprofiledir, aisupdate) computemanifesthash: function(amanifest) updateapphandlers: function(aoldmanifest, anewmanifest, aapp) checkforupdate: function(adata, amm) doinstall: function doinstall(adata, amm) ...
L10n testing with xcode
to view these strings, you'll need to start the accessibility inspector within the ios simulator by doing the following.
...the accessibility inspector remains active until you turn it off, even if you quit and restart ios simulator.
Localizing with Pontoon
pontoon will automatically open that locale's project for you to get started.
...we'll start with looking at in-context translation.
QA phase
restart your browser and start testing!
... we use a web service called bit bucket to start the learning process.
Localization technical reviews
the technical review process we use for new localizations can be confusing for any trying to start a new localization.
... after you've finished celebrating your first approved release, it's time to start planning for the next one!
Setting up the infrastructure
create a new branch for l10n (optional if starting a new project).
... restart apache to reload gettext files (necessary for any text changes).
Fonts for Mozilla's MathML engine
note: a deprecated version of stix is preinstalled starting with os x lion and should ensure relatively good mathml rendering.
... asana math cambria math dejavu math tex gyre garamond math (under development) latin modern math libertinus math lucida bright math minion math stix math tex gyre bonum math tex gyre pagella math tex gyre schola math tex gyre termes math xits math fira math (sans-serif typeface, under development) gfs neohellenic math (sans-serif typeface) using mathematical fonts on web pages starting with gecko 31.0 (firefox 31.0 / thunderbird 31.0 / seamonkey 2.28), it is now easy to set up the css style (and optional woff fonts) to use on your web site.
Fonts for Mozilla 2.0's MathML engine
starting in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4), mozilla can also use the glyphs contained in that font for stretchy operators.
... starting in gecko 13.0 (firefox 13.0 / thunderbird 13.0 / seamonkey 2.10), mathjax fonts are used as the default fonts for mathematical text and symbol stretching.
Mozilla DOM Hacking Guide
before we start looking at the implementation of the nsixpcscriptable interface, the implementor needs the following information: which dom object is concerned what action does he want to override what should happen for our example, it is the window object.
...with that information in hand, we can start coding.
Mozilla Style System Documentation
problems: dynamic style changes scrap the whole thing and start over.
... when nsrulenode::walkruletree computes a struct, it walks the rules, starting with the style context's rule node, towards the root of the rule tree.
JS::PerfMeasurement
void start() call this on a perfmeasurement instance to start timing.
... counter values are accumulated across many start/stop cycles, and you can modify their values if you want; stop simply adds counts read back from the os to whatever is already in each counter.
Memory Profiler
start - start profiling stop - stop profiling reset - clear profile data when profiler is stopped profile data is accumulated and resumed after start.
... use reset to start a new recording.
Memory reporting
in some cases this works, but there's a lot of c++ subtlety involving the amallocsizeof(this) and whether this actually points to the start of the allocated object or somewhere in its middle.
...and if amallocsizeof is passed a pointer that doesn't point to the start of an object it will give bogus results or even crash.
Refcount tracing and balancing
an object's serial number is simply a unique number, starting at one, that is assigned to the object when it is allocated.
... you may use an object's serial number with the following variable to further restrict the reference count tracing: xpcom_mem_log_objects set this variable to a comma-separated list of object serial number or ranges of serial number, e.g., 1,37-42,73,165 (serial numbers start from 1, not 0).
Reporting a Performance Problem
make sure to choose an appropriate setting for the recording (if you're not sure, choose firefox platform), and then choosing "start recording".
... using the keyboard shortcuts is often more convenient than using the mouse to interact with the ui: ctrl+shift+1 - start/stop the profiler ctrl+shift+2 - take a profile and launch the viewer to view it capturing and sharing a profile while the profiler is recording, reproduce the performance problem.
Scroll-linked effects
<body style="height: 5000px"> <style> body, /* blink currently has bug that requires declaration on `body` */ html { scroll-snap-type: y proximity; } .snaptarget { scroll-snap-align: start; position: relative; top: 200px; height: 200px; background-color: green; } </style> <div class="snaptarget"></div> </body> this version can work smoothly in the browser even if there is slow-running javascript on the browser's main thread.
...in all cases, however, firefox will display a warning to the developer console (starting in version 46) if it detects the presence of a scroll-linked effect on a page.
about:memory
59 mb (01.87%) ++ (4 tiny) ├───45.74 mb (23.84%) ++ js-non-window ├───33.73 mb (17.58%) ── heap-unclassified ├───22.51 mb (11.73%) ++ heap-overhead ├────6.62 mb (03.45%) ++ images ├────5.82 mb (03.03%) ++ workers/workers(chrome) ├────5.36 mb (02.80%) ++ (16 tiny) ├────4.07 mb (02.12%) ++ storage ├────2.74 mb (01.43%) ++ startup-cache └────2.16 mb (01.12%) ++ xpconnect some expertise is required to understand the full details here, but there are various things worth pointing out.
... there are measurements for other content such as images and workers, and for browser subsystems such as the startup cache and xpconnect.
browser.altClickSave
the preference browser.altclicksave controls whether clicking a link while holding the alt key starts the download of that link.
... type:boolean default value: false exists by default: yes application support:firefox 13.0 status: active; last updated 2012-03-19 introduction: pushed to nightly on 2012-03-02 bugs: bug 713052 values true clicking a link while holding the alt key starts the download of that link.
nglayout.debug.disable_xul_cache
the xul cache is serialized and saved between mozilla sessions in the xul fastload file, which saves a “compiled” version of the xul and javascript in a document to disk for faster startup the next time the application runs.
... during development of xul applications, it’s convenient to disable the xul cache so that changes you make to files on disk take effect the next time the window or dialog is loaded (instead of the next time mozilla starts).
Emscripten
to get started with emscripten, go to the official emscripten wiki.
...read more about emscripten and try some demos, then get started with using it.
AsyncTestUtils extended framework
calling async_driver() lets it know to start up again.
... age: (strictly incrementing from arbitrary origin) the default starts at jan 1, 2000 and adds an hour for every message.
Anonymous Shared Memory
started by server via pr_createprocess() fm = pr_getinheritedfilemap( shmname ); addr = pr_memmap(fm); ...
...started by server via his own magic ...
NSS 3.14.1 release notes
bug 810582 - tls false start is now only used with servers that negotiate a cipher suite that supports forward secrecy.
... note: the criteria for false start may change again in future nss releases.
NSS 3.31 release notes
new macros in pkcs11uri.h several new macros that start with pk11uri_pattr_ for path attributes defined in rfc7512.
... several new macros that start with pk11uri_qattr_ for query attributes defined in rfc7512.
NSS API Guidelines
in short: header files for consumption outside nss start with "nss." header files with types have a trailing "t", header files with prototypes don't.
...in the case of removal, the search can either be either restarted, or terminated.
NSS Developer Tutorial
variable, and function parameter names, always start with a lowercase letter.
... one line comments starting with // are permitted.
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
st der */ certreq = getcertrequest(infilename, ascii); if (certreq == null) { rv = secfailure; goto cleanup; } subjectcert = makev1cert(handle, certreq, issuernickname, selfsign, serialnumber, warpmonths, validitymonths); if (subjectcert == null) { rv = secfailure; goto cleanup; } exthandle = cert_startcertextensions (subjectcert); if (exthandle == null) { rv = secfailure; goto cleanup; } if (certreq->attributes != null && certreq->attributes[0] != null && certreq->attributes[0]->attrtype.data != null && certreq->attributes[0]->attrtype.len > 0 && secoid_findoidtag(&certreq->attributes[0]->attrtype) == sec...
... cr = cert_createcertificaterequest(subject, spki, null); if (!cr) { pr_fprintf(pr_stderr, "unable to make certificate request\n"); rv = secfailure; goto cleanup; } arena = port_newarena(der_default_chunksize); if (!arena) { fprintf(stderr, "out of memory"); rv = secfailure; goto cleanup; } exthandle = cert_startcertificaterequestattributes(cr); if (exthandle == null) { port_freearena (arena, pr_false); rv = secfailure; goto cleanup; } cert_finishextensions(exthandle); cert_finishcertificaterequestattributes(cr); /* der encode the request */ encoding = sec_asn1encodeitem(arena, null, cr, sec_asn1_get(cert_cer...
NSS Sample Code Utilities_1
urn null; } nb = pr_read(fd, phrases, maxpwdfilesize); pr_close(fd); if (nb == 0) { fprintf(stderr,"password file contains no data\n"); port_free(phrases); return null; } if (slot) { tokenname = pk11_gettokenname(slot); if (tokenname) { tokenlen = port_strlen(tokenname); } } i = 0; do { int startphrase = i; int phraselen; /* handle the windows eol case */ while (phrases[i] != '\r' && phrases[i] != '\n' && i < nb) i++; /* terminate passphrase */ phrases[i++] = '\0'; /* clean up any eol before the start of the next passphrase */ while ( (i<nb) analyze="" char="" current="" getmodulepassword="" if="" int="" now="" passphrase="" phrase...
...="&amp;phrases[startphrase];" phraselen="" pk11slotinfo="" pwdata="=" pwdata-="" retry="" return="" secupwdata="" the="" void="" while="">source != pw_none) { pr_fprintf(pr_stderr, "incorrect password/pin entered.\n"); return null; } switch (pwdata->source) { case pw_none: sprintf(prompt, "enter password or pin for \"%s\":", pk11_gettokenname(slot)); return getpassword(stdin, stdout, prompt, checkpassword); case pw_fromfile: pw = filepasswd(slot, retry, pwdata->data); pwdata->source = pw_plaintext; pwdata->data = pl_strdup(pw); return pw; case pw_plaintext: return pl_strdup(pwdata->data); default: break; } pr_fprintf(pr_stderr, "password check failed: no password foun...
Utilities for nss samples
urn null; } nb = pr_read(fd, phrases, maxpwdfilesize); pr_close(fd); if (nb == 0) { fprintf(stderr,"password file contains no data\n"); port_free(phrases); return null; } if (slot) { tokenname = pk11_gettokenname(slot); if (tokenname) { tokenlen = port_strlen(tokenname); } } i = 0; do { int startphrase = i; int phraselen; /* handle the windows eol case */ while (phrases[i] != '\r' && phrases[i] != '\n' && i < nb) i++; /* terminate passphrase */ phrases[i++] = '\0'; /* clean up any eol before the start of the next passphrase */ while ( (i<nb) && (phrases[i] == '\r' || phrases[i] == '\n')) { phrases[i++] = '\0'; }...
... /* now analyze the current passphrase */ phrase = &phrases[startphrase]; if (!tokenname) break; if (port_strncmp(phrase, tokenname, tokenlen)) continue; phraselen = port_strlen(phrase); if (phraselen < (tokenlen+1)) continue; if (phrase[tokenlen] != ':') continue; phrase = &phrase[tokenlen+1]; break; } while (i<nb); phrase = port_strdup((char*)phrase); port_free(phrases); return phrase; } /* * getmodulepassword */ char* getmodulepassword(pk11slotinfo *slot, int retry, void *arg) { char prompt[255]; secupwdata *pwdata = (secupwdata *)arg; char *pw; if (pwdata == null) { return null; } if (retry && pwdata->source != pw_none) { pr_fprintf(pr_stderr, "i...
sample2
dwr | pr_create_file | pr_truncate, 00660); /* create a cert request object from the input cert request der */ certreq = getcertrequest(infilename, ascii); if (certreq == null) { rv = secfailure; goto cleanup; } subjectcert = makev1cert(handle, certreq, issuernickname, selfsign, serialnumber, warpmonths, validitymonths); if (subjectcert == null) { rv = secfailure; goto cleanup; } exthandle = cert_startcertextensions (subjectcert); if (exthandle == null) { rv = secfailure; goto cleanup; } if (certreq->attributes != null && certreq->attributes[0] != null && certreq->attributes[0]->attrtype.data != null && certreq->attributes[0]->attrtype.len > 0 && secoid_findoidtag(&certreq->attributes[0]->attrtype) == sec_oid_pkcs9_extension_request) { rv = cert_getcertificaterequestextensions(certreq, &crexts)...
...subject public key\n"); rv = secfailure; goto cleanup; } /* generate certificate request */ cr = cert_createcertificaterequest(subject, spki, null); if (!cr) { pr_fprintf(pr_stderr, "unable to make certificate request\n"); rv = secfailure; goto cleanup; } arena = port_newarena(der_default_chunksize); if (!arena) { fprintf(stderr, "out of memory"); rv = secfailure; goto cleanup; } exthandle = cert_startcertificaterequestattributes(cr); if (exthandle == null) { port_freearena (arena, pr_false); rv = secfailure; goto cleanup; } cert_finishextensions(exthandle); cert_finishcertificaterequestattributes(cr); /* der encode the request */ encoding = sec_asn1encodeitem(arena, null, cr, sec_asn1_get(cert_certificaterequesttemplate)); if (encoding == null) { pr_fprintf(pr_stderr, "der encoding of request ...
PKCS 7 functions
3.2 and later sec_pkcs7createenvelopeddata mxr 3.2 and later sec_pkcs7createsigneddata mxr 3.2 and later sec_pkcs7decodeitem mxr 3.2 and later sec_pkcs7decoderabort mxr 3.9 and later sec_pkcs7decoderfinish mxr 3.2 and later sec_pkcs7decoderstart mxr 3.2 and later sec_pkcs7decoderupdate mxr 3.2 and later sec_pkcs7decryptcontents mxr 3.2 and later sec_pkcs7destroycontentinfo mxr 3.2 and later sec_pkcs7encode mxr 3.3 and later sec_pkcs7encodeitem mxr 3.9.3 and later sec_pkcs7...
...encoderabort mxr 3.9 and later sec_pkcs7encoderfinish mxr 3.2 and later sec_pkcs7encoderstart mxr 3.2 and later sec_pkcs7encoderupdate mxr 3.2 and later sec_pkcs7getcertificatelist mxr 3.2 and later sec_pkcs7getcontent mxr 3.2 and later sec_pkcs7getencryptionalgorithm mxr 3.2 and later sec_pkcs7getsignercommonname mxr 3.4 and later sec_pkcs7getsigneremailaddress mxr 3.4 and later sec_pkcs7getsigningtime mxr 3.4 and later sec_pkcs7includecertchain mxr 3.2 and later sec_pkcs7iscontentempty ...
NSS tools : ssltab
usage tips when ssl restarts a previous session, it makes use of cached information to do a partial handshake.
... if you wish to capture a full ssl handshake, restart the browser to clear the session id cache.
NSS tools : ssltap
usage tips when ssl restarts a previous session, it makes use of cached information to do a partial handshake.
... if you wish to capture a full ssl handshake, restart the browser to clear the session id cache.
NSS reference
getting started with nss based on "getting started with ssl" in the ssl reference.
... sec_pkcs12createexportcontext sec_pkcs12createpasswordprivsafe sec_pkcs12createunencryptedsafe sec_pkcs12addcertandkey sec_pkcs12addpasswordintegrity sec_pkcs12enablecipher sec_pkcs12encode sec_pkcs12destroyexportcontext sec_pkcs12decoderstart sec_pkcs12decoderimportbags sec_pkcs12decoderupdate sec_pkcs12decoderfinish sec_pkcs12decodervalidatebags sec_pkcs12decoderverify sec_pkcs12decodergetcerts sec_pkcs12decodersettargettokencas sec_pkcs12decoderiterateinit sec_pkcs12decoderiteratenext sec_pkcs12isencryptionallowed sec_pkcs12setpreferredcipher nspr functions a small number of nspr functions are required for using the ce...
OLD SSL Reference
chapter 2, "getting started with ssl" illustrates their use in sample client and server applications.
... initialization initializing caches configuration communication functions used by callbacks cleanup chapter 2 getting started with ssl this chapter describes how to set up your environment, including certificate and key databases, to run the nss sample code.
sslintro.html
chapter 2, "getting started with ssl" illustrates their use in sample client and server applications.
...these can be used, for example, when interrupting and restarting socket communications, when the application needs to change socket parameters, or when an application imports a socket into ssl after the tcp connection on that socket has already been established.
S/MIME functions
_setcontent_encrypteddata mxr 3.2 and later nss_cmscontentinfo_setcontent_envelopeddata mxr 3.2 and later nss_cmscontentinfo_setcontent_signeddata mxr 3.2 and later nss_cmsdecoder_cancel mxr 3.2 and later nss_cmsdecoder_finish mxr 3.2 and later nss_cmsdecoder_start mxr 3.2 and later nss_cmsdecoder_update mxr 3.2 and later nss_cmsdigestcontext_cancel mxr 3.2 and later nss_cmsdigestcontext_finishmultiple mxr 3.2 and later nss_cmsdigestcontext_finishsingle mxr 3.2 and later nss_cmsdigestcontext_startmultiple mxr ...
... 3.2 and later nss_cmsdigestcontext_startsingle mxr 3.2 and later nss_cmsdigestcontext_update mxr 3.2 and later nss_cmsdigesteddata_create mxr 3.2 and later nss_cmsdigesteddata_destroy mxr 3.2 and later nss_cmsdigesteddata_getcontentinfo mxr 3.2 and later nss_cmsderencode mxr 3.2 and later nss_cmsencoder_cancel mxr 3.2 and later nss_cmsencoder_finish mxr 3.2 and later nss_cmsencoder_start mxr 3.2 and later nss_cmsencoder_update mxr 3.2 and later nss_cmsencrypteddata_create mxr 3.2 and later ...
Utility functions
sec_asn1decoderclearfilterproc mxr 3.2 and later sec_asn1decoderclearnotifyproc mxr 3.2 and later sec_asn1decoderfinish mxr 3.2 and later sec_asn1decodersetfilterproc mxr 3.2 and later sec_asn1decodersetnotifyproc mxr 3.2 and later sec_asn1decoderstart mxr 3.2 and later sec_asn1decoderupdate mxr 3.2 and later sec_asn1encode mxr 3.2 and later sec_asn1encodeinteger mxr 3.2 and later sec_asn1encodeitem mxr 3.2 and later sec_asn1encoderabort mxr 3.9 and later sec_asn1encoderclearnoti...
... sec_asn1encodercleartakefrombuf mxr 3.2 and later sec_asn1encoderfinish mxr 3.2 and later sec_asn1encodersetnotifyproc mxr 3.2 and later sec_asn1encodersetstreaming mxr 3.2 and later sec_asn1encodersettakefrombuf mxr 3.2 and later sec_asn1encoderstart mxr 3.2 and later sec_asn1encoderupdate mxr 3.2 and later sec_asn1encodeunsignedinteger mxr 3.11.1 and later sec_asn1lengthlength mxr 3.2 and later sec_dupcrl mxr 3.9 and later sec_getsignaturealgorithmoidtag mxr 3.10 and later sec...
NSS Tools ssltap
usage tips when ssl restarts a previous session, it makes use of cached information to do a partial handshake.
... if you wish to capture a full ssl handshake, restart the browser to clear the session id cache.
NSS tools : ssltap
MozillaProjectsNSStoolsssltap
usage tips when ssl restarts a previous session, it makes use of cached information to do a partial handshake.
... if you wish to capture a full ssl handshake, restart the browser to clear the session id cache.
Network Security Services
if you're a developer and would like to contribute to nss, you might want to read the documents highlevel overview of internal details of nss and getting started with nss.
... getting started nss releases this page contains information about the current and past releases of nss.
Tutorial: Embedding Rhino
to make sure that it is called even if an exception is thrown, it is put into the finally block corresponding to the try block starting after context.enter().
...for example, we can see how to implement java.lang.runnable in a rhino shell session: js> obj = { run: function() { print("hi"); } } [object object] js> obj.run() hi js> r = new java.lang.runnable(obj); [object object] js> t = new java.lang.thread(r) thread[thread-0,5,main] js> t.start() hi adding java objects the next example is runscript2.
Tracing JIT
the monitor also keeps track of how many times it has attempted to record a trace starting at each pc value, so if a particular pc causes too many aborted recordings, the monitor blacklists the pc and will not attempt recording it any longer.
...if that pc has itself grown hot, the monitor will immediately transition to recording mode starting with the exiting pc.
JS::HandleValueArray
:handlevaluearray(const js::rootedvalue& value); js::handlevaluearray(const js::autovaluevector& values); js::handlevaluearray(const js::autovaluearray<n>& values); js::handlevaluearray(const js::callargs& args); js::handlevaluearray::frommarkedlocation(size_t len, const js::value *elements); js::handlevaluearray::subarray(const js::handlevaluearray& values, size_t startindex, size_t len); js::handlevaluearray::empty(); name type description value js::rootedvalue &amp; an element of newly created 1-length array.
... startindex size_t (subarray only) an index of the first element of subarray of values.
JSClass.flags
jsclass_new_resolve_gets_start obsolete since jsapi 16 the resolve hook expects to receive the starting object in the prototype chain passed in via the *objp in/out parameter.
... see also bug 527805 - removed jsclass_share_all_properties bug 571789 - removed jsclass_is_extended bug 638291 - removed jsclass_mark_is_trace bug 641025 - added jsclass_implements_barriers bug 702507 - removed jsclass_construct_prototype bug 758913 - removed jsclass_new_resolve_gets_start bug 766447 - added jsclass_is_domjsclass bug 792108 - added jsclass_emulates_undefined bug 993026 - removed jsclass_new_resolve bug 1097267 - removed jsclass_new_enumerate ...
JS_SetGCCallback
during each complete garbage collection cycle, the current gc callback is called four times: jsgc_begin start of gc.
... the callback may prevent gc from starting by returning false.
JSAPI reference
the reference applies this versioning scheme retroactively starting with firefox 5.
...lass_is_domjsclass added in spidermonkey 17 jsclass_implements_barriers added in spidermonkey 17 jsclass_emulates_undefined added in spidermonkey 24 jsclass_has_reserved_slots(n) jsclass_global_flags jsclass_new_enumerate obsolete since jsapi 37 jsclass_new_resolve obsolete since jsapi 36 jsclass_share_all_properties obsolete since javascript 1.8.5 jsclass_new_resolve_gets_start obsolete since jsapi 16 jsclass_construct_prototype obsolete since jsapi 11 jsclass_is_extended obsolete since jsapi 17 jsclass_mark_is_trace obsolete since jsapi 5 the behavior of a jsclass and its instances can be customized in many ways using callback functions.
JSDBGAPI
js_connectshark js_disconnectshark js_startchudremote js_stopchudremote the following jsnative functions can be used to expose the above four apis to scripts.
... js_connectshark js_disconnectshark js_startshark js_stopshark ...
Thread Sanitizer
three are required by tsan ac_add_options --disable-jemalloc ac_add_options --disable-crashreporter ac_add_options --disable-elf-hack # keep symbols to symbolize tsan traces export moz_debug_symbols=1 ac_add_options --enable-debug-symbols ac_add_options --disable-install-strip # settings for an opt build ac_add_options --enable-optimize="-o2 -gline-tables-only" ac_add_options --disable-debug starting the build process now you start the build process using the regular make -f client.mk command.
... starting firefox after the build has completed, you can start firefox from the objdir as usual.
Mozilla Projects
internet explorer also supports the ability to edit specific elements using the contenteditable attribute; starting with firefox 3, gecko also supports contenteditable.
...the core of pork is a c++ parser that provides exact character positions for the start and end of every ast node, as well as the set of macro expansions that contain any location.
Mork
MozillaTechMork
starting with mozilla 1.9, it was phased out in favor of sqlite, a more widely-supported file format.
...the keys are hexadecimal numbers starting at 0x80, because the values less than 0x80 are theoretically their representative ascii values.
Places Expiration
places.history.expiration.max_pages: the maximum number of pages that may be retained in the database before starting to expire.
... default value is calculated on startup and put into the places.history.expiration.transient_current_max_pages preference.
Using the Places livemark service
when creating livemarks during startup, you should use the nsilivemarkservice.createlivemarkfolderonly() to avoid http traffic.
... update behavior five seconds after the browser starts up, the livemark service's update timer is started.
Preface
though you can create xpcom components in javascript and other languages, and though you might be able to follow along as a c programmer, the component implementation code is written in c++, and much of the discussion of how to make your codeinto an xpcom component starts from c++.
...starting with gecko 1.7.5 (firefox 1.0) a special npapi extension for scriptability is supported, see scripting plugins.
Using XPCOM Components
« previousnext » one of the best ways to begin working with xpcom - especially when you are designing the interface to a component that will be used by others, as we do in starting weblock - is to look at how clients are already using xpcom components.
...it registers itself for use when the browser starts up, and provides a factory that creates an instance of it for use when the user or administrator clicks the weblock icon in the browser's user interface.
How to build a binary XPCOM component using Visual Studio
you can use the project as a starting point and modify the component files to add your own functionality.
... to make the project, you start with a standard multi-thread dll project.
Profiling XPCShell
the line consists of: the compile count of the function; the call count of the function; the functions name; the starting line number; the ending line number; the function's size; the amount of time (in milliseconds) the fastest call took; the time of the slowest call; the average time spend; the total time; the time spend in the function itself is given (that is the total time excluding the time spend in functions called from this function).
...using an earlier build will cause the profiler to hang the more adventurous can use the nsixpctoolsprofiler.idl interface directly, but be aware that you must start the profiler before loading the files you want to profile (creating an instance of a component loads the file!) ...
NS ConvertASCIItoUTF16 external
char* adata pruint32 alength void assign(prunichar) - source parameters prunichar achar assignliteral void assignliteral(const char*) - source parameters char* astr replace void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length void replace(pruint32, pruint32, prunichar) - source parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const nsastring&) - source parameters pruint32 cutstart pruint32 cutlength nsastring& readable ...
... void insert(const prunichar*, pruint32, pruint32) - source parameters prunichar* data pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
NS ConvertUTF16toUTF8 external
ers char* adata pruint32 alength void assign(char) - source parameters char achar assignliteral void assignliteral(const char*) - source parameters char* adata replace void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint32, char) - source parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const nsacstring&) - source parameters pruint32 cutstart pruint32 cutlength nsacstring& readable ...
...os void insert(const char*, pruint32, pruint32) - source parameters char* data pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
NS ConvertUTF8toUTF16 external
char* adata pruint32 alength void assign(prunichar) - source parameters prunichar achar assignliteral void assignliteral(const char*) - source parameters char* astr replace void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length void replace(pruint32, pruint32, prunichar) - source parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const nsastring&) - source parameters pruint32 cutstart pruint32 cutlength nsastring& readable ...
... void insert(const prunichar*, pruint32, pruint32) - source parameters prunichar* data pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
NS LossyConvertUTF16toASCII external
ers char* adata pruint32 alength void assign(char) - source parameters char achar assignliteral void assignliteral(const char*) - source parameters char* adata replace void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint32, char) - source parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const nsacstring&) - source parameters pruint32 cutstart pruint32 cutlength nsacstring& readable ...
...os void insert(const char*, pruint32, pruint32) - source parameters char* data pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
PromiseFlatCString (External)
ers char* adata pruint32 alength void assign(char) - source parameters char achar assignliteral void assignliteral(const char*) - source parameters char* adata replace void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint32, char) - source parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const nsacstring&) - source parameters pruint32 cutstart pruint32 cutlength nsacstring& readable ...
...os void insert(const char*, pruint32, pruint32) - source parameters char* data pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
PromiseFlatString (External)
char* adata pruint32 alength void assign(prunichar) - source parameters prunichar achar assignliteral void assignliteral(const char*) - source parameters char* astr replace void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length void replace(pruint32, pruint32, prunichar) - source parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const nsastring&) - source parameters pruint32 cutstart pruint32 cutlength nsastring& readable ...
... void insert(const prunichar*, pruint32, pruint32) - source parameters prunichar* data pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsACString (External)
g&) - source parameters nsacstring& astring nsacstring& operator=(const char*) - source parameters char* aptr nsacstring& operator=(char) - source parameters char achar replace void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint32, char) - source parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const nsacstring&) - source parameters pruint32 cutstart pruint32 cutlength nsacstring& readable ...
...os void insert(const char*, pruint32, pruint32) - source parameters char* data pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsAString (External)
nst char*) - source parameters char* astr operator= nsastring& operator=(const nsastring&) - source parameters nsastring& astring nsastring& operator=(const prunichar*) - source parameters prunichar* aptr nsastring& operator=(prunichar) - source parameters prunichar achar replace void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length void replace(pruint32, pruint32, prunichar) - source parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const nsastring&) - source parameters pruint32 cutstart pruint32 cutlength nsastring& readable append void append(prunichar) - source parameters prunichar c void append(const prunichar...
...astring& readable insert void insert(prunichar, pruint32) - source parameters prunichar c pruint32 pos void insert(const prunichar*, pruint32, pruint32) - source parameters prunichar* data pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurences of characters in aset from the string.
nsAutoString (External)
char* adata pruint32 alength void assign(prunichar) - source parameters prunichar achar assignliteral void assignliteral(const char*) - source parameters char* astr replace void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length void replace(pruint32, pruint32, prunichar) - source parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const nsastring&) - source parameters pruint32 cutstart pruint32 cutlength nsastring& readable ...
... void insert(const prunichar*, pruint32, pruint32) - source parameters prunichar* data pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsCAutoString (External)
ers char* adata pruint32 alength void assign(char) - source parameters char achar assignliteral void assignliteral(const char*) - source parameters char* adata replace void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint32, char) - source parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const nsacstring&) - source parameters pruint32 cutstart pruint32 cutlength nsacstring& readable ...
...os void insert(const char*, pruint32, pruint32) - source parameters char* data pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsCStringContainer (External)
tring&) - source parameters nsacstring astring nsacstring operator=(const char*) - source parameters char aptr nsacstring operator=(char) - source parameters char achar replace void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char data pruint32 length void replace(pruint32, pruint32, char) - source parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const nsacstring&) - source parameters pruint32 cutstart pruint32 cutlength nsacstring readable ...
... pos void insert(const char*, pruint32, pruint32) - source parameters char data pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsCString external
ers char* adata pruint32 alength void assign(char) - source parameters char achar assignliteral void assignliteral(const char*) - source parameters char* adata replace void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint32, char) - source parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const nsacstring&) - source parameters pruint32 cutstart pruint32 cutlength nsacstring& readable ...
...os void insert(const char*, pruint32, pruint32) - source parameters char* data pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsDependentCString external
ers char* adata pruint32 alength void assign(char) - source parameters char achar assignliteral void assignliteral(const char*) - source parameters char* adata replace void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint32, char) - source parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const nsacstring&) - source parameters pruint32 cutstart pruint32 cutlength nsacstring& readable ...
...os void insert(const char*, pruint32, pruint32) - source parameters char* data pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsDependentString external
char* adata pruint32 alength void assign(prunichar) - source parameters prunichar achar assignliteral void assignliteral(const char*) - source parameters char* astr replace void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length void replace(pruint32, pruint32, prunichar) - source parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const nsastring&) - source parameters pruint32 cutstart pruint32 cutlength nsastring& readable ...
... void insert(const prunichar*, pruint32, pruint32) - source parameters prunichar* data pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsLiteralCString (External)
ers char* adata pruint32 alength void assign(char) - source parameters char achar assignliteral void assignliteral(const char*) - source parameters char* adata replace void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint32, char) - source parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const nsacstring&) - source parameters pruint32 cutstart pruint32 cutlength nsacstring& readable ...
...os void insert(const char*, pruint32, pruint32) - source parameters char* data pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsLiteralString (External)
ers char* adata pruint32 alength void assign(char) - source parameters char achar assignliteral void assignliteral(const char*) - source parameters char* adata replace void replace(pruint32, pruint32, const char*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength char* data pruint32 length void replace(pruint32, pruint32, char) - source parameters pruint32 cutstart pruint32 cutlength char c void replace(pruint32, pruint32, const nsacstring&) - source parameters pruint32 cutstart pruint32 cutlength nsacstring& readable ...
...os void insert(const char*, pruint32, pruint32) - source parameters char* data pruint32 pos pruint32 length void insert(const nsacstring&, pruint32) - source parameters nsacstring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsStringContainer (External)
arameters nsastring& astring nsastring& operator=(const prunichar*) - source parameters prunichar* aptr nsastring& operator=(prunichar) - source parameters prunichar achar replace void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length void replace(pruint32, pruint32, prunichar) - source parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const nsastring&) - source parameters pruint32 cutstart pruint32 cutlength nsastring& readable ...
... void insert(const prunichar*, pruint32, pruint32) - source parameters prunichar* data pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
nsString external
char* adata pruint32 alength void assign(prunichar) - source parameters prunichar achar assignliteral void assignliteral(const char*) - source parameters char* astr replace void replace(pruint32, pruint32, const prunichar*, pruint32) - source parameters pruint32 cutstart pruint32 cutlength prunichar* data pruint32 length void replace(pruint32, pruint32, prunichar) - source parameters pruint32 cutstart pruint32 cutlength prunichar c void replace(pruint32, pruint32, const nsastring&) - source parameters pruint32 cutstart pruint32 cutlength nsastring& readable ...
... void insert(const prunichar*, pruint32, pruint32) - source parameters prunichar* data pruint32 pos pruint32 length void insert(const nsastring&, pruint32) - source parameters nsastring& readable pruint32 pos cut void cut(pruint32, pruint32) - source parameters pruint32 cutstart pruint32 cutlength truncate void truncate() - source stripchars void stripchars(const char*) - source remove all occurrences of characters in aset from the string.
amIWebInstaller
toolkit/mozapps/extensions/amiwebinstaller.idlscriptable this interface is used to allow web pages to start installing add-ons.
... return value true if the installation was successfully started.
imgIContainer
framenumber, in print32 ablendmethod); obsolete since gecko 2.0 void setframedisposalmethod(in unsigned long framenumber, in print32 adisposalmethod); obsolete since gecko 2.0 void setframehasnoalpha(in unsigned long framenumber); obsolete since gecko 2.0 void setframetimeout(in unsigned long framenumber, in print32 atimeout); obsolete since gecko 2.0 void startanimation(); obsolete since gecko 2.0 void stopanimation(); obsolete since gecko 2.0 void unlockimage(); attributes attribute type description animated boolean whether this image is animated.
...void setframetimeout( in unsigned long framenumber, in print32 atimeout ); parameters framenumber missing description atimeout missing description exceptions thrown missing exception missing description startanimation() obsolete since gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) void startanimation(); parameters none.
imgILoader
y, in imgirequest arequest, in nsichannelpolicy channelpolicy); imgirequest loadimagewithchannel(in nsichannel achannel, in imgidecoderobserver aobserver, in nsisupports cx, out nsistreamlistener alistener); boolean supportimagewithmimetype(in string mimetype); constants constant value description load_cors_anonymous 1 << 16 load_cors_use_credentials 1 << 17 methods loadimage() start the load and decode of an image.
...channelpolicy return value loadimagewithchannel() start the load and decode of an image.
imgIRequest
uri nsiuri the uri the image load was started with.
...calling requestdecode on the imgirequest simply forwards along the request if the container already exists, or calls it once it gets onstartcontainer if the container does not yet exist.
mozIAsyncHistory
tory;1"] .getservice(components.interfaces.moziasynchistory); method overview void getplacesinfo(in jsval aplaceidentifiers, in mozivisitinfocallback acallback); void isurivisited(in nsiuri auri, in mozivisitedstatuscallback acallback); void updateplaces(in moziplaceinfo, [optional] in mozivisitinfocallback acallback); methods getplacesinfo() starts an asynchronous request to determine whether or not a given uri has been visited; you must implement a callback to receive the result of the request.
... isurivisited() starts an asynchronous request to determine whether or not a given uri has been visited; you must implement a callback to receive the result of the request.
mozIStorageStatement
note: starting in gecko 2.0, this method returns ns_error_unexpected if the specified mozistoragebindingparamsarray is empty.
... executeasync() starts the execution of a query asynchronously using the currently bound parameters.
nsIAccessibleHyperLink
note: the link itself is represented by one embedded character within the parent text, so the endindex should be startindex + 1.
... startindex long the offset of the hyperlink accessible within the parent accessible.
nsICacheEntryDescriptor
nsiinputstream openinputstream( in unsigned long offset ); parameters offset read starting from this offset into the cached data.
...nsioutputstream openoutputstream( in unsigned long offset ); parameters offset write starting from this offset into the cached data.
nsICategoryManager
var enumerator = categorymanager.enumeratecategories(); var categories = []; while (enumerator.hasmoreelements()) { var item = enumerator.getnext(); var category = item.queryinterface(components.interfaces.nsisupportscstring) categories.push(category.tostring()); } categories.sort(); var categoriesstring = categories.join("\n"); dump(categoriesstring + "\n"); print out a list of app-startup entries this example prints out a list of entries of "app-startup" category.
... var categorymanager = components.classes["@mozilla.org/categorymanager;1"] .getservice(components.interfaces.nsicategorymanager); var enumerator = categorymanager.enumeratecategory("app-startup"); var entries = []; while (enumerator.hasmoreelements()) { var item = enumerator.getnext(); var entry = item.queryinterface(components.interfaces.nsisupportscstring) entries.push(entry.tostring()); } entries.sort(); var entriesstring = entries.join("\n"); dump(entriesstring + "\n"); disable currently loaded plugins by type this snippet here shows how to disable plugins that are currently loaded for the file type of pdf.
nsIChannelEventSink
these methods are called before onstartrequest.
...starting in gecko 2.0, that method no longer exists, and instead the asynconchannelredirect() method is called; this uses a callback to handle redirects asynchronously.
nsICommandLine
method overview long findflag(in astring aflag, in boolean acasesensitive); astring getargument(in long aindex); boolean handleflag(in astring aflag, in boolean acasesensitive); astring handleflagwithparam(in astring aflag, in boolean acasesensitive); void removearguments(in long astart, in long aend); nsifile resolvefile(in astring aargument); nsiuri resolveuri(in astring aargument); attributes attribute type description length long number of arguments in the command line.
...void removearguments( in long astart, in long aend ); parameters astart the index to the first argument to remove from the command line; this is 0-based, and the name of the application is not included.
nsIComponentManager
until gecko 10 you had to call this method manually from within the add-on's startup() method (with a matching removebootstrappedmanifestlocation() call in the add-on's shutdown() method).
... function startup(params, areason) { if (services.vc.compare(services.appinfo.platformversion, "10.0") < 0) components.manager.addbootstrappedmanifestlocation(params.installpath); } function shutdown(params, areason) { if (services.vc.compare(services.appinfo.platformversion, "10.0") < 0) components.manager.removebootstrappedmanifestlocation(params.installpath); } ...
nsICompositionStringSynthesizer
to create an instance for this: var domwindowutils = window.windowutils; var compositionstringsynthesizer = domwindowutils.createcompositionstringsynthesizer(); for example, when you create a composition whose composing string is "foo-bar-buzz" and "bar" is selected to convert, then, first, you need to start composition: domwindowutils.sendcompositionevent("compositionstart", "", ""); next, dispatch composition string with crause information and caret information (optional): // set new composition string with .setstring().
...nally, when you commits composition with the last composition string "foo-bar-buzz": // deprecated in 36, first, dispatch commit string without clause information compositionstringsynthesizer.setstring("foo-bar-buzz"); compositionstringsynthesizer.dispatchevent(); // then, dispatch compositionend with the commit string domwindowutils.sendcompositionevent("compositionend", "foo-bar-buzz", ""); starting gecko 36, you can do it simpler: domwindowutils.sendcompositionevent("compositioncommitasis", "", ""); if you need to commit composition with different commit string gecko 36 or later, you can use "compositioncommit": domwindowutils.sendcompositionevent("compositioncommit", "foo-bar-buzz", ""); method overview void appendclause(in unsigned long alength, in unsigned long aattribu...
nsIContentViewer
void loadcomplete(in unsigned long astatus); void loadstart(in nsisupports adoc); void move(in long ax, in long ay); void open(in nsisupports astate, in nsishentry ashentry); void pagehide(in boolean isunload); boolean permitunload([optional] in boolean acallercloseswindow); boolean requestwindowclose(); void resetclosewindow(); void setbounds([const] in nsintrectref abounds); native code o...
...void init( in nsiwidgetptr aparentwidget, [const] in nsintrectref abounds ); parameters aparentwidget missing description abounds missing description loadcomplete() void loadcomplete( in unsigned long astatus ); parameters astatus missing description exceptions thrown missing exception missing description loadstart() void loadstart( in nsisupports adoc ); parameters adoc missing description exceptions thrown missing exception missing description move() void move( in long ax, in long ay ); parameters ax missing description ay missing description open() attaches the content viewer to its dom window and docshell.
nsIDOMWindow
66 introduced gecko 1.0 deprecated gecko 44 inherits from: nsisupports last changed in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4) starting with firefox 44, this file is empty as its features were either no longer used or are only available from c++ code; see dom/base/nspidomwindow.h for those.
... starting in firefox 3, dom windows are actually based on nsidomwindow2, which is a subclass of nsidomwindow that adds some new features to this interface.
nsIDownloadProgressListener
inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) to use simply implement this interface in your code, then call nsidownloadmanager.addlistener() to start listening.
...in such a situation no further event handlers are called and the stop flag is set; if there are more pending downloads in such a situation not yet started they never start.
nsIDragSession
sourcedocument nsidomdocument the document where the drag was started, which will be null if the drag originated outside the application.
... sourcenode nsidomnode the dom node that was originally dragged to start the session, which will be null if the drag originated outside the application.
nsIEditorLogging
inherits from: nsisupports last changed in gecko 1.7 method overview void startlogging(in nsifile alogfile); void stoplogging(); methods startlogging() start logging.
... void startlogging( in nsifile alogfile ); parameters alogfile the file to which the log should be written.
nsIIdleService
the observer will get an 'idle' notification when the user is idle for that interval (or longer), and receive a 'back' (gecko 3 to 15) or 'active' (gecko 16+) notification when the user starts using their computer again.
... gecko 1.9.2 note starting in gecko 1.9.2, there is a once a day notification sent out if the user remains idle for an extended period: 'idle-daily'.
nsILoadGroup
if this is a foreground request then the groupobserver's onstartrequest will be called.
... acontext the context to be passed to the onstartrequest notification.
nsILocalFile
for security reasons, this cannot contain '..' or cannot start with a directory separator '/'.
...for security reasons, this cannot contain '..' or cannot start with a directory separator '/' .
nsIMsgFolder
inherits from: nsisupports method overview void startfolderloading(); void endfolderloading(); void updatefolder(in nsimsgwindow awindow); nsimsgfilterlist getfilterlist(in nsimsgwindow msgwindow); void setfilterlist(in nsimsgfilterlist filterlist); void forcedbclosed(); void delete(); void deletesubfolders(in nsisupportsarray folders, in nsimsgwindow msgwindow); void propagatedelete(in nsimsgfolder folder, in boolean deletestorage,in nsimsgwindow msgwindow); ...
... methods startfolderloading() void startfolderloading(); endfolderloading() void endfolderloading(); updatefolder() get new headers for the database.
nsIMsgIncomingServer
displaystartuppage boolean dobiff boolean downloadmessagesatstartup boolean read only.
... loginatstartup boolean logonfallback boolean maxmessagesize long offlinesupportlevel long password acstring passwordpromptrequired boolean if the password for the server is available either via authentication in the current session or from password manager stored entries, return false.
nsIMsgMessageService
aurllistener an nsiurllistener that is notified when url starts and stops.
... aurllistener an nsiurllistener that is notified when url starts and stops, if we run a url.
nsINavHistoryResultObserver
methods batching() lets the observer know when a batch operation in places is about to start or end.
...void batching( in boolean atogglemode ); parameters atogglemode specify true to start batch mode or false to finish the batch.
nsIPlacesImportExportService
"bookmarks-restore-begin" is fired just before the import is started.
..."bookmarks-restore-begin" is fired just before the import is started.
nsIPrivateBrowsingService
the temporary cookie and local storage databases start out empty.
...method overview void removedatafromdomain(in autf8string adomain); attributes attribute type description autostarted boolean indicates whether or not private browsing was started automatically at application launch time.
nsIProtocolHandler
note: starting with firefox 3, one of uri_loadable_by_anyone, uri_dangerous_to_load, uri_is_ui_resource, or uri_is_local_file must be set on every protocol handler.
... current versions of firefox assume that the uri has uri_loadable_by_anyone set, but this will not work starting with the mozilla 2 platform.
nsIRadioInterfaceLayer
riltelephonycallback callback); void registerdatacallcallback(in nsirildatacallback callback); void rejectcall(in unsigned long callindex); void sendsms(in domstring number, in domstring message, in long requestid, in unsigned long long processid); void setupdatacall(in long radiotech, in domstring apn, in domstring user, in domstring passwd, in long chappap, in domstring pdptype); void starttone(in domstring dtmfchar); void stoptone(); void unregistercallback(in nsiriltelephonycallback callback); void unregisterdatacallcallback(in nsirildatacallback callback); attributes attribute type description currentstate jsval read only.
...void setupdatacall( in long radiotech, in domstring apn, in domstring user, in domstring passwd, in long chappap, in domstring pdptype ); parameters radiotech missing description apn missing description user missing description passwd missing description chappap missing description pdptype missing description exceptions thrown missing exception missing description starttone() void starttone( in domstring dtmfchar ); parameters dtmfchar missing description exceptions thrown missing exception missing description stoptone() void stoptone(); parameters none.
nsIScriptableInputStream
note: starting in gecko 2.0, you can use the netutils.jsm javascript code module and its readinputstreamtostring() method to read arbitrary binary data into a javascript string.
...var scriptableinputstream = cc("@mozilla.org/scriptableinputstream;1", "nsiscriptableinputstream", "init"); var blah = { data: '', onstartrequest: function (arequest, acontext) { this.data = ''; }, ondataavailable: function(request, context, inputstream, offset, count) { var scriptstream = new scriptableinputstream(inputstream); this.data += scriptstream.read(count); scriptstream.close(); } }; see also nsscriptableinputstream nsiinputstream ...
nsISocketTransportService
currently "starttls", "ssl" and "udp" are supported.
...mozilla.org:2000 with tls support and default proxy settings var socket = transportservice.createtransport(["starttls"], 1,"mozilla.org", 2000, null); see also nsisockettransport nsirunnable nsiproxyinfo ...
nsIToolkitProfileService
inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) note: starting in gecko 1.9.1, this service is implemented by @mozilla.org/toolkit/profile-service;1.
... startoffline boolean startwithlastprofile boolean methods createprofile() creates a new profile.
nsITreeBoxObject
scrolltocell(in long row, in nsitreecolumn col); void scrolltocolumn(in nsitreecolumn col); void scrolltohorizontalposition(in long horizontalposition); void invalidate(); void invalidatecolumn(in nsitreecolumn col); void invalidaterow(in long index); void invalidatecell(in long row, in nsitreecolumn col); void invalidaterange(in long startindex, in long endindex); void invalidatecolumnrange(in long startindex, in long endindex, in nsitreecolumn col); long getrowat(in long x, in long y); void getcellat(in long x, in long y, out long row, out nsitreecolumn col, out acstring childelt); void getcoordsforcellitem(in long row, in nsitreecolumn col, in acstring element, out long x, out long y, out long ...
... void invalidate(); void invalidatecolumn(in nsitreecolumn col); void invalidaterow(in long index); void invalidatecell(in long row, in nsitreecolumn col); void invalidaterange(in long startindex, in long endindex); void invalidatecolumnrange(in long startindex, in long endindex, in nsitreecolumn col); getrowat() a hit test that can tell you what row the mouse is over.
nsIWebNavigation
it provides methods and attributes to direct an object to navigate to a new location, stop or restart an in process load, or determine where the object has previously gone.
... load_flags_stop_content 2048 if this flag is set, stop() will be called before the load starts and will stop both content and network activity (the default is to only stop network activity).
nsIWifiMonitor
implemented by @mozilla.org/wifi/monitor;1 as a service: var wifimonitor = components.classes["@mozilla.org/wifi/monitor;1"] .getservice(components.interfaces.nsiwifimonitor); method overview void startwatching(in nsiwifilistener alistener); void stopwatching(in nsiwifilistener alistener); methods startwatching() starts listening for changes to the wifi access point list.
... void startwatching( in nsiwifilistener alistener ); parameters alistener the nsiwifilistener object to receive notifications when the wifi access point list changes.
nsIWindowWatcher
this component must be initialized at application startup by calling setwindowcreator().
... acurrentwindow the nsidomwindow starting point in the window hierarchy to begin the search.
nsIXMLHttpRequestEventTarget
onloadstart nsidomeventlistener a javascript function object that gets invoked exactly once when the operation begins.
... onprogress nsidomeventlistener a javascript function object that gets invoked zero or more times, after the loadstart event, but before any abort, error, or load events occur.
XPCOM Interface Reference
accessibleretrievalnsiaccessiblerolensiaccessiblescrolltypensiaccessibleselectablensiaccessiblestatechangeeventnsiaccessiblestatesnsiaccessibletablensiaccessibletablecellnsiaccessibletablechangeeventnsiaccessibletextnsiaccessibletextchangeeventnsiaccessibletreecachensiaccessiblevaluensiaccessiblewin32objectnsialertsservicensiannotationobservernsiannotationservicensiappshellnsiappshellservicensiappstartupnsiappstartup_mozilla_2_0nsiapplicationcachensiapplicationcachechannelnsiapplicationcachecontainernsiapplicationcachenamespacensiapplicationcacheservicensiapplicationupdateservicensiarraynsiasyncinputstreamnsiasyncoutputstreamnsiasyncstreamcopiernsiasyncverifyredirectcallbacknsiauthinformationnsiauthmodulensiauthpromptnsiauthprompt2nsiauthpromptadapterfactorynsiauthpromptcallbacknsiauthpromptpro...
...eennsiscreenmanagernsiscripterrornsiscripterror2nsiscriptableionsiscriptableinputstreamnsiscriptableunescapehtmlnsiscriptableunicodeconverternsiscrollablensisearchenginensisearchsubmissionnsisecuritycheckedcomponentnsiseekablestreamnsiselectionnsiselection2nsiselection3nsiselectioncontrollernsiselectionimageservicensiselectionprivatensiserversocketnsiserversocketlistenernsiservicemanagernsisessionstartupnsisessionstorensisimpleenumeratornsismsdatabaseservicensismsrequestmanagernsismsservicensisocketprovidernsisocketproviderservicensisockettransportnsisockettransportservicensisoundnsispeculativeconnectnsistackframensistandardurlnsistreamconverternsistreamlistenernsistringbundlensistringbundleoverridensistringbundleservicensistringenumeratornsistructuredclonecontainernsistylesheetservicensisuppor...
NS_CStringSetDataRange
#include "nsstringapi.h" nsresult ns_cstringsetdatarange( nsacstring& astring, pruint32 acutstart, pruint32 acutlength, const char* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsacstring instance to modify.
... acutstart [in] the starting index of the section to replace, measured in storage units.
NS_StringSetDataRange
#include "nsstringapi.h" nsresult ns_stringsetdatarange( nsastring& astring, pruint32 acutstart, pruint32 acutlength, const prunichar* adata, pruint32 adatalength = pr_uint32_max ); parameters astring [in] a nsastring instance to modify.
... acutstart [in] the starting index of the section to replace, measured in storage units.
Troubleshooting XPCOM components registration
open the profile menu and select start profiling....
... in the dialog that appears, you can provide command line parameters and click ok to start the application.
Using nsCOMPtr
if you've never used nscomptr before, you're starting in the right place.
... contents status, recent changes, and plans recent changes to nscomptr getting started guide introduction using nscomptr summary reference manual the basics initialization and assignment using an nscomptr<t> as a t* efficiency and correctness compiler annoyances frequently asked questions buildtime errors runtime errors how do i...
Xptcall Porting Guide
the tree mozilla/xpcom/reflect/xptcall +--public // exported headers +--src // core source | \--md // platform specific parts | +--mac // mac ppc | +--unix // all unix | \--win32 // win32 | +--test // simple tests to get started \--tests // full tests via api porters are free to create subdirectories under the base md directory for their given platforms and to integrate into the build system as appropriate for their platform.
...not all of the functionality is exercised, but it is a place to get started.
pyxpidl
pyxpidl has been in use for a while, but replaced xpidl in the gecko sdk starting in gecko 9.0.
...ription pyxpidl equivalent -a emit annotations to typelib n/a (feature removed) -w turn on warnings n/a (this is now the default and can't be turned off) -v verbose mode (nyi) n/a (feature removed) -t creates a typelib of a specific version number n/a (feature removed, and probably never actually worked) -i add an entry to start of include path for #include "nsifoo.idl" -i (unchanged) -o specify the base name for output (-o /tmp/nsifoo for example) -o outputfile (this isn't just the base name, but needs to include the extension; for example -o /tmp/nsifoo.idl) -e specify an explicit output file name (-e /tmp/nsifoo.idl for example) n/a (this is subsumed by -o now) -d write dep...
xpidl
MozillaTechXPIDLxpidl
it generates: c++ header files (.h), with a commented template for full c++ implementation of the interface xpconnect typelib files (.xpt), with runtime type information to dynamically call xpcom objects through xpconnect note: starting in gecko 9.0, xpidl has been replaced with pyxpidl in the gecko sdk.
...s, or one-off interface compilation, xpidl can be run from the command line: usage: ./xpidl -m mode [-w] [-v] [-t version number] [-d filename.pp] [-i path] [-o basename | -e filename.ext] filename.idl -a emit annotations to typelib -w turn on warnings (recommended) -v verbose mode (nyi) -t create a typelib of a specific version number -i add entry to start of include path for ``#include "nsithing.idl" -o use basename (e.g.
Mozilla technologies
apng is a simpler alternative to mng, providing a spec suitable for the most common usage of animated images on the internet.docshelldocshell is the second iteration of what originally started out as webshell.
...starting with mozilla 1.9, it was phased out in favor of sqlite, a more widely-supported file format.placesplaces is the bookmarks and history management system introduced in firefox 3.
Demo Addon
we start with listing all folders and marking the inbox: let server = accounts[0].incomingserver; let folder = server.rootfolder; // ...
...we then go into each subfolder and start over.
Activity Manager examples
t using process' attributes process.state = components.interfaces.nsiactivityprocess.state_completed; gactivitymanager.removeactivity(process.id); let event = components.classes["@mozilla.org/activity-event;1"].createinstance(nsiae); // localization is omitted, initiator is omitted event.init(folder.prettiestname + " is processed", null, "no junk found", process.starttime, // start time date.now()); // completion time event.contexttype = process.contexttype; // optional event.contextobj = process.contextobj; // optional gactivitymanager.addactivity(event); showing a user-defined activity with cancel capability (javascript) this sample improves the previous one by providing an nsiactivitycancelhandler to allow the user to cancel the pr...
...riant component nscomptr<nsiwritablevariant> srcfolder = do_createinstance(ns_variant_contractid); srcfolder->setasisupports(reinterpret_cast<nsisupports*>(imapfolder)); copyevent->addsubject(srcfolder); copyevent->init(ns_literal_string("message copy event"), initiator, ns_literal_string("completed successfully"), pr_now() / pr_usec_per_msec, // start time pr_now() / pr_usec_per_msec); // completion time // do not forget to increase the ref counter if needed copyevent->setundohandler(undohandler); //////////////////////////////////////////////////////////////// //// adding the event into activity manager nscomptr<nsiactivitymanager> activitymgr(do_getservice("@mozilla.org/activity-manager;1")); pruint32 id; activitymgr->ad...
Declaring and Calling Functions
example: no input parameters in this example, we declare the libc clock() function, which returns the elapsed time since system startup, then fetch and output that value.
... const clock = lib.declare("clock", ctypes.default_abi, ctypes.unsigned_long); console.log("clocks since startup: " + clock()); the clock() function requires no input parameters; it simply returns an unsigned long.
Plugins
starting in firefox 55, users will be asked to choose which sites may use flash content.
... starting with firefox 56 in september 2017, firefox for android will remove all support for plugins (bug 1381916).
Introduction to DOM Inspector - Firefox Developer Tools
note: starting with firefox 3, the dom inspector is not included in firefox by default; instead, you must download and install it from the mozilla add-ons web site.
... (note: this is now a dead link.) when you first start the dom inspector, you are presented with a two-pane application window that looks a little like the main mozilla browser.
Debugging service workers - Firefox Developer Tools
let's start by troubleshooting this.
...when the service worker is stopped, a start button is provided to start it running, allowing you to trigger the service worker lifecycle.
Browser Console - Firefox Developer Tools
you can also start the browser console by launching firefox from the command line and passing the -jsconsole argument: /applications/firefoxaurora.app/contents/macos/firefox-bin -jsconsole the browser console looks like this: you can see that the browser console looks and behaves very much like the web console: most of the window is occupied by a pane that display messages.
... note: you can restart the browser with the command ctrl + alt + r (windows, linux) or cmd + alt + r (mac) this command restarts the browser with the same tabs open as before the restart.
Debugger.Memory - Firefox Developer Tools
for each collection slice that occurred, there is an entry in the collections array with the following form: { "starttimestamp":timestamp, "endtimestamp":timestamp, } here the timestamp values are timestamps of the gc slice’s start and end events.
...however, the memory consumed by the string itself is a small constant independent of its size, since it is simply a reference to the larger string, a start position, and a length.
Tutorial: Show Allocations Per Call Path - Firefox Developer Tools
(this menu will not be present unless you have changed the preference as explained above.) selecting the 'browser' context in the scratchpad enter the following code in the scratchpad: // this simply defines the 'debugger' constructor in this // scratchpad; it doesn't actually start debugging anything.
... var dbg; // start measuring the selected tab's main window's memory // consumption.
Tutorial: Set a breakpoint - Firefox Developer Tools
click on the scratchpad panel and enter the following code: components.utils.import("resource://gre/modules/jsdebugger.jsm"); components.utils.import("resource://gre/modules/console.jsm"); // this simply defines 'debugger' in this scratchpad; // it doesn't actually start debugging anything.
...when control reaches the start of the report function, debugger calls the breakpoint handler’s hit method, passing a debugger.frame instance.
DevTools API - Firefox Developer Tools
a definition is a js light object that exposes different information about the tool (like its name and its icon), and a build method that will be used later-on to start an instance of this tool.
... {toolid}-build(panel) the frame for a tool has loaded and the toolpanel.build() method has been called but the asynchronous initialization has not started.
Dominators - Firefox Developer Tools
the graph starts at a root node, indicated in these diagrams with "r".
... during garbage collection, the runtime traverses the graph, starting at the root, and marks every object it finds.
Network request details - Firefox Developer Tools
queued, started, downloaded new in firefox 72, we now show the following timings at the top of the timings tab, making dependency analysis a lot easier: queued: when the resource was queued for download.
... started: when the resource started downloading.
Examine and edit HTML - Firefox Developer Tools
to start searching the markup, click in the search box to expand it or press ctrl + f , or cmd + f on a mac.
...furthermore it allows for some more advanced searches like finding elements that start with a specific text, for example.
Allocations - Firefox Developer Tools
but if you start walking back up the call stack, you'll see the difference: here, 8904 samples were taken in signallater().
...if you click this link, the devtools switches to the allocations view, and selects the region of time from the end of the last gc cycle to the start of the one you clicked on.
How to - Firefox Developer Tools
open the performance tools to open the performance tools: press shift + f5 select "performance" from the web developer submenu in the firefox menu (or 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.
... to stop, press it again: you can also start and stop recording from the web console, using console.profile() and console.profileend().
Style Editor - Firefox Developer Tools
just start typing, and it will offer you a list of suggestions.
...then you can just start entering css into the new editor and watch as the new styles are applied in real time just like changes to the other sheets.
Web Console Helpers - Firefox Developer Tools
:block (starting in firefox 80) followed by an unquoted string, blocks requests where the url contains that string.
... :unblock (starting in firefox 80) followed by an unquoted string, removes blocking for urls containing that string.
Web console keyboard shortcuts - Firefox Developer Tools
command windows macos linux scroll to start of console output (only if the command line is empty) home home home scroll to end of console output (only if the command line is empty) end end end page up through console output page up page up page up page down through console output page down page down page down go backward through command history up arrow up arrow ...
...pup esc esc esc move to the previous autocomplete suggestion up arrow up arrow up arrow move to the next autocomplete suggestion down arrow down arrow down arrow page up through autocomplete suggestions page up page up page up page down through autocomplete suggestions page down page down page down scroll to start of autocomplete suggestions home home home scroll to end of autocomplete suggestions end end end global shortcuts these shortcuts work in all tools that are hosted in the toolbox.
The JavaScript input interpreter - Firefox Developer Tools
starting in firefox 76, if the code snippet is more than five lines long, only the first five lines are echoed in the console, preceeded by a disclosure triangle (or "twistie"), and followed by an ellipsis (…).
...start typing part of the expression you are looking for and the first match is displayed in the console.
AbsoluteOrientationSensor - Web APIs
model.quaternion.fromarray(sensor.quaternion).inverse(); }); sensor.addeventlistener('error', error => { if (event.error.name == 'notreadableerror') { console.log("sensor is not available."); } }); sensor.start(); permissions example using orientation sensors requires requesting permissions for multiple device sensors.
... const sensor = new absoluteorientationsensor(); promise.all([navigator.permissions.query({ name: "accelerometer" }), navigator.permissions.query({ name: "magnetometer" }), navigator.permissions.query({ name: "gyroscope" })]) .then(results => { if (results.every(result => result.state === "granted")) { sensor.start(); ...
AbstractRange.collapsed - Web APIs
the collapsed read-only property of the abstractrange interface returns true if the range's start position and end position are the same.
...a collapsed range is one in which the start and end positions are the same, resulting in a zero-character-long range..
AddressErrors - Web APIs
after that, we set up the handler for the shippingaddresschange event so we can validate address information and call the request's show() method to start running the payment ui.
... setting up the donate now button this code creates a handler for the load event on the window which in turn adds the needed click event handler to the "donate now" button so that clicking it starts the payment process.
Animation.pause() - Web APIs
WebAPIAnimationpause
throws an invalidstateerror if the animation's currenttime is unresolved (perhaps it hasn't started playing yet) and the end time of the animation is positive infinity.
... example animation.pause() is used many times in the alice in web animations api land growing/shrinking alice game, largely because animations created with the element.animate() method immediately start playing and 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 rea...
Animation.playbackRate - Web APIs
bottle.addeventlistener("mousedown", shrinkalice, false); bottle.addeventlistener("touchstart", shrinkalice, false); contrariwise, clicking on the cake causes her to "grow," playing alicechange forwards again: var growalice = function() { alicechange.playbackrate = 1; alicechange.play(); } // on tap or click, alice will grow.
... cake.addeventlistener("mousedown", growalice, false); cake.addeventlistener("touchstart", growalice, false); in another example, the red queen's race game, alice and the red queen are constantly slowing down: setinterval( function() { // make sure the playback rate never falls below .4 if (redqueen_alice.playbackrate > .4) { redqueen_alice.playbackrate *= .9; } }, 3000); but clicking or tapping on them causes them to speed up by multiplying their playbackrate: var gofaster = function() { redqueen_alice.playbackrate *= 1.1; } document.addeventlistener("click", gofaster); document.addeventlistener("touchstart", gofaster); specifications specification status comment web animationsthe definition of 'animation.playbackrate' in that specification.
AnimationEffect.getComputedTiming() - Web APIs
return value a computedeffecttiming dictionary object, which contains the following properties: endtime the end time of the animation in milliseconds from the animation's start (if the keyframeeffect is associated with an animation).
... currentiteration the number of times this animation has looped, starting from 0.
AnimationEvent.initAnimationEvent() - Web APIs
the following values are allowed: value meaning animationstart the animation has started.
...for an "animationstart" event, elapsedtime is 0.0 unless there was a negative value for animation-delay, in which case the event will be fired with elapsedtime containing (-1 * delay).
AnimationEvent - Web APIs
for an animationstart event, elapsedtime is 0.0 unless there was a negative value for animation-delay, in which case the event will be fired with elapsedtime containing (-1 * delay).
... animationevent.pseudoelement read only is a domstring, starting with '::', containing the name of the pseudo-element the animation runs on.
Attr - Web APIs
WebAPIAttr
a xlink:href="/docs/web/api/attr" target="_top"><rect x="266" y="1" width="75" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="303.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">attr</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} warning: starting in gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4), a number of deprecated properties and methods output warning messages to the console.
... gecko outputs a deprecation note starting from gecko 7.0 (firefox 7.0 / thunderbird 7.0 / seamonkey 2.4).
AudioContext.createMediaStreamDestination() - Web APIs
when the button is clicked, the oscillator starts, and the mediarecorder is started.
...ipt> 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 an array chunks.push(evt.data); }; mediarecorder.onst...
AudioContext.getOutputTimestamp() - Web APIs
performancetime: a point in the time coordinate system of a performance interface; 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.
... play.addeventlistener('click', () => { if(!audioctx) { audioctx = new window.audiocontext(); } getdata(); source.start(0); play.setattribute('disabled', 'disabled'); raf = requestanimationframe(outputtimestamps); }); stop.addeventlistener('click', () => { source.stop(0); play.removeattribute('disabled'); cancelanimationframe(raf); }); // function to output timestamps function outputtimestamps() { let ts = audioctx.getoutputtimestamp() console.log('context time: ' + ts.contexttime + ' | performance time: ' + ts.performancetime); raf = requestanimationframe(outputtimestamps); } specifications specification status comment web audio apithe definition of 'getout...
AudioParam.exponentialRampToValueAtTime() - Web APIs
the change starts at the time specified for the previous event, follows an exponential ramp to the new value given in the value parameter, and reaches the new value at the time given in the endtime parameter.
... endtime a double representing the exact time (in seconds) after the ramping starts that the changing of the value will stop.
AudioParam.linearRampToValueAtTime() - Web APIs
the change starts at the time specified for the previous event, follows a linear ramp to the new value given in the value parameter, and reaches the new value at the time given in the endtime parameter.
... endtime a double representing the exact time (in seconds) after the ramping starts that the changing of the value will stop.
AudioParam.setValueAtTime() - Web APIs
syntax var audioparam = audioparam.setvalueattime(value, starttime) parameters value a floating point number representing the value the audioparam will change to at the given time.
... starttime a double representing the time (in seconds) after the audiocontext was first created that the change in value will happen.
AudioScheduledSourceNode.onended - Web APIs
examples in this simple example, an event listener for the ended event is set up to enable a "start" button in the user interface when the node stops playing.
... node.onended = function(event) { document.getelementbyid("startbutton").disabled = false; } specifications specification status comment web audio apithe definition of 'onended' in that specification.
BaseAudioContext.createDelay() - Web APIs
if you just press the play 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.
... var synthsource; playsynth.onclick = function() { synthsource = audioctx.createbuffersource(); synthsource.buffer = buffers[2]; synthsource.loop = true; synthsource.start(); synthsource.connect(synthdelay); synthdelay.connect(destination); this.setattribute('disabled', 'disabled'); } stopsynth.onclick = function() { synthsource.disconnect(synthdelay); synthdelay.disconnect(destination); synthsource.stop(); playsynth.removeattribute('disabled'); } ...
BaseAudioContext.decodeAudioData() - Web APIs
the buttons in the example simply run getdata() to load the track and start it playing, and stop it playing, respectively.
...data = 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 specification status comment ...
Blob.slice() - Web APIs
WebAPIBlobslice
syntax var newblob = blob.slice(start, end, contenttype); parameters start optional an index into the blob indicating the first byte to include in the new blob.
...if you specify a value for start that is larger than the size of the source blob, the returned blob has size 0 and contains no data.
BluetoothRemoteGATTCharacteristic - Web APIs
value; promise<bluetoothremotegattdescriptor> getdescriptor(bluetoothdescriptoruuid descriptor); promise<sequence<bluetoothremotegattdescriptor>> getdescriptors(optional bluetoothdescriptoruuid descriptor); promise<dataview> readvalue(); promise<void> writevalue(buffersource value); promise<void> startnotifications(); promise<void> stopnotifications(); }; bluetoothremotegattcharacteristic implements eventtarget; bluetoothremotegattcharacteristic implements characteristiceventhandlers; properties bluetoothremotegattcharacteristic.serviceread only returns the bluetoothgattservice this characteristic belongs to.
... bluetoothremotegattcharacteristic.startnotifications() returns a promise when navigator.bluetooth is added to the active notification context.
Body.arrayBuffer() - Web APIs
WebAPIBodyarrayBuffer
once getdata() has finished running, we start the audio source playing with start(0), then disable the play button so it can't be clicked again when it is already playing (this would cause an error.) function getdata() { source = audioctx.createbuffersource(); var myrequest = new request('viper.ogg'); fetch(myrequest).then(function(response) { return response.arraybuffer(); }).then(function(buffer) { audioctx.decodeaudioda...
...ta(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.
Cache - Web APIs
WebAPICache
(see selective caching live) the code uses cachestorage.open() to open any cache objects with a content-type header that starts with font/.
...have a content-type response header that starts with "font/".
CanvasRenderingContext2D.quadraticCurveTo() - Web APIs
the starting point is the latest point in the current path, which can be changed using moveto() before creating the quadratic bézier curve.
... html <canvas id="canvas"></canvas> javascript const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); // quadratic bézier curve ctx.beginpath(); ctx.moveto(50, 20); ctx.quadraticcurveto(230, 30, 50, 100); ctx.stroke(); // start and end points ctx.fillstyle = 'blue'; ctx.beginpath(); ctx.arc(50, 20, 5, 0, 2 * math.pi); // start point ctx.arc(50, 100, 5, 0, 2 * math.pi); // end point ctx.fill(); // control point ctx.fillstyle = 'red'; ctx.beginpath(); ctx.arc(230, 30, 5, 0, 2 * math.pi); ctx.fill(); result in this example, the control point is red and the start and end points are blue.
Basic usage of canvas - Web APIs
« previousnext » let's start this tutorial by looking at the <canvas> html element itself.
...our code snippet from above becomes something like this: var canvas = document.getelementbyid('tutorial'); if (canvas.getcontext) { var ctx = canvas.getcontext('2d'); // drawing code here } else { // canvas-unsupported code here } a skeleton template here is a minimalistic template, which we'll be using as a starting point for later examples.
Drawing text - Web APIs
possible values: start, end, left, right or center.
... the default value is start.
Using channel messaging - Web APIs
simple examples to get your started, we have published a couple of demos on github.
...ages 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 = e.data; input.value = ''; } we start off by creating a new message channel by using the messagechannel() constructor.
CompositionEvent.data - Web APIs
syntax mydata = compositionevent.data value a domstring representing the event data: for compositionstart events, this is the currently selected text that will be replaced by the string being composed.
... this value doesn't change even if content changes the selection range; rather, it indicates the string that was selected when composition started.
Console.profileEnd() - Web APIs
the profileend method stops recording a profile previously started with console.profile().
... if console.profileend() is not passed a profile name, the most recently started profile is stopped.
Console.time() - Web APIs
WebAPIConsoletime
starts a timer you can use to track how long an operation takes.
...when you call console.timeend() with the same name, the browser will output the time, in milliseconds, that elapsed since the timer was started.
DataTransfer.dropEffect - Web APIs
html content <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.
... </p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> css content div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } javascript content function dragstart_handler(ev) { console.log("dragstart: dropeffect = " + ev.datatransfer.dropeffect + " ; effectallowed = " + ev.datatransfer.effectallowed); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree ev.datatransfer.setdata("text", ev.target.id); ev.datatransfer.effectallowed = "move"; } function drop_handler(ev) { console.log("drop: dropeffect = " + ev.datatransfer.dropeffect + " ; effectallowed = " + ev.datatransfer.effectallowe...
DataTransfer.items - Web APIs
<!doctype html> <html lang=en> <title>examples of datatransfer.{types,items} properties</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #target { border: 1px solid black; } </style> <script> function dragstart_handler(ev) { console.log("dragstart: target.id = " + ev.target.id); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree ev.datatransfer.setdata("text/plain", ev.target.id); ev.datatransfer.effectallowed = "move"; } function drop_handler(ev) { console.log("drop: target.id = " + ev.target.id); ev.preventdefault(); // get the id of...
... + "].kind = " + ev.datatransfer.items[i].kind + " ; type = " + ev.datatransfer.items[i].type); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } </script> <body> <h1>examples of <code>datatransfer</code>.{<code>types</code>, <code>items</code>} properties</h1> <ul> <li id="i1" ondragstart="dragstart_handler(event);" draggable="true">drag item 1 to the drop zone</li> <li id="i2" ondragstart="dragstart_handler(event);" draggable="true">drag item 2 to the drop zone</li> </ul> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html living standa...
DataTransfer.mozSetDataAt() - Web APIs
return value void example this example shows the use of the mozsetdataat() method in a dragstart handler.
... function dragstart_handler(event) { var dt = event.datatransfer; var idx = dt.mozitemcount; // add two new items to the drag transfer if (idx >= 0) { dt.mozsetdataat("text/uri-list","http://www.example.com/", idx); dt.mozsetdataat("text/html", "hello world", idx+1); } } specifications this method is not defined in any web standard.
DataTransfer.setData() - Web APIs
<!doctype html> <html lang=en> <title>examples of datatransfer's setdata(), getdata() and cleardata()</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's background color to signify drag has started ev.currenttarget.style.border = "dashed"; // set the drag's format and data.
...the data, which is the id of the drop target var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); // clear the drag data cache (for all formats/types) ev.datatransfer.cleardata(); } </script> <body> <h1>examples of <code>datatransfer</code>: <code>setdata()</code>, <code>getdata()</code>, <code>cleardata()</code></h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html living standardthe definition of 'setdata()'...
DataTransferItemList.DataTransferItem() - Web APIs
javascript function dragstart_handler(ev) { console.log("dragstart"); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree var datalist = ev.datatransfer.items; datalist.add(ev.target.id, "text/plain"); // add some other items to the drag payload datalist.add("<p>...
...drop: uri = " + s); }); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } function dragend_handler(ev) { console.log("dragend"); var datalist = ev.datatransfer.items; // clear any remaining drag data datalist.clear(); } html <div> <p id="source" ondragstart="dragstart_handler(event);" ondragend="dragend_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> css div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } ...
DataTransferItemList.add() - Web APIs
html <div> <p id="source" ondragstart="dragstart_handler(event);" ondragend="dragend_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> css div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target...
... { border: 1px solid black; } javascript function dragstart_handler(ev) { console.log("dragstart"); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree var datalist = ev.datatransfer.items; datalist.add(ev.target.id, "text/plain"); // add some other items to the drag payload datalist.add("<p>...
DataTransferItemList.length - Web APIs
javascript function dragstart_handler(ev) { console.log("dragstart"); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree var datalist = ev.datatransfer.items; datalist.add(ev.target.id, "text/plain"); // add some other items to the drag payload datalist.add("<p>...
...drop: uri = " + s); }); } } } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault(); // set the dropeffect to move ev.datatransfer.dropeffect = "move" } function dragend_handler(ev) { console.log("dragend"); var datalist = ev.datatransfer.items; // clear any remaining drag data datalist.clear(); } html <div> <p id="source" ondragstart="dragstart_handler(event);" ondragend="dragend_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> css div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } ...
DataTransferItemList.remove() - Web APIs
javascript function dragstart_handler(ev) { console.log("dragstart"); // add this element's id to the drag payload so the drop handler will // know which element to add to its tree var datalist = ev.datatransfer.items; datalist.add(ev.target.id, "text/plain"); // add some other items to the drag payload datalist.add("<p>...
...ct to move ev.datatransfer.dropeffect = "move" } function dragend_handler(ev) { console.log("dragend"); var datalist = ev.datatransfer.items; for (var i = 0; i < datalist.length; i++) { datalist.remove(i); } // clear any remaining drag data datalist.clear(); } html <h1>example uses of <code>datatransferitemlist</code> methods and property</h1> <div> <p id="source" ondragstart="dragstart_handler(event);" ondragend="dragend_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> css div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px s...
DelayNode.delayTime - Web APIs
if you just press the play 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.
... var synthsource; playsynth.onclick = function() { synthsource = audioctx.createbuffersource(); synthsource.buffer = buffers[2]; synthsource.loop = true; synthsource.start(); synthsource.connect(synthdelay); synthdelay.connect(destination); this.setattribute('disabled', 'disabled'); } stopsynth.onclick = function() { synthsource.disconnect(synthdelay); synthdelay.disconnect(destination); synthsource.stop(); playsynth.removeattribute('disabled'); } ...
DelayNode - Web APIs
WebAPIDelayNode
if you just press the play 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.
... var synthsource; playsynth.onclick = function() { synthsource = audioctx.createbuffersource(); synthsource.buffer = buffers[2]; synthsource.loop = true; synthsource.start(); synthsource.connect(synthdelay); synthdelay.connect(destination); this.setattribute('disabled', 'disabled'); } stopsynth.onclick = function() { synthsource.disconnect(synthdelay); synthdelay.disconnect(destination); synthsource.stop(); playsynth.removeattribute('disabled'); } ...
Document: drag event - Web APIs
html <div class="dropzone"> <div id="draggable" draggable="true" ondragstart="event.datatransfer.setdata('text/plain',null)"> this div is draggable </div> </div> <div class="dropzone"></div> <div class="dropzone"></div> <div class="dropzone"></div> css #draggable { width: 200px; height: 20px; text-align: center; background: white; } .dropzone { width: 200px; height: 20px; background: blueviolet; margin-bottom: 10px; padding: 10px; } javascrip...
...t var dragged; /* events fired on the draggable target */ document.addeventlistener("drag", function(event) { }, false); document.addeventlistener("dragstart", function(event) { // store a ref.
Document.getElementsByTagName() - Web APIs
example in the following example, getelementsbytagname() 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.
... this demonstrates both document.getelementsbytagname() and the functionally identical element.getelementsbytagname(), which starts the search at a specific element within the dom tree.
Document.onbeforescriptexecute - Web APIs
fired when the code in a <script> element declared in an html document is about to start executing.
... example function starting(e) { logmessage("starting script with id: " + e.target.id); } document.addeventlistener("beforescriptexecute", starting, true); view live examples specification html5 ...
Document.open() - Web APIs
WebAPIDocumentopen
this is no longer the case.document non-spec'ed parameters to document.open gecko-specific notes starting with gecko 1.9, this method is subject to the same same-origin policy as other properties, and does not work if doing so would change the document's origin.
... starting with gecko 1.9.2, document.open() uses the principal of the document whose uri it uses, instead of fetching the principal off the stack.
Document.timeline - Web APIs
WebAPIDocumenttimeline
the time values for this timeline are calculated as a fixed offset from the global clock such that the zero time corresponds to the navigationstart moment plus a signed delta known as the origin time.
... prior to establishing the navigationstart moment, the document timeline is inactive.
DocumentOrShadowRoot.activeElement - Web APIs
if so, you can get more detail by using the object's selectionstart and selectionend properties.
...morbi sed euismod diam.</textarea> </form> <p>active element id: <b id="output-element"></b></p> <p>selected text: <b id="output-text"></b></p> javascript function onmouseup(e) { const activetextarea = document.activeelement; const selection = activetextarea.value.substring( activetextarea.selectionstart, activetextarea.selectionend ); const outputelement = document.getelementbyid('output-element'); const outputtext = document.getelementbyid('output-text'); outputelement.innerhtml = activetextarea.id; outputtext.innerhtml = selection; } const textarea1 = document.getelementbyid('ta-example-one'); const textarea2 = document.getelementbyid('ta-example-two'); textarea1.addeventlistener('...
DocumentTimeline.DocumentTimeline() - Web APIs
currently the only supported option is the origintime member which specifies the zero time for the documenttimeline as a real number of milliseconds relative to the navigationstart moment of the active document for the current browsing context.
...this bit of code would start all the cats animating 500 milliseconds into their animations: var cats = document.queryselectorall('.sharedtimelinecat'); cats = array.prototype.slice.call(cats); var sharedtimeline = new documenttimeline({ origintime: 500 }); cats.foreach(function(cat) { var catkeyframes = new keyframeeffect(cat, keyframes, timing); var catanimation = new animation(catkeyframes, sharedtimeline); catanimation.play(); }); specifications specification status comment web animationsthe definition of 'documenttimeline()' in that specification.
How whitespace is handled by HTML, CSS, and in the DOM - Web APIs
in the case of html, whitespace is largely ignored — whitespace in between words is treated as a single character, and whitespace at the start and end of elements and outside elements is ignored.
... it gets more interesting however when you start using inline-block elements.
DragEvent - Web APIs
WebAPIDragEvent
dragstart this event is fired when the user starts dragging an element or text selection.
... globaleventhandlers.ondragstart a global event handler for the dragstart event.
EXT_disjoint_timer_query.beginQueryEXT() - Web APIs
the ext_disjoint_timer_query.beginqueryext() method of the webgl api starts a timer query.
... query a webglquery object for which to start the time querying.
EffectTiming.delay - Web APIs
the effecttiming dictionary's delay property in the web animations api represents the number of milliseconds to delay the start of the animation.
... syntax var timingproperties = { delay: delayinmilliseconds }; timingproperties.delay = delayinmilliseconds; value a number specifying the delay, in milliseconds, from the start of the animation's play cycle to the beginning of its active interval (the time index at which actual animation begins).
Element.clientTop - Web APIs
WebAPIElementclientTop
this is because the offsettop indicates the location of the top of the border (not the margin) while the client area starts immediately below the border, (client area includes padding.) therefore, the clienttop value will always equal the integer portion of the .getcomputedstyle() value for "border-top-width".
... gecko-based applications support clienttop starting with gecko 1.9 (firefox 3, implemented in bug 111207).
Event.eventPhase - Web APIs
WebAPIEventeventPhase
this process starts with the window, then document, then the htmlhtmlelement, and so on through the elements until the target's parent is reached.
... event.bubbling_phase 3 the event is propagating back up through the target's ancestors in reverse order, starting with the parent, and eventually reaching the containing window.
Using Fetch - Web APIs
utf8decoder.decode(chunk) : ''; const re = /\n|\r|\r\n/gm; let startindex = 0; let result; for (;;) { let result = re.exec(chunk); if (!result) { if (readerdone) { break; } let remainder = chunk.substr(startindex); ({ value: chunk, done: readerdone } = await reader.read()); chunk = remainder + (chunk ?
... utf8decoder.decode(chunk) : ''); startindex = re.lastindex = 0; continue; } yield chunk.substring(startindex, result.index); startindex = re.lastindex; } if (startindex < chunk.length) { // last line didn't end in a newline char yield chunk.substr(startindex); } } async function run() { for await (let line of maketextfilelineiterator(urloffile)) { processline(line); } } run(); checking that the fetch was successful a fetch() promise will reject with a typeerror when a network error is encountered or cors is misconfigured on the server-side, although this usually means permission issues or similar — a 404 does not constitute a network error, for example.
Frame Timing API - Web APIs
performanceentry.starttime set to the domhighrestimestamp when the frame was started.
... performanceentry.duration set to a timestamp indicating the difference between the starttimes of two successive frames.
GestureEvent - Web APIs
events using this interface include gesturestart, gesturechange, and gestureend.
... gesture event types gesturestart gesturechange gestureend specifications not part of any specification.
GlobalEventHandlers.ondrag - Web APIs
<!doctype html> <html lang=en> <title>examples of using the ondrag global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function drag_handler(ev) { console.log("drag"); } function dragstart_handler(ev) { console.log("dragstart"); ev.datatransfer.setdata("text", ev.target.id); } function drop_handler(ev) { console.log("drop"); ev.currenttarget.style.background = "lightyellow"; ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault();...
... } </script> <body> <h1>examples of <code>ondrag</code>, <code>ondrop</code>, <code>ondragstart</code>, <code>ondragover</code></h1> <div> <!-- <div class="source"> --> <p id="source" ondrag="drag_handler(event);" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html living standardthe definition of 'ondrag' in that specification.
GlobalEventHandlers.ondragend - Web APIs
<!doctype html> <html lang=en> <title>examples of using the drag and drop global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's background color to signify drag has started ev.currenttarget.style.border = "dashed"; ev.datatransfer.setdata("text", ev.target.id); } function dragover_handler(ev) { console.log("dragover"); // change the target element's border to signify a drag over event // has occurred ev.currenttarget.style.background = "lightb...
...nter/leave/end/exit events var el=document.getelementbyid("source"); el.ondragenter = dragenter_handler; el.ondragleave = dragleave_handler; el.ondragend = dragend_handler; el.ondragexit = dragexit_handler; } </script> <body onload="init();"> <h1>examples of <code>ondragenter</code>, <code>ondragleave</code>, <code>ondragend</code>, <code>ondragexit</code></h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html living standardthe definition of 'ondragend'...
GlobalEventHandlers.ondragenter - Web APIs
<!doctype html> <html lang=en> <title>examples of using the drag and drop global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's background color to signify drag has started ev.currenttarget.style.border = "dashed"; ev.datatransfer.setdata("text", ev.target.id); } function dragover_handler(ev) { console.log("dragover"); // change the target element's border to signify a drag over event // has occurred ev.currenttarget.style.background = "lightb...
...nter/leave/end/exit events var el=document.getelementbyid("source"); el.ondragenter = dragenter_handler; el.ondragleave = dragleave_handler; el.ondragend = dragend_handler; el.ondragexit = dragexit_handler; } </script> <body onload="init();"> <h1>examples of <code>ondragenter</code>, <code>ondragleave</code>, <code>ondragend</code>, <code>ondragexit</code></h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html living standardthe definition of 'ondragente...
GlobalEventHandlers.ondragexit - Web APIs
<!doctype html> <html lang=en> <title>examples of using the drag and drop global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's background color to signify drag has started ev.currenttarget.style.border = "dashed"; ev.datatransfer.setdata("text", ev.target.id); } function dragover_handler(ev) { console.log("dragover"); // change the target element's border to signify a drag over event // has occurred ev.currenttarget.style.background = "lightb...
...nter/leave/end/exit events var el=document.getelementbyid("source"); el.ondragenter = dragenter_handler; el.ondragleave = dragleave_handler; el.ondragend = dragend_handler; el.ondragexit = dragexit_handler; } </script> <body onload="init();"> <h1>examples of <code>ondragenter</code>, <code>ondragleave</code>, <code>ondragend</code>, <code>ondragexit</code></h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html living standardthe definition of 'ondragexi...
GlobalEventHandlers.ondragleave - Web APIs
<!doctype html> <html lang=en> <title>examples of using the drag and drop global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function dragstart_handler(ev) { console.log("dragstart"); // change the source element's border to signify drag has started ev.currenttarget.style.border = "dashed"; ev.datatransfer.setdata("text", ev.target.id); } function dragover_handler(ev) { console.log("dragover"); // change the target element's background color to signify a drag over event // has occurred ev.currenttarget.style.background = "lightb...
...nter/leave/end/exit events var el=document.getelementbyid("source"); el.ondragenter = dragenter_handler; el.ondragleave = dragleave_handler; el.ondragend = dragend_handler; el.ondragexit = dragexit_handler; } </script> <body onload="init();"> <h1>examples of <code>ondragenter</code>, <code>ondragleave</code>, <code>ondragend</code>, <code>ondragexit</code></h1> <div> <p id="source" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html living standardthe definition of 'ondraglea...
GlobalEventHandlers.ondragover - Web APIs
<!doctype html> <html lang=en> <title>examples of using the ondrag global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function drag_handler(ev) { console.log("drag"); } function dragstart_handler(ev) { console.log("dragstart"); ev.datatransfer.setdata("text", ev.target.id); } function drop_handler(ev) { console.log("drop"); ev.currenttarget.style.background = "lightyellow"; ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault();...
... } </script> <body> <h1>examples of <code>ondrag</code>, <code>ondrop</code>, <code>ondragstart</code>, <code>ondragover</code></h1> <div> <p id="source" ondrag="drag_handler(event);" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html living standardthe definition of 'ondragover' in that specification.
GlobalEventHandlers.ondrop - Web APIs
<!doctype html> <html lang=en> <title>examples of using the ondrag global event attribute</title> <meta content="width=device-width"> <style> div { margin: 0em; padding: 2em; } #source { color: blue; border: 1px solid black; } #target { border: 1px solid black; } </style> </head> <script> function drag_handler(ev) { console.log("drag"); } function dragstart_handler(ev) { console.log("dragstart"); ev.datatransfer.setdata("text", ev.target.id); } function drop_handler(ev) { console.log("drop"); ev.currenttarget.style.background = "lightyellow"; ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } function dragover_handler(ev) { console.log("dragover"); ev.preventdefault();...
... } </script> <body> <h1>examples of <code>ondrag</code>, <code>ondrop</code>, <code>ondragstart</code>, <code>ondragover</code></h1> <div class="source"> <p id="source" ondrag="drag_handler(event);" ondragstart="dragstart_handler(event);" draggable="true"> select this element, drag it to the drop zone and then release the selection to move the element.</p> </div> <div id="target" ondrop="drop_handler(event);" ondragover="dragover_handler(event);">drop zone</div> </body> </html> specifications specification status comment html living standardthe definition of 'ondrop' in that specification.
HTMLElement: transitioncancel event - Web APIs
udes a delay: <div class="transition"></div> <div class="message"></div> .transition { width: 100px; height: 100px; background: rgba(255,0,0,1); transition-property: transform background; transition-duration: 2s; transition-delay: 2s; } .transition:hover { transform: rotate(90deg); background: rgba(255,0,0,0); } to this, we'll add some javascript to indicate that the transitionstart, transitionrun, transitioncancel and transitionend events fire.
... const message = document.queryselector('.message'); const el = document.queryselector('.transition'); el.addeventlistener('transitionrun', function() { message.textcontent = 'transitionrun fired'; }); el.addeventlistener('transitionstart', function() { message.textcontent = 'transitionstart fired'; }); el.addeventlistener('transitioncancel', function() { message.textcontent = 'transitioncancel fired'; }); el.addeventlistener('transitionend', function() { message.textcontent = 'transitionend fired'; }); the transitioncancel event is fired if the transition is cancelled in either direction after the transitionrun event ...
HTMLElement: transitionend event - Web APIs
<div class="transition">hover over me</div> <div class="message"></div> .transition { width: 100px; height: 100px; background: rgba(255,0,0,1); transition-property: transform background; transition-duration: 2s; transition-delay: 1s; } .transition:hover { transform: rotate(90deg); background: rgba(255,0,0,0); } to this, we'll add some javascript to indicate that the transitionstart, transitionrun, transitioncancel and transitionend events fire.
... const message = document.queryselector('.message'); const el = document.queryselector('.transition'); el.addeventlistener('transitionrun', function() { message.textcontent = 'transitionrun fired'; }); el.addeventlistener('transitionstart', function() { message.textcontent = 'transitionstart fired'; }); el.addeventlistener('transitioncancel', function() { message.textcontent = 'transitioncancel fired'; }); el.addeventlistener('transitionend', function() { message.textcontent = 'transitionend fired'; }); the transitionend event is fired in both directions: when the box finishes turning and the opacity hits 0 or 1, depen...
HTMLMarqueeElement - Web APIs
htmlmarqueeelement.onstart fires when the marquee starts scrolling.
... htmlmarqueeelement.start() starts scrolling of the marquee.
HTMLTableRowElement - Web APIs
if the given position is greater (or equal as it starts at zero) than the amount of cells in the row, or is smaller than 0, it raises a domexception with the indexsizeerror value.
...if the given position is greater (or equal as it starts at zero) than the amount of cells in the row, or is smaller than -1, it raises a domexception with the indexsizeerror value.
HTMLTableSectionElement - Web APIs
if the given position is greater (or equal as it starts at zero) than the amount of rows in the section, or is smaller than 0, it raises a domexception with the indexsizeerror value.
...if the given position is greater (or equal as it starts at zero) than the amount of rows in the section, or is smaller than -1, it raises a domexception with the indexsizeerror value.
Dragging and Dropping Multiple Items - Web APIs
setting and getting with indices the mozsetdataat() method allows you to add multiple items during a dragstart event.
...you should add them in order starting with 0 as you cannot add items at positions farther than the last item, however you can replace existing items by using indices you have already added.
History.pushState() - Web APIs
WebAPIHistorypushState
because firefox saves state objects to the user's disk so they can be restored after the user restarts the browser, we impose a size limit of 640k characters on the serialized representation of a state object.
...note that the browser won't attempt to load this url after a call to pushstate(), but it might attempt to load the url later, for instance after the user restarts the browser.
IDBCursor.direction - Web APIs
possible values are: value description next this direction causes the cursor to be opened at the start of the source.
... nextunique this direction causes the cursor to be opened at the start of the source.
Browser storage limits and eviction criteria - Web APIs
we term them "quota clients" in this context: indexeddb asm.js caching cache api cookies note: in firefox, web storage will soon start to use the same storage management tools too, as described in this document.
... lru policy when the available disk space is filled up, the quota manager will start clearing out data based on an lru policy — the least recently used origin will be deleted first, then the next one, until the browser is no longer over the limit.
install - Web APIs
as with the older startsoftwareupdate method, xpis installed with this method must have their own install.js files in which the full installation is defined.
... in contrast to startsoftwareupdate, install allows you to do multiple installs with the same trigger and provides a unified user experience for the multiple installs.
MSGestureEvent - Web APIs
events using this interface include msgesturestart, msgestureend, msgesturetap, msgesturehold, msgesturechange, and msinertiastart.
... gesture event types msgesturestart msgestureend msgesturetap msgesturehold msgesturechange msinertiastart specifications not part of any specification.
MediaDevices.getDisplayMedia() - Web APIs
example in the example below, a startcapture() method is created which initiates screen capture given a set of options specified by the displaymediaoptions parameter.
... async function startcapture(displaymediaoptions) { let capturestream = null; try { capturestream = await navigator.mediadevices.getdisplaymedia(displaymediaoptions); } catch(err) { console.error("error: " + err); } return capturestream; } this uses await to asynchronously wait for getdisplaymedia() to resolve with a mediastream which contains the display contents as requested by the specified options.
MediaDevices.ondevicechange - Web APIs
html content <p>click the start button below to begin the demonstration.</p> <div id="startbutton" class="button"> start </div> <video id="video" width="160" height="120" autoplay></video><br> <div class="left"> <h2>audio devices:</h2> <ul class="devicelist" id="audiolist"></ul> </div> <div class="right"> <h2>video devices:</h2> <ul class="devicelist" id="videolist"></ul> </div> <div id="log"></div> css content bo...
... 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: 30 }, audio: { samplerate: 44100, samplesize: 16, volume: 0.25 } }).then(stream => { videoelement.srcobject = stream; updatedevicelist(); }) .catch(err => log(err.name + ": " + err.message)); }...
MediaRecorder.ondataavailable - Web APIs
if a timeslice property was passed into the mediarecorder.start() method that started media capture, a dataavailable event is fired every timeslice milliseconds.
...so if the method call looked like this — recorder.start(1000); — the dataavailable event would fire after each second of media capture, and our event handler would be called every second with a blob of media data that's one second long.
MediaSource.setLiveSeekableRange() - Web APIs
syntax mediasource.setliveseekablerange(start, end) parameters start the start of the seekable range to set in seconds measured from the beginning of the source.
... if the duration of the media source is positive infinity, then the timeranges object returned by the htmlmediaelement.seekable property will have a start timestamp no greater than this value.
MediaStream Recording API - Web APIs
once the source media is playing and you've reached the point where you're ready to record video, call mediarecorder.start() to begin recording.
...var stream = canvas.capturestream(25); var recordedchunks = []; console.log(stream); var options = { mimetype: "video/webm; codecs=vp9" }; mediarecorder = new mediarecorder(stream, options); mediarecorder.ondataavailable = handledataavailable; mediarecorder.start(); function handledataavailable(event) { console.log("data-available"); if (event.data.size > 0) { recordedchunks.push(event.data); console.log(recordedchunks); download(); } else { // ...
Transcoding assets for Media Source Extensions - Web APIs
getting started the first and most important step is to ensure that your files are comprised of a container and codec that users' browsers support.
...frag_keyframe+empty_moov bunny_fragmented.mp4 if you already have an mp4, but it's not properly fragmented, you can again use ffmpeg: $ ffmpeg -i non_fragmented.mp4 -movflags frag_keyframe+empty_moov fragmented.mp4 in both cases, chrome may require an extra movie flag to be set: -movflags frag_keyframe+empty_moov+default_base_moof having a properly fragmented mp4 file is all you need to get started.
MessagePort: message event - Web APIs
.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; }); myport.start(); }); note that the listener must call messageport.start() before any messages will be delivered to this port.
... this is only needed when using the addeventlistener() method: if the receiver uses onmessage instead, start() is called implicitly: window.addeventlistener('message', (event) => { const myport = event.ports[0]; myport.onmessage = (event) => { received.textcontent = event.data; }; }); specifications specification status html living standard living standard ...
MutationObserverInit.attributes - Web APIs
if true, the callback specified when observe() was used to start observing the node or subtree will be called any time one or more attributes have changed on observed nodes.
... " changed to " + mutation.target[mutation.attributename] + " (was " + mutation.oldvalue + ")"); break; } }); } var targetnode = document.queryselector("#target"); var observer = new mutationobserver(callback); observer.observe(targetnode, { attributes: true, attributeoldvalue: true }); the callback() function—which will be passed into the observe() method when starting the observer, looks at each item in the list of mutationrecord objects.
Using Navigation Timing - Web APIs
for example, to measure the perceived loading time for a page: window.addeventlistener("load", function() { let now = new date().gettime(); let loadingtime = now - performance.timing.navigationstart; document.queryselector(".output").innertext = loadingtime + " ms"; }, false); this code, executed when the load event occurs, subtracts from the current time the time at which the navigation whose timing was recorded began (performance.timing.navigationstart), and outputs that information to the screen by inserting it into an element.
...the new code looks like this: window.addeventlistener("load", function() { let now = new date().gettime(); let loadingtime = now - performance.timing.navigationstart; output = "load time: " + loadingtime + " ms<br/>"; output += "navigation type: "; switch(performance.navigation.type) { case performancenavigation.type_navigate: output += "navigation"; break; case performancenavigation.type_reload: output += "reload"; break; case performancenavigation.type_back_forward: output += "history"; break; ...
NodeList - Web APIs
WebAPINodeList
(in this case, the keys are numbers starting from 0 and the values are nodes.) nodelist.foreach() executes a provided function once per nodelist element, passing the element as an argument to the function.
...(in this case, the keys are numbers starting from 0.) nodelist.values() returns an iterator allowing code to go through all values (nodes) of the key/value pairs contained in the collection.
OfflineAudioContext.resume() - Web APIs
if the context is not currently suspended or the rendering has not started, the promise is rejected with invalidstateerror.
... invalidstateerror if the context is not currently suspended or the rendering has not started.
OrientationSensor - Web APIs
model.quaternion.fromarray(sensor.quaternion).inverse(); }); sensor.addeventlistener('error', error => { if (event.error.name == 'notreadableerror') { console.log("sensor is not available."); } }); sensor.start(); permissions example using orientation sensors requires requsting permissions for multiple device sensors.
... const sensor = new absoluteorientationsensor(); promise.all([navigator.permissions.query({ name: "accelerometer" }), navigator.permissions.query({ name: "magnetometer" }), navigator.permissions.query({ name: "gyroscope" })]) .then(results => { if (results.every(result => result.state === "granted")) { sensor.start(); ...
Page Visibility API - Web APIs
a document may start in the prerender state, but will never switch to this state from any other state, since a document can only prerender once.
... //startsimulation and pausesimulation defined elsewhere function handlevisibilitychange() { if (document.hidden) { pausesimulation(); } else { startsimulation(); } } document.addeventlistener("visibilitychange", handlevisibilitychange, false); specifications specification status comment page visibility (second edition) recommendation initial definition.
PannerNode.positionX - Web APIs
example the following example starts an oscillator, and pans it to the left after 1 second, to the right after 2 seconds, and back to the center after 3 seconds.
... const context = new audiocontext(); const osc = new oscillatornode(context); const panner = new pannernode(context); panner.positionx.setvalueattime(-1, context.currenttime + 1); panner.positionx.setvalueattime(1, context.currenttime + 2); panner.positionx.setvalueattime(0, context.currenttime + 3); osc.connect(panner) .connect(context.destination); osc.start(0); specifications specification status comment web audio apithe definition of 'positionx' in that specification.
PannerNode.positionY - Web APIs
example the following example starts an oscillator and pans it above the listener after 1 second, below the listener after 2 seconds, and back to the center after 3 seconds.
... const context = new audiocontext(); const osc = new oscillatornode(context); const panner = new pannernode(context); panner.panningmodel = 'hrtf'; panner.positiony.setvalueattime(1, context.currenttime + 1); panner.positiony.setvalueattime(-1, context.currenttime + 2); panner.positiony.setvalueattime(0, context.currenttime + 3); osc.connect(panner) .connect(context.destination); osc.start(0); specifications specification status comment web audio apithe definition of 'positiony' in that specification.
PannerNode.positionZ - Web APIs
example the following example starts an oscillator and moves it in front of the listener after 1 second, behind the listener after 2 seconds, and back to the listener's position after 3 seconds.
... const context = new audiocontext(); const osc = new oscillatornode(context); const panner = new pannernode(context); panner.panningmodel = 'hrtf'; panner.positionz.setvalueattime(1, context.currenttime + 1); panner.positionz.setvalueattime(-1, context.currenttime + 2); panner.positionz.setvalueattime(0, context.currenttime + 3); osc.connect(panner) .connect(context.destination); osc.start(0); specifications specification status comment web audio apithe definition of 'positionz' in that specification.
PannerNode.rolloffFactor - Web APIs
reases with increasing distance from the listener: const context = new audiocontext(); // all our test tones will last this many seconds const note_length = 4; // this is how far we'll move the sound const z_distance = 20; // this function creates a graph for the test tone with a given rollofffactor // and schedules it to move away from the listener along the z (depth-wise) axis // at the given start time, resulting in a decrease in volume (decay) const scheduletesttone = (rollofffactor, starttime) => { const osc = new oscillatornode(context); const panner = new pannernode(context); panner.rollofffactor = rollofffactor; // set the initial z position, then schedule the ramp panner.positionz.setvalueattime(0, starttime); panner.positionz.linearramptovalueattime(z_distance, startti...
...me + note_length); osc.connect(panner) .connect(context.destination); osc.start(starttime); osc.stop(starttime + note_length); }; // this tone should decay fairly quickly scheduletesttone(1, context.currenttime); // this tone should decay slower than the previous one scheduletesttone(0.5, context.currenttime + note_length); // this tone should decay only slightly scheduletesttone(0.1, context.currenttime + note_length * 2); after running this code, the resulting waveforms should look something like this: specifications specification status comment web audio apithe definition of 'rollofffactor' in that specification.
PaymentRequest.show() - Web APIs
starting the payment process, in the end, is as simple as calling the processpayment() method.
... async function requestpayment() { // we start with au$0 as the total.
performance.getEntries() - Web APIs
the items will be in chronological order based on the entries' starttime.
... to iterate through the each entry let p = performance.getentries(); for (var i=0; i < p.length; i++) { console.log("entry[" + i + "]"); check_performanceentry(p[i]); } // use getentriesbytype() to get all "mark" entries p = performance.getentriesbytype("mark"); for (let i=0; i < p.length; i++) { console.log ("mark only entry[" + i + "]: name = " + p[i].name + "; starttime = " + p[i].starttime + "; duration = " + p[i].duration); } // use getentriesbyname() to get all "mark" entries named "begin" p = performance.getentriesbyname("begin", "mark"); for (let i=0; i < p.length; i++) { console.log ("mark and begin entry[" + i + "]: name = " + p[i].name + "; starttime = " + p[i].starttime + "; duration = " + p[i].duration); ...
performance.getEntriesByName() - Web APIs
the items will be in chronological order based on the entries' starttime.
...et specific entries p = performance.getentries({name : "begin", entrytype: "mark"}); for (var i=0; i < p.length; i++) { log("begin[" + i + "]"); check_performanceentry(p[i]); } // use getentriesbytype() to get all "mark" entries p = performance.getentriesbytype("mark"); for (var i=0; i < p.length; i++) { log ("mark only entry[" + i + "]: name = " + p[i].name + "; starttime = " + p[i].starttime + "; duration = " + p[i].duration); } // use getentriesbyname() to get all "mark" entries named "begin" p = performance.getentriesbyname("begin", "mark"); for (var i=0; i < p.length; i++) { log ("mark and begin entry[" + i + "]: name = " + p[i].name + "; starttime = " + p[i].starttime + "; duration = " + p[i].duration); } } sp...
performance.getEntriesByType() - Web APIs
the items will be in chronological order based on the entries' starttime.
...get specific entries p = performance.getentries({name : "begin", entrytype: "mark"}); for (var i=0; i < p.length; i++) { log("begin[" + i + "]"); checkperformanceentry(p[i]); } // use getentriesbytype() to get all "mark" entries p = performance.getentriesbytype("mark"); for (var i=0; i < p.length; i++) { log ("mark only entry[" + i + "]: name = " + p[i].name + "; starttime = " + p[i].starttime + "; duration = " + p[i].duration); } // use getentriesbyname() to get all "mark" entries named "begin" p = performance.getentriesbyname("begin", "mark"); for (var i=0; i < p.length; i++) { log ("mark and begin entry[" + i + "]: name = " + p[i].name + "; starttime = " + p[i].starttime + "; duration = " + p[i].duration); } } sp...
performance.now() - Web APIs
WebAPIPerformancenow
otherwise, performance.timing.navigationstart + performance.now() will be approximately equal to date.now().
... starting with firefox 79, high resolution timers can be used if you cross-origin isolate your document using the cross-origin-opener-policy and cross-origin-embedder-policy headers: cross-origin-opener-policy: same-origin cross-origin-embedder-policy: require-corp these headers ensure a top-level document does not share a browsing context group with cross-origin documents.
Performance - Web APIs
performance.timeorigin read only returns the high resolution timestamp of the start time of the performance measurement.
... performance.measure() creates a named timestamp in the browser's performance entry buffer between two specified marks (known as the start mark and end mark, respectively).
PerformanceEntry - Web APIs
performanceentry.starttime read only a domhighrestimestamp representing the starting time for the performance metric.
... function print_performanceentries() { // use getentries() to get a list of all performance entries var p = performance.getentries(); for (var i=0; i < p.length; i++) { console.log("performanceentry[" + i + "]"); print_performanceentry(p[i]); } } function print_performanceentry(perfentry) { var properties = ["name", "entrytype", "starttime", "duration"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var value = perfentry[properties[i]]; console.log("...
PerformanceFrameTiming - Web APIs
performanceentry.starttime returns the timestamp when the frame was started.
... performanceentry.duration returns a timestamp indicating the difference between the starttimes of two successive frames.
PerformanceMeasure - Web APIs
performanceentry.starttime returns a timestamp given to the measure when performance.measure() was called.
... performanceentry.duration returns a domhighrestimestamp that is the duration of the measure (typically, the measure's end mark timestamp minus its start mark timestamp).
PerformanceNavigationTiming.type - Web APIs
the value must be one of the following: navigate navigation started by clicking a link, entering the url in the browser's address bar, form submission, or initializing through a script operation other than reload and back_forward as listed below.
...on print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = ...
PerformanceObserverEntryList.getEntries() - Web APIs
the items will be in chronological order based on the entries' starttime.
... example function print_perf_entry(pe) { console.log("name: " + pe.name + "; entrytype: " + pe.entrytype + "; starttime: " + pe.starttime + "; duration: " + pe.duration); } // create observer for all performance event types var observe_all = new performanceobserver(function(list, obs) { var perfentries; // print all entries perfentries = list.getentries(); for (var i=0; i < perfentries.length; i++) { print_perf_entry(perfentries[i]); } // print entries named "begin" with type "mark" perfentries = list.getentriesbyname("begin", "mark"); for (var i=0; i < perfentries.length; i++) { print_pe...
PerformanceObserverEntryList.getEntriesByName() - Web APIs
the items will be in chronological order based on the entries' starttime.
... example function print_perf_entry(pe) { console.log("name: " + pe.name + "; entrytype: " + pe.entrytype + "; starttime: " + pe.starttime + "; duration: " + pe.duration); } // create observer for all performance event types var observe_all = new performanceobserver(function(list, obs) { var perfentries; // print all entries perfentries = list.getentries(); for (var i=0; i < perfentries.length; i++) { print_perf_entry(perfentries[i]); } // print entries named "begin" with type "mark" perfentries = list.getentriesbyname("begin", "mark"); for (var i=0; i < perfentries.length; i++) { print_perf_entry(perfentries[i]); } // print entries with...
PerformanceObserverEntryList.getEntriesByType() - Web APIs
the items will be in chronological order based on the entries' starttime.
... example function print_perf_entry(pe) { console.log("name: " + pe.name + "; entrytype: " + pe.entrytype + "; starttime: " + pe.starttime + "; duration: " + pe.duration); } // create observer for all performance event types var observe_all = new performanceobserver(function(list, obs) { var perfentries; // print all entries perfentries = list.getentries(); for (var i=0; i < perfentries.length; i++) { print_perf_entry(perfentries[i]); } // print entries named "begin" with type "mark" perfentries = list.getentriesbyname("begin", "mark"); for (var i=0; i < perfentries.length; i++) { print_perf_entry(perfentries[i]); } ...
PerformancePaintTiming - Web APIs
performanceentry.starttime returns the timestamp when the paint ocurred.
... example function showpainttimings() { if (window.performance) { let performance = window.performance; let performanceentries = performance.getentriesbytype('paint'); performanceentries.foreach( (performanceentry, i, entries) => { console.log("the time to " + performanceentry.name + " was " + performanceentry.starttime + " milliseconds."); }); } else { console.log('performance timing isn\'t supported.'); } } the code above produces console output something like the following: the time to first-paint was 2785.915 milliseconds.
PerformanceResourceTiming.connectEnd - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
... function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supported) { var va...
PerformanceResourceTiming.redirectEnd - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
... function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supporte...
PerformanceResourceTiming.responseEnd - Web APIs
example in the following example, the value of the *start and *end properties of all "resource" type events are logged.
... function print_performanceentries() { // use getentriesbytype() to just get the "resource" events var p = performance.getentriesbytype("resource"); for (var i=0; i < p.length; i++) { print_start_and_end_properties(p[i]); } } function print_start_and_end_properties(perfentry) { // print timestamps of the performanceentry *start and *end properties properties = ["connectstart", "connectend", "domainlookupstart", "domainlookupend", "fetchstart", "redirectstart", "redirectend", "requeststart", "responsestart", "responseend", "secureconnectionstart"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in perfentry; if (supporte...
PerformanceTiming.connectEnd - Web APIs
if the transport layer reports an error and the connection establishment is started again, the last connection establisment end time is given.
... if a persistent connection is used, the value will be the same as performancetiming.fetchstart.
Multi-touch interaction - Web APIs
function pointerdown_handler(ev) { // the pointerdown event signals the start of a touch interaction.
... <body onload="init();" style="touch-action:none"> <div id="target1"> tap, hold or swipe me 1</div> <div id="target2"> tap, hold or swipe me 2</div> <div id="target3"> tap, hold or swipe me 3</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 with the event flow.
Pinch zoom gestures - Web APIs
function pointerdown_handler(ev) { // the pointerdown event signals the start of a touch interaction.
... <body onload="init();" 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.
RTCDTMFSender.insertDTMF() - Web APIs
the insertdtmf() method on the rtcdtmfsender interface starts sending dtmf tones to the remote peer over the rtcpeerconnection.
... sending of the tones is performed asynchronously, with tonechange events sent to the rtcdtmfsender every time a tone starts or ends.
RTCDTMFSender - Web APIs
methods rtcdtmfsender.insertdtmf() given a string describing a set of dtmf codes and, optionally, the duration of and inter-tone gap between the tones, insertdtmf() starts sending the specified tones.
... tonechange the tonechange event is sent to the rtcdtmfsender instance's event handler to indicate that a tone has either started or stopped playing.
RTCDataChannel: close event - Web APIs
bubbles no cancelable no interface event event handler property rtcdatachannel.onclose examples this example sets up a handler for the close event for the rtcdatachannel named dc; its responsibility in this example is to update user interface elements to reflect that there is no longer an ongoing call, and to allow a new call to be started.
... dc.addeventlistener("close", ev => { messageinputbox.disabled = true; sendbutton.disabled = true; connectbutton.disabled = false; disconnectbutton.disabled = true; }, false); all this code does in response to receiving the close event is to disable an input box and its "send" button, and to enable the button used to start a call (while disabling the one that ends a call).
RTCIceCandidate - Web APIs
when starting a webrtc peer connection, typically a number of candidates are proposed by each end of the connection, until they mutually agree upon one which describes the connection they decide will be best.
...you can use this string to verify generations of ice generation; each generation of the same ice process will use the same usernamefragment, even across ice restarts.
RTCIceCandidatePairStats - Web APIs
any candidate pair that isn't the active pair of candidates for a transport gets deleted if the rtcicetransport performs an ice restart, at which point the state of the ice transport returns to new and negotiation starts once again.
... for more information, see ice restart in lifetime of a webrtc session.
RTCIceGathererState - Web APIs
values "new" the rtcicetransport is newly created and has not yet started to gather ice candidates.
...the transport won't gather any further candidates unless an ice restart occurs, at which point the gathering process starts over from scratch.
RTCIceTransport.gatheringState - Web APIs
syntax gatherstate = rtcicetransport.gatheringstate; value a string from the rtcicegathererstate enumerated type whose value indicates the current state of the ice agent's candidate gathering process: "new" the rtcicetransport is newly created and has not yet started to gather ice candidates.
...the transport won't gather any further candidates unless an ice restart occurs, at which point the gathering process starts over from scratch.
RTCIceTransport.ongatheringstatechange - Web APIs
its possible values are: "new" the rtcicetransport is newly created and has not yet started to gather ice candidates.
...the transport won't gather any further candidates unless an ice restart occurs, at which point the gathering process starts over from scratch.
RTCIceTransportState - Web APIs
usage notes if an ice restart occurs, the candidate gathering and connectivity check process is started over again; this will cause a transition from the "connected" state if the restart occurred while the state was "completed".
... if the restart occured during a transient "disconnected" state, the state transitions to "checking" the disconnected state "disconnected" is a transient state that occurs when the connection between the two peers fails in a manner that the webrtc infrastructure can automatically correct once the connection is available again.
RTCPeerConnection: negotiationneeded event - Web APIs
this starts the process of ice negotiation by instructing your code to begin exchanging ice candidates through the signaling server.
...ionneeded event by assigning the event handler function to the rtcpeerconnection.onnegotiationneeded property: pc.onnegotiationneeded = ev => { pc.createoffer() .then(offer => return pc.setlocaldescription(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.localdescription })) .catch(err => { /* handle error */ ); }; for a more detailed example, see starting negotiation in signaling and video calling.
RTCPeerConnection.setRemoteDescription() - Web APIs
this begins a new negotiation session, with the newly-established offer as the starting point.
... upon starting the new negotiation with the newly-established offer, the local peer is now the callee, even if it was previously the caller.
RTCPeerConnection - Web APIs
should then be sent to the source of the offer to continue the negotiation process.createdatachannel() the createdatachannel() method on the rtcpeerconnection interface creates a new channel linked with the remote peer, over which any kind of data may be transmitted.createoffer()the createoffer() method of the rtcpeerconnection interface initiates the creation of an sdp offer for the purpose of starting a new webrtc connection to a remote peer.generatecertificate()the generatecertificate() method of the rtcpeerconnection interface creates and stores an x.509 certificate and corresponding private key then returns an rtccertificate, providing access to it.getconfiguration() the rtcpeerconnection.getconfiguration() method returns an rtcconfiguration object which indicates the current configurat...
...cause this method has been deprecated, you should instead use removetrack() if your target browser versions have implemented it.removetrack()the rtcpeerconnection.removetrack() method tells the local end of the connection to stop sending media from the specified track, without actually removing the corresponding rtcrtpsender from the list of senders as reported by rtcpeerconnection.getsenders().restartice()the webrtc api's rtcpeerconnection interface offers the restartice() method to allow a web application to easily request that ice candidate gathering be redone on both ends of the connection.setconfiguration() the rtcpeerconnection.setconfiguration() method sets the current configuration of the rtcpeerconnection based on the values included in the specified rtcconfiguration object.
Range.commonAncestorContainer - Web APIs
this means that if range.startcontainer and range.endcontainer both refer to the same node, this node is the common ancestor container.
...to change the ancestor container of a node, consider using the various methods available to set the start and end positions of the range, such as range.setstart() and range.setend().
Range.compareNode() - Web APIs
WebAPIRangecompareNode
the possible values are: node_before (0) node starts before the range node_after (1) node ends after the range node_before_and_after (2) node starts before and ends after the range node_inside (3) node starts after and ends before the range, i.e.
... the following function can be used as replacement: function rangecomparenode(range, node) { var noderange = node.ownerdocument.createrange(); try { noderange.selectnode(node); } catch (e) { noderange.selectnodecontents(node); } var nodeisbefore = range.compareboundarypoints(range.start_to_start, noderange) == 1; var nodeisafter = range.compareboundarypoints(range.end_to_end, noderange) == -1; if (nodeisbefore && !nodeisafter) return 0; if (!nodeisbefore && nodeisafter) return 1; if (nodeisbefore && nodeisafter) return 2; return 3; } syntax returnvalue = range.comparenode( referencenode ); parameters referencenode the node to compare with the ran...
Range.comparePoint() - Web APIs
if the reference node is a node of type text, comment, or cdatasection, then offset is the number of characters from the start of reference node.
... for other node types, offset is the number of child nodes between the start of the reference node.
Range.getBoundingClientRect() - Web APIs
the range's content <b>starts here</b> and continues on until it <b>ends here</b>.
... the bounding client rectangle contains everything selected in the range.</p> css #highlight { background: yellow; position: absolute; z-index: -1; } p { width: 200px; } javascript const range = document.createrange(); range.setstartbefore(document.getelementsbytagname('b').item(0), 0); range.setendafter(document.getelementsbytagname('b').item(1), 0); const clientrect = range.getboundingclientrect(); const highlight = document.getelementbyid('highlight'); highlight.style.left = `${clientrect.x}px`; highlight.style.top = `${clientrect.y}px`; highlight.style.width = `${clientrect.width}px`; highlight.style.height = `${clientrect.height}px`; result specification specification status comment css object model (cssom) view modulethe definition of 'range.getb...
Range.selectNodeContents() - Web APIs
the parent node of the start and end of the range will be the reference node.
... the startoffset is 0, and the endoffset is the number of child nodes or number of characters contained in the reference node.
ReadableStreamDefaultController.close() - Web APIs
the start() function generates a random string of text every second and enqueues it into the stream.
... 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...
ReadableStreamDefaultController.enqueue() - Web APIs
the start() function generates a random string of text every second and enqueues it into the stream — see controller.enqueue(string).
... 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...
ReadableStreamDefaultReader.read() - Web APIs
utf8decoder.decode(chunk) : ""; let re = /\r\n|\n|\r/gm; let startindex = 0; let result; for (;;) { let result = re.exec(chunk); if (!result) { if (readerdone) { break; } let remainder = chunk.substr(startindex); ({value: chunk, done: readerdone} = await reader.read()); chunk = remainder + (chunk ?
... utf8decoder.decode(chunk) : ""); startindex = re.lastindex = 0; continue; } yield chunk.substring(startindex, result.index); startindex = re.lastindex; } if (startindex < chunk.length) { // last line didn't end in a newline char yield chunk.substr(startindex); } } for await (let line of maketextfilelineiterator(urloffile)) { processline(line); } specifications specification status comment streamsthe definition of 'read()' in that specification.
RelativeOrientationSensor - Web APIs
model.quaternion.fromarray(sensor.quaternion).inverse(); }); sensor.addeventlistener('error', error => { if (event.error.name == 'notreadableerror') { console.log("sensor is not available."); } }); sensor.start(); permissions example using orientation sensors requires requsting permissions for multiple device sensors.
... const sensor = new relativeorientationsensor(); promise.all([navigator.permissions.query({ name: "accelerometer" }), navigator.permissions.query({ name: "gyroscope" })]) .then(results => { if (results.every(result => result.state === "granted")) { sensor.start(); ...
SVGTextContentElement - Web APIs
svgtextcontentelement.getstartpositionofchar() returns a dompoint representing the position of a typographic character after text layout has been performed.
... candidate recommendation changed inheritance from svgelement to svggraphicselement and getstartpositionofchar() and removed implementations of svgtests, svglangspace, svgexternalresourcesrequired, svgstylable interfaces and getendpositionofchar() to return a dompoint instead of an svgpoint.
Using server-sent events - Web APIs
you can take action on this programmatically by implementing the onerror callback on the eventsource object: evtsource.onerror = function(err) { console.error("eventsource failed:", err); }; closing event streams by default, if the connection between the client and server closes, the connection is restarted.
...the first is just a comment, since it starts with a colon character.
Service Worker API - Web APIs
interestingly, other specifications can and will start to make use of the service worker context, for example: background synchronization: start up a service worker even when no users are at the site, so caches can be updated, etc.
... reacting to push messages: start up a service worker to send users a message to tell them new content is available.
SharedWorker() - Web APIs
exceptions a securityerror is raised if the document is not allowed to start workers, for example if the url has an invalid syntax or if the same-origin policy is violated.
... examples the following code snippet shows creation of a sharedworker object using the sharedworker() constructor and subsequent usage of the object: var myworker = new sharedworker('worker.js'); myworker.port.start(); first.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } second.onchange = function() { myworker.port.postmessage([first.value,second.value]); console.log('message posted to worker'); } myworker.port.onmessage = function(e) { result1.textcontent = e.data; console.log('message received from worker'); } for a full example, see o...
SourceBuffer.remove() - Web APIs
syntax sourcebuffer.remove(start, end); parameters start a double representing the start of the time range, in seconds.
... exceptions exception explanation invalidaccesserror the mediasource.duration property is equal to nan, the start parameter is negative or greater than mediasource.duration, or the end parameter is less than or equal to start or equal to nan.
SourceBuffer.removeAsync() - Web APIs
the removeasync() method of the sourcebuffer interface starts the process of asynchronously removing from the sourcebuffer media segments found within a specific time range.
... syntax removepromise = sourcebuffer.removeasync(start, end); parameters start a double representing the start of the time range, in seconds.
SpeechSynthesis - Web APIs
the speechsynthesis interface of the web speech api is the controller interface for the speech service; this can be used to retrieve information about the synthesis voices available on the device, start and pause speech, and other commands besides.
... inside the inputform.onsubmit handler, we stop the form submitting with preventdefault(), create a new speechsynthesisutterance instance containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method.
StaticRange.collapsed - Web APIs
the collapsed read-only property of the staticrange interface returns true if the range's start position and end position are the same.
...a collapsed range is one in which the start and end positions are the same, resulting in a zero-character-long range..
Streams API - Web APIs
with streams being available to javascript, this all changes — you can now start processing raw data with javascript bit by bit as soon as it is available on the client-side, without needing to generate a buffer, string, or blob.
... there are more advantages too — you can detect when streams start or end, chain streams together, handle errors and cancel streams as required, and react to the speed of the stream is being read at.
TextTrack - Web APIs
WebAPITextTrack
track cues are active if the current playback position of the media is between the cues' start and end times.
...the default is disabled, unless the <track> element's default boolean attribute is specified, in which case the default mode is started.
TextTrackCue - Web APIs
the cue includes the start time (the time at which the text will be displayed) and the end time (the time at which it will be removed from the display), as well as other information.
... texttrackcue.starttime a double that represents the video time that the cue will start being displayed, in seconds.
Touch.clientX - Web APIs
WebAPITouchclientX
when the touchend event handler is invoked, the changes in the touch.clientx and touch.clienty coordinates, from the starting touch point to the ending touch point, are calculated.
... // register touchstart and touchend listeners for element 'source' var src = document.getelementbyid("source"); var clientx, clienty; src.addeventlistener('touchstart', function(e) { // cache the client x/y coordinates clientx = e.touches[0].clientx; clienty = e.touches[0].clienty; }, false); src.addeventlistener('touchend', function(e) { var deltax, deltay; // compute the change in x and y coordinates.
Touch.clientY - Web APIs
WebAPITouchclientY
when the touchend event handler is invoked, the changes in the touch.clientx and touch.clienty coordinates, from the starting touch point to the ending touch point, are calculated.
... // register touchstart and touchend listeners for element 'source' var src = document.getelementbyid("source"); var clientx, clienty; src.addeventlistener('touchstart', function(e) { // cache the client x/y coordinates clientx = e.touches[0].clientx; clienty = e.touches[0].clienty; }, false); src.addeventlistener('touchend', function(e) { var deltax, deltay; // compute the change in x and y coordinates.
Touch.force - Web APIs
WebAPITouchforce
in following code snippet, the touchstart event handler iterrates through the targettouches list and logs the force value of each touch point but the code could invoke different processing depending on the value.
... someelement.addeventlistener('touchstart', function(e) { // iterate through the list of touch points and log each touch // point's force.
Touch.radiusX - Web APIs
WebAPITouchradiusX
the following simple code snippet, registers a single handler for the touchstart, touchmove and touchend events.
...</div> var src = document.getelementbyid("src"); src.addeventlistener('touchstart', rotate); src.addeventlistener('touchmove', rotate); src.addeventlistener('touchend', rotate); function rotate (e) { var touch = e.changedtouches.item(0); // turn off default event handling e.preventdefault(); // rotate element 'src'.
Touch.screenX - Web APIs
WebAPITouchscreenX
when the touchstart event handler is invoked, each touch point's touch.screenx and touch.screeny coordinates are accessed.
... // register a touchstart listeners for the 'source' element var src = document.getelementbyid("source"); src.addeventlistener('touchstart', function(e) { // iterate through the touch points and log each screenx/y coordinate.
TouchEvent.altKey - Web APIs
WebAPITouchEventaltKey
in following code snippet, the touchstart event handler logs the state of the event's modifier keys.
... someelement.addeventlistener('touchstart', function(e) { // log the state of this event's modifier keys console.log("altkey = " + e.altkey); console.log("ctrlkey = " + e.ctrlkey); console.log("metakey = " + e.metakey); console.log("shiftkey = " + e.shiftkey); }, false); specifications specification status comment touch events – level 2 draft non-stable version.
Supporting both TouchEvent and MouseEvent - Web APIs
if the browser fires both touch and mouse events because of a single user input, the browser must fire a touchstart before any mouse events.
... // touchmove handler function process_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 communi...
TransitionEvent() - Web APIs
for an "animationstart" event, elapsedtime is 0.0 unless there was a negative value for animation-delay, in which case the event will be fired with elapsedtime containing (-1 * delay).
... pseudoelement optional is a domstring, starting with "::", containing the name of the pseudo-element the animation runs on.
TransitionEvent - Web APIs
transitionevent.pseudoelement read only is a domstring, starting with ::, containing the name of the pseudo-element the animation runs on.
... transitionrun an event fired when a css transition is created, when it is added to a set of running transitions, though not nessarilty started transitionstart an event fired when a css transition has started transitioning.
USBDevice - Web APIs
WebAPIUSBDevice
usbdevice.opened read only indicates whether a session has been started with a paired usb device.
... usbdevice.open() returns a promise that resolves when a device session has started.
VTTCue - Web APIs
WebAPIVTTCue
constructor vttcue(starttime, endtime, text) returns a newly created vttcue object that covers the given time range and has the given text.
... param starttime the time, in seconds and fractions of a second, that describes the beginning of the range of the media data to which the cue applies.
Vibration API - Web APIs
continued vibrations some basic setinterval and clearinterval action will allow you to create persistent vibration: var vibrateinterval; // starts vibration at passed in level function startvibrate(duration) { navigator.vibrate(duration); } // stops vibration function stopvibrate() { // clear interval and stop persistent vibrating if(vibrateinterval) clearinterval(vibrateinterval); navigator.vibrate(0); } // start persistent vibration at given duration and interval // assumes a number value is given function startpersiste...
...ntvibrate(duration, interval) { vibrateinterval = setinterval(function() { startvibrate(duration); }, interval); } of course, the snippet above doesn't take into account the array method of vibration; persistent array-based vibration will require calculating the sum of the array items and creating an interval based on that number (with an additional delay, probably).
WebGL2RenderingContext.beginQuery() - Web APIs
the webgl2renderingcontext.beginquery() method of the webgl 2 api starts an asynchronous query.
... query a webglquery object for which to start the querying.
WebGL2RenderingContext.copyTexSubImage3D() - Web APIs
x a glint specifying the x coordinate of the lower left corner where to start copying.
... y a glint specifying the y coordinate of the lower left corner where to start copying.
WebGL2RenderingContext.drawRangeElements() - Web APIs
syntax void gl.drawrangeelements(mode, start, end, count, type, offset); parameters mode a glenum specifying the type primitive to render.
... start a gluint specifying the minimum array index contained in offset.
WebGL2RenderingContext.getBufferSubData() - Web APIs
srcbyteoffset a glintptr specifying the byte offset from which to start reading from the buffer.
... srcoffset optional a gluint specifying the element index offset where to start reading the buffer.
WebGL2RenderingContext.getIndexedParameter() - Web APIs
gl.transform_feedback_buffer_start: returns a glintptr.
... gl.uniform_buffer_start: returns a glintptr.
WebGL2RenderingContext - Web APIs
the webgl tutorial has more information, examples, and resources on how to get started with webgl.
... webgl2renderingcontext.begintransformfeedback() starts a transform feedback operation.
WebGLRenderingContext.bufferSubData() - Web APIs
dstbyteoffset a glintptr specifying an offset in bytes where the data replacement will start.
... srcoffset a gluint specifying the element index offset where to start reading the buffer.
WebGLRenderingContext.copyTexImage2D() - Web APIs
x a glint specifying the x coordinate of the lower left corner where to start copying.
... y a glint specifying the y coordinate of the lower left corner where to start copying.
WebGLRenderingContext.copyTexSubImage2D() - Web APIs
x a glint specifying the x coordinate of the lower left corner where to start copying.
... y a glint specifying the y coordinate of the lower left corner where to start copying.
A basic 2D WebGL animation example - Web APIs
since we're drawing a solid, untextured object with no lighting applied, this is exceptionally simple: <script id="fragment-shader" type="x-shader/x-fragment"> #ifdef gl_es precision highp float; #endif uniform vec4 uglobalcolor; void main() { gl_fragcolor = uglobalcolor; } </script> this starts by specifying the precision of the float type, as required.
... let uscalingfactor; let uglobalcolor; let urotationvector; let avertexposition; // animation timing let previoustime = 0.0; let degreespersecond = 90.0; initializing the program is handled through a load event handler called startup(): window.addeventlistener("load", startup, false); function startup() { glcanvas = document.getelementbyid("glcanvas"); gl = glcanvas.getcontext("webgl"); const shaderset = [ { type: gl.vertex_shader, id: "vertex-shader" }, { type: gl.fragment_shader, id: "fragment-shader" } ]; shaderprogram = buildshaderprogram(shaderset); aspectratio =...
Scissor animation - Web APIs
position = [0, gl.drawingbufferheight]; var button = document.queryselector("button"); var timer; function 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.
Matrix math for the web - Web APIs
manipulating the dom with a matrix a really easy way to start using a matrix is to use the css matrix3d() transform.
... the amount of change to apply to each of the width, height, and depth is placed diagonally starting at the top-left corner and making their way down toward the bottom-right.
Using textures in WebGL - Web APIs
apping to clamp to edge gl.texparameteri(gl.texture_2d, gl.texture_wrap_s, gl.clamp_to_edge); gl.texparameteri(gl.texture_2d, gl.texture_wrap_t, gl.clamp_to_edge); gl.texparameteri(gl.texture_2d, gl.texture_min_filter, gl.linear); } }; image.src = url; return texture; } function ispowerof2(value) { return (value & (value - 1)) == 0; } the loadtexture() routine starts by creating a webgl texture object texture by calling the webgl createtexture() function.
... replaced with this: // tell webgl how to pull out the texture coordinates from buffer { const num = 2; // every coordinate composed of 2 values const type = gl.float; // the data in the buffer is 32 bit float const normalize = false; // don't normalize const stride = 0; // how many bytes to get from one set to the next const offset = 0; // how many bytes inside the buffer to start from gl.bindbuffer(gl.array_buffer, buffers.texturecoord); gl.vertexattribpointer(programinfo.attriblocations.texturecoord, num, type, normalize, stride, offset); gl.enablevertexattribarray(programinfo.attriblocations.texturecoord); } then add code to specify the texture to map onto the faces, just before draw: // tell webgl we want to affect texture unit 0 gl.activetexture(gl.
WebGL best practices - Web APIs
these triangles are effectively skipped, which lets you start a new triangle strip unattached to your previous one, without having to split into multiple draw calls.
... prefer doing uploads before starting drawing, or at least between pipelines: in webgl: ...
WebGL: 2D and 3D graphics for the web - Web APIs
WebAPIWebGL API
a good place to start if you don't have previous webgl experience.
...this is a great place to start if you've never done low-level graphics programming.
WebRTC connectivity - Web APIs
when a user starts a webrtc call to another user, a special description is created called an offer.
... ice restarts for now, see ice restart in lifetime of a webrtc session.
Using WebRTC data channels - Web APIs
let's look at each of these cases, starting with the first, which is the most common.
...while there's no way to control the size of the buffer, you can learn how much data is currently buffered, and you can choose to be notified by an event when the buffer starts to run low on queued data.
Writing a WebSocket server in Java - Web APIs
import java.security.messagedigest; import java.security.nosuchalgorithmexception; import java.util.base64; import java.util.scanner; import java.util.regex.matcher; import java.util.regex.pattern; public class websocket { public static void main(string[] args) throws ioexception, nosuchalgorithmexception { serversocket server = new serversocket(80); try { system.out.println("server has started on 127.0.0.1:80.\r\nwaiting for a connection..."); socket client = server.accept(); system.out.println("a client connected."); socket methods: java.net.socket getinputstream() returns an input stream for this socket.
... outputstream methods: write(byte[] b, int off, int len) writes len bytes from the specified byte array starting at offset off to this output stream.
Web Animations API Concepts - Web APIs
each animation is anchored to a point in the timeline by its starttime, representing the moment along the document’s timeline when the animation starts playing.
... timeline timeline objects provide the useful property currenttime, which lets us see how long the page has been opened for: it's the "current time" of the document's timeline, which started when the page was opened.
Basic concepts behind Web Audio API - Web APIs
audio nodes are linked via their inputs and outputs, forming a chain that starts with one or more sources, goes through one or more nodes, then ends up at a destination.
...conversely, when an mp3 is decoded, it starts off in interleaved format, but is converted to planar for processing.
window.cancelAnimationFrame() - Web APIs
examples var requestanimationframe = window.requestanimationframe || window.mozrequestanimationframe || window.webkitrequestanimationframe || window.msrequestanimationframe; var cancelanimationframe = window.cancelanimationframe || window.mozcancelanimationframe; var start = window.mozanimationstarttime; // only supported in ff.
... var myreq; function step(timestamp) { var progress = timestamp - start; d.style.left = math.min(progress / 10, 200) + 'px'; if (progress < 2000) { // it's important to update the requestid each time you're calling requestanimationframe myreq = requestanimationframe(step); } } myreq = requestanimationframe(step); // the cancelation uses the last requestid cancelanimationframe(myreq); specifications specification status comment html living standardthe definition of 'cancelanimationframe()' in that specification.
WindowOrWorkerGlobalScope.fetch() - Web APIs
the fetch() method of the windoworworkerglobalscope mixin starts the process of fetching a resource from the network, returning a promise which is fulfilled once the response is available.
...starting with chrome 50, this property also takes a federatedcredential instance or a passwordcredential instance.
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
gecko started to treat setinterval() like this in version 56 (it already did this with settimeout(); see below).
... deferral of timeouts during pageload starting in firefox 66, firefox will defer firing settimeout and setinterval timers while the current tab is loading.
Synchronous and asynchronous requests - Web APIs
starting with the third argument, all remaining arguments are collected, assigned to the arguments property of the variable xhr, passed to the success callback function xhrsuccess., and ultimately supplied to the callback function (in this case, showmessage) which is invoked by function xhrsuccess.
... synchronous request note: starting with gecko 30.0 (firefox 30.0 / thunderbird 30.0 / seamonkey 2.27), blink 39.0, and edge 13, synchronous requests on the main thread have been deprecated due to their negative impact on the user experience.
XMLHttpRequest: abort event - Web APIs
bubbles no cancelable 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; ...
...tonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.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);...
XMLHttpRequest: error event - Web APIs
bubbles no cancelable 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 xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.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(); ...
XMLHttpRequest: load event - Web APIs
bubbles no cancelable 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 xhrbutton...
...success = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.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); ...
XMLHttpRequest: loadend event - Web APIs
bubbles no cancelable 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 { widt...
...tonsuccess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.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);...
XMLHttpRequest: progress event - Web APIs
bubbles no cancelable 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 xhrbuttonsuc...
...cess = document.queryselector('.xhr.success'); const xhrbuttonerror = document.queryselector('.xhr.error'); const xhrbuttonabort = document.queryselector('.xhr.abort'); const log = document.queryselector('.event-log'); function handleevent(e) { log.textcontent = log.textcontent + `${e.type}: ${e.loaded} bytes transferred\n`; } function addlisteners(xhr) { xhr.addeventlistener('loadstart', handleevent); xhr.addeventlistener('load', handleevent); xhr.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); x...
XMLHttpRequest - Web APIs
loadstart fired when a request has started to load data.
... also available via the onloadstart property.
XRInputSource - Web APIs
when a squeeze action begins, such as by the user pressing the trigger or tightening their grip, a squeezestart event is sent to the xrsession.
...when a primary action begins, a selectstart event is sent to the xrsession.
XRInputSourceEvent() - Web APIs
selectstart sent to an xrsession when an input source begins its primary action, indicating that the user has begun a command-like input, such as pressing a trigger or button, issuing a spoken command, tapping on a touchpad, or the like.
... squeezestart sent to an xrsession when an input source begins its primary squeeze action, indicating that the user has begun to grab, squeeze, or grip the controller.
XRInputSourceEvent.frame - Web APIs
examples this code shows a handler for the selectstart event which gets the target ray's pose from the frame, mapping the pose representing the ray (event.inputsource.targetrayspace) to the overall reference space myrefspace.
... xrsession.onselectstart = event => { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (targetraypose) { checkandhandlehit(targetraypose.transform); } }; specifications specification status comment webxr device apithe definition of 'xrinputsourceevent.frame' in that specification.
XRInputSourceEvent - Web APIs
selectstart sent to an xrsession when an input source begins its primary action, indicating that the user has begun a command-like input, such as pressing a trigger or button, issuing a spoken command, tapping on a touchpad, or the like.
... squeezestart sent to an xrsession when an input source begins its primary squeeze action, indicating that the user has begun to grab, squeeze, or grip the controller.
XRPermissionDescriptor.optionalFeatures - Web APIs
the user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case.
... xrreferencespace local-floor similar to the local type, except the starting position is placed in a safe location for the viewer to stand, where the value of the y axis is 0 at floor level.
XRPermissionDescriptor - Web APIs
if permission is conditional based on prompting, we call a function promptandsetupxr() that would handle asking for permission before enabling and starting up the environment.
... if the permissions api isn't available at all, this example simply assumes that webxr will report an appropriate error if permission isn't available, and tries to start up the webxr session using the same setupxr() function called by the granted case.
XRPermissionStatus.granted - Web APIs
the user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case.
... xrreferencespace local-floor similar to the local type, except the starting position is placed in a safe location for the viewer to stand, where the value of the y axis is 0 at floor level.
XRReferenceSpace.getOffsetReferenceSpace() - Web APIs
xrsession.requestreferencespace("local") .then((refspace) => { xrreferencespace = refspace; xrreferencespace = xrreferencespace.getoffsetreferencespace( new xrrigidtransform(startposition, {x:0, y:0, z:1.0, w: 1.0})); xrsession.requestanimationframe(drawframe); }); in this code, we obtain a local reference space, then use getoffsetreferencespace() to create a new space whose origin is adjusted to a position given by startposition and whose orientation is looking directly along the z azis.
...in particular, check out the section called starting the webxr session.
XRReferenceSpace: reset event - Web APIs
the user is in an unbounded reference space and has moved far enough from the starting position (the reference space's origin) that floating-point or other forms of error or drift are problematic.
... manual resets if you've spent any time using a vr headset, you've had times when you've started it up and although you're facing straight ahead, the headset thinks you're looking at the sky or the floor; or times when you point the hand controller straight forward, but it thinks you're pointing it up and to the right somewhere.
XRReferenceSpace - Web APIs
the user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case.
... xrreferencespace local-floor similar to the local type, except the starting position is placed in a safe location for the viewer to stand, where the value of the y axis is 0 at floor level.
XRReferenceSpaceType - Web APIs
the user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case.
... xrreferencespace local-floor similar to the local type, except the starting position is placed in a safe location for the viewer to stand, where the value of the y axis is 0 at floor level.
XRSession.requestAnimationFrame() - Web APIs
if (!xrsession) { renderframe(time, null) } } // the window animation loop can be started immediately upon the page loading.
...function startxrsession() { navigator.xr.requestsession('immersive-vr').then((session) => { xrsession = session xrsession.addeventlistener('end', onxrsessionended) // do necessary session setup here.
XRSession.requestReferenceSpace() - Web APIs
the user isn't expected to move much if at all beyond their starting position, and tracking is optimized for this use case.
... xrreferencespace local-floor similar to the local type, except the starting position is placed in a safe location for the viewer to stand, where the value of the y axis is 0 at floor level.
XRSession: squeeze event - Web APIs
bubbles yes cancelable no interface xrinputsourceevent event handler property onsqueeze for details on how the squeezestart, squeeze, and squeezeend events work, and how you should react to them, see primary squeeze actions in inputs and input sources.
...if you need to track a squeeze action that isn't instantaneous, listen for the squeezestart and squeezeend events to sense when the squeeze action begins and ends.
XSL Transformations in Mozilla FAQ - Web APIs
note: starting in gecko 7.0, both text/xsl and application/xslt+xml are supported mime types for xslt media stylesheets.
... there is transformtodocument and transformtofragment starting with mozilla 1.2 final, see using the mozilla javascript interface to xsl transformations.
ARIA: document role - Accessibility
tabindex="0" used to make it focusable so the assistive technology user can tab to it and start reading right away.
...however, when the keyboard focus is set on the starting heading on a single conversation that contains the subject of the conversation, the screen reader user can use the reading mode commands to read through the messages, expand or collapse them, and manipulate them.
ARIA: tab role - Accessibility
we start by setting the tabindex of the current tab element to -1, making it no longer tabbable.
...ach(tab => { tab.addeventlistener("click", changetabs); }); // enable arrow navigation between tabs in the tab list let tabfocus = 0; tablist.addeventlistener("keydown", e => { // move right if (e.keycode === 39 || e.keycode === 37) { tabs[tabfocus].setattribute("tabindex", -1); if (e.keycode === 39) { tabfocus++; // if we're at the end, go to the start if (tabfocus >= tabs.length) { tabfocus = 0; } // move left } else if (e.keycode === 37) { tabfocus--; // if we're at the start, move to the end if (tabfocus < 0) { tabfocus = tabs.length - 1; } } tabs[tabfocus].setattribute("tabindex", 0); tabs[tabfocus].focus(); } }); }); function changet...
WAI-ARIA Roles - Accessibility
screen readers will instantly start reading out the updated content when the role is added.
...aria: timer rolethe timer role indicates to assistive technologies that an element is a numerical counter the amount of elapsed time from a starting point or the remaining time until an end point.
Cognitive accessibility - Accessibility
if moving, blinking, scrolling, or auto-updating information starts automatically, lasts more than five seconds, and is presented in parallel with other content, the user must able to pause, stop, hide or control it, unless it's an essential functionality.
... provide instructions for user input start the form with text instructions on how to operate it.
Accessibility documentation index - Accessibility
screen readers will instantly start reading out the updated content when the role is added.
... 77 aria: timer role aria, aria role, aria widget, reference, role timer the timer role indicates to assistive technologies that an element is a numerical counter the amount of elapsed time from a starting point or the remaining time until an end point.
Text labels and names - Accessibility
do not rely on placeholder text, because it disappears as soon as the user starts typing.
...this includes svg images, <img>, <canvas>, <map>, and <area> elements, as well as <input> elements where type=image and <object> elements where the type starts with image/.
:nth-child() - CSS: Cascading Style Sheets
functional notation <an+b> represents elements in a list whose indices match those found in a custom pattern of numbers, defined by an+b, where: a is an integer step size, b is an integer offset, n is all positive integers, starting from 0.
...the first one to be returned as a result of the formula is 0 [=5x0], resulting in a no-match, since the elements are indexed from 1, whereas n starts from 0.
:nth-last-child() - CSS: Cascading Style Sheets
(since n starts at zero, while the last element begins at one, n and n+1 will both select the same elements.) p:nth-last-child(1) or p:nth-last-child(0n+1) represents every <p> that is the first element among a group of siblings, counting from the end.
... <td>first line</td> </tr> <tr> <td>second line</td> </tr> <tr> <td>third line</td> </tr> <tr> <td>fourth line</td> </tr> <tr> <td>fifth line</td> </tr> </tbody> </table> css table { border: 1px solid blue; } /* selects the last three elements */ tr:nth-last-child(-n+3) { background-color: pink; } /* selects every element starting from the second to last item */ tr:nth-last-child(n+2) { color: blue; } /* select only the last second element */ tr:nth-last-child(2) { font-weight: 600; } result quantity query a quantity query styles elements depending on how many of them there are.
@document - CSS: Cascading Style Sheets
WebCSS@document
url-prefix(), which matches if the document url starts with the value provided.
...("http://www.w3.org/style/"), domain("mozilla.org"), media-document("video"), regexp("https:.*") { /* css rules here apply to: - the page "http://www.w3.org/" - any page whose url begins with "http://www.w3.org/style/" - any page whose url's host is "mozilla.org" or ends with ".mozilla.org" - any standalone video - any page whose url starts with "https:" */ /* make the above-mentioned pages really ugly */ body { color: purple; background: yellow; } } specifications initially in css conditional rules module level 3, @document has been postponed to level 4.
CSS Animations tips and tricks - CSS: Cascading Style Sheets
note that because of this, the box doesn't start with any animation effects in place, so it won't be animating.
...this callback adds the "changing" class back onto the box, so that the repaint will start the animation once again.
Box alignment for block, absolutely positioned and table layout - CSS: Cascading Style Sheets
the normal keyword resolves to stretch, unless the positioned item is a replaced element, in which case it resolves to start.
...the normal keyword resolves to stretch, unless the positioned item is a replaced element, in which case it resolves to start.
Box alignment in Flexbox - CSS: Cascading Style Sheets
on the cross axis align-self makes sense as we potentially have additional space in the flex container in that dimension, in which a single item can be moved to the start and end.
... by setting a margin of auto on one item in a set of flex items all aligned to start, we can create a split navigation.
Handling content breaks in multicol - CSS: Cascading Style Sheets
the widows property controls the number left on their own at the start of a fragment.
... the orphans and widows properties take an integer as a value, which represents the number of lines to keep together at the end and start of a fragment, respectively.
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
flex item sizing in order to work out how much space there is available to lay out flex items, the browser needs to know how big the item is to start with.
...our bigger item ends up bigger because it started from a bigger size, even though it has the same amount of spare space assigned to it as the others: if what you actually want is three equally-sized items, even if they start out at different sizes, you should use this: flex: 1 1 0; here we are saying that the size of the item for the purposes of our space distribution calculation is 0 — all the space is up for grabs and as all of the it...
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
the box alignment module for many people the first reason they start to look at flexbox is because of the ability to properly align flex items inside a flex container.
... these properties started life in the flexbox specification, but are now also part of the box alignment specification.
Block and inline layout in normal flow - CSS: Cascading Style Sheets
each will start against the start edge of the containing block, so the place at which sentences would begin in that writing mode.
...by understanding how normal flow works you will find layout easier, as you understand the starting point for making changes to how elements are displayed.
Flow Layout and Writing Modes - CSS: Cascading Style Sheets
this defines the start and end of the inline direction.
... the start is where sentences start and the end is where a line of text ends before it would begin to wrap onto a new line.
Subgrid - CSS: Cascading Style Sheets
note that line numbering restarts inside the subgrid — column line 1, when inside the subgrid, is the first line of the subgrid.
...in the below example i have named lines on the parent col-start and col-end and then used those to place the subitem.
Shorthand properties - CSS: Cascading Style Sheets
the 3-value syntax: border-width: 1em 2em 3em — the first value represents the top edge, the second, the horizontal, that is left and right, ones, and the third value the bottom edge the 4-value syntax: border-width: 1em 2em 3em 4em — the four values represent the top, right, bottom and left edges respectively, always in that order, that is clock-wise starting at the top (the initial letter of top-right-bottom-left matches the order of the consonant of the word trouble: trbl) (you can also remember it as the order that the hands would rotate on a clock: 1em starts in the 12 o'clock position, then 2em in the 3 o'clock position, then 3em in the 6 o'clock position, and 4em in the 9 o'clock position).
...tax: border-radius: 1em 2em 3em — the first value represents the top left corner, the second the top right and bottom left ones, and the third value the bottom right corner the 4-value syntax: border-radius: 1em 2em 3em 4em — the four values represent the top left, top right, bottom right and bottom left corners respectively, always in that order, that is clock-wise starting at the top left.
background-position - CSS: Cascading Style Sheets
ample one</div> <div class="exampletwo">example two</div> <div class="examplethree">example three</div> css /* shared among all <div>s */ div { background-color: #ffee99; background-repeat: no-repeat; width: 300px; height: 80px; margin-bottom: 12px; } /* these examples use the `background` shorthand property */ .exampleone { background: url("https://mdn.mozillademos.org/files/11987/startransparent.gif") #ffee99 2.5cm bottom no-repeat; } .exampletwo { background: url("https://mdn.mozillademos.org/files/11987/startransparent.gif") #ffee99 left 4em bottom 1em no-repeat; } /* multiple background images: each image is matched with the corresponding position, from first specified to last.
... */ .examplethree { background-image: url("https://mdn.mozillademos.org/files/11987/startransparent.gif"), url("https://mdn.mozillademos.org/files/7693/catfront.png"); background-position: 0px 0px, right 3em bottom 2em; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'background-position' in that specification.
border-block - CSS: Cascading Style Sheets
border-block: 1px; border-block: 2px dotted; border-block: medium dashed blue; border-block can be used to set the values for one or more of border-block-width, border-block-style, and border-block-color setting both the start and end in the block dimension at once.
... the borders in the other dimension can be set with border-inline, which sets border-inline-start, and border-inline-end.
box-direction - CSS: Cascading Style Sheets
values normal the box lays out its contents from the start (the left or top edge).
... notes the edge of the box designated the start for layout purposes depends on the box's orientation: horizontal left vertical top the edge opposite to the start is designated the end.
<color> - CSS: Cascading Style Sheets
-moz-win-accentcolor used to access the windows 10 custom accent color that you can set on the start menu, taskbar, title bars, etc.
... -moz-win-accentcolortext used to access the color of text placed over the windows 10 custom accent color in the start menu, taskbar, title bars, etc.
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
however, if you want to contain floats and margins but continue using block and inline layout, you can create a new flow root, and start over with block and inline layout.
... can i start to use the two-value syntax?
hanging-punctuation - CSS: Cascading Style Sheets
the hanging-punctuation css property specifies whether a punctuation mark should hang at the start or end of a line of text.
... first an opening bracket or quote at the start of the first formatted line of an element hangs.
ident - CSS: Cascading Style Sheets
WebCSSident
d numbers ground-level a mix of alphanumeric characters and a dash -test a dash followed by alphanumeric characters --toto a custom-property like identifier _internal an underscore followed by alphanumeric characters \22 toto a unicode character followed by a sequence of alphanumeric characters bili\.bob a correctly escaped period invalid identifiers 34rem it must not start with a decimal digit.
... -12rad it must not start with a dash followed by a decimal digit.
offset-path - CSS: Cascading Style Sheets
0%); offset-path: polygon(30% 0%, 70% 0%, 100% 50%, 30% 100%, 0% 70%, 0% 30%); offset-path: path('m 0,200 q 200,200 260,80 q 290,20 400,0 q 300,100 400,200'); /* geometry boxes */ offset-path: margin-box; offset-path: stroke-box; /* global values */ offset-path: inherit; offset-path: initial; offset-path: unset; values ray() taking up to three values, defines a path that is a line segment starting from the position of the box and proceeds in the direction defined by the specified angle similar to the css gradient angle where 0deg is up, with positive angles increasing in the clockwise direction, with the size value being similar to the css radial gradient size values from closest-side to farthest-corner, and the keyterm contain.
... svg the top and bottom halves of the scissors would appear in the top left of the canvas were they not positioned along the starting point of the motion path defined by offset-path.
overflow-block - CSS: Cascading Style Sheets
the overflow-block css property sets what shows when content overflows the block start and block end edges of a box.
... values visible content is not clipped and may be rendered outside the padding box's block start and block end edges.
overflow-inline - CSS: Cascading Style Sheets
the overflow-inline css property sets what shows when content overflows the inline start and end edges of a box.
... values visible content is not clipped and may be rendered outside the padding box's inline start and end edges.
overflow-x - CSS: Cascading Style Sheets
the box is not a scroll container, and does not start a new formatting context.
... if you wish to start a new formatting context, you can use display: flow-root to do so.
overflow-y - CSS: Cascading Style Sheets
the box is not a scroll container, and does not start a new formatting context.
... if you wish to start a new formatting context, you can use display: flow-root to do so.
overflow - CSS: Cascading Style Sheets
WebCSSoverflow
the box is not a scroll container, and does not start a new formatting context.
... if you wish to start a new formatting context, you can use display: flow-root to do so.
overscroll-behavior - CSS: Cascading Style Sheets
you may also have noticed that when you have a dialog box with scrolling content on top of a page of scrolling content, once the dialog box's scroll boundary is reached, the underlying page will then start to scroll — this is called scroll chaining.
... both of these areas scroll; normally if you scrolled the chat window until you hit a scroll boundary, the underlying contacts window would start to scroll too, which is not desirable.
padding-inline - CSS: Cascading Style Sheets
the padding-inline css shorthand property defines the logical inline start and end padding of an element, which maps to physical padding properties depending on the element's writing mode, directionality, and text orientation.
... /* <length> values */ padding-inline: 10px 20px; /* an absolute length */ padding-inline: 1em 2em; /* relative to the text size */ padding-inline: 10px; /* sets both start and end values */ /* <percentage> values */ padding-inline: 5% 2%; /* relative to the nearest block container's width */ /* global values */ padding-inline: inherit; padding-inline: initial; padding-inline: unset; constituent properties this property is a shorthand for the following css properties: padding-inline-end padding-inline-start syntax values the padding-inline property takes the same values as the padding-left property.
repeat() - CSS: Cascading Style Sheets
WebCSSrepeat
/* <track-repeat> values */ repeat(4, 1fr) repeat(4, [col-start] 250px [col-end]) repeat(4, [col-start] 60% [col-end]) repeat(4, [col-start] 1fr [col-end]) repeat(4, [col-start] min-content [col-end]) repeat(4, [col-start] max-content [col-end]) repeat(4, [col-start] auto [col-end]) repeat(4, [col-start] minmax(100px, 1fr) [col-end]) repeat(4, [col-start] fit-content(200px) [col-end]) repeat(4, 10px [col-start] 30% [col-middle] auto [col-end]) repeat(4, [col-start] min-content [col-middle] max-content [col-e...
...nd]) /* <auto-repeat> values */ repeat(auto-fill, 250px) repeat(auto-fit, 250px) repeat(auto-fill, [col-start] 250px [col-end]) repeat(auto-fit, [col-start] 250px [col-end]) repeat(auto-fill, [col-start] minmax(100px, 1fr) [col-end]) repeat(auto-fill, 10px [col-start] 30% [col-middle] 400px [col-end]) /* <fixed-repeat> values */ repeat(4, 250px) repeat(4, [col-start] 250px [col-end]) repeat(4, [col-start] 60% [col-end]) repeat(4, [col-start] minmax(100px, 1fr) [col-end]) repeat(4, [col-start] fit-content(200px) [col-end]) repeat(4, 10px [col-start] 30% [col-middle] 400px [col-end]) syntax values <length> a positive integer length.
repeating-radial-gradient() - CSS: Cascading Style Sheets
thus, the position of each ending color stop coincides with a starting color stop; if the color values are different, this will result in a sharp visual transition, which can be mitigated by repeating the first color as the last color.
... syntax /* a gradient at the center of its container, starting red, changing to blue, and finishing green, with the colors repeating every 30px */ repeating-radial-gradient(circle at center, red 0, blue, green 30px); /* an elliptical gradient near the top left of its container, starting red, changing to green and back again, repeating five times between the center and the bottom right corner, and only once between the center and the top left ...
ruby-align - CSS: Cascading Style Sheets
/* keyword values */ ruby-align: start; ruby-align: center; ruby-align: space-between; ruby-align: space-around; /* global values */ ruby-align: inherit; ruby-align: initial; ruby-align: unset; syntax values start is a keyword indicating that the ruby will be aligned with the start of the base text.
... formal definition initial valuespace-aroundapplies toruby bases, ruby annotations, ruby base containers, ruby annotation containersinheritedyescomputed valueas specifiedanimation typediscrete formal syntax start | center | space-between | space-around examples ruby aligned at the start of the base text html <ruby> <rb>this is a long text to check</rb> <rp>(</rp><rt>short ruby</rt><rp>)</rp> </ruby> css ruby { ruby-align: start; } result ruby aligned at the center of the base text html <ruby> <rb>this is a long text to check</rb> <rp>(</rp><rt>short ruby</rt><rp>)</rp> </rub...
ruby-position - CSS: Cascading Style Sheets
rt nosafari no support nonotes no support nonotes notes safari implements a non-standard, prefixed, version of ruby-position, -webkit-ruby-position: it has two properties: before and after (both equivalent, for ltr and rtl scripts to the standard over value used with ruby-align: start).webview android no support nochrome android no support nofirefox android full support 38opera android no support nosafari ios no support nonotes no support ...
... nonotes notes safari implements a non-standard, prefixed, version of ruby-position, -webkit-ruby-position: it has two properties: before and after (both equivalent, for ltr and rtl scripts to the standard over value used with ruby-align: start).samsung internet android no support nointer-character experimentalchrome no support noedge no support nofirefox no support noie no support noopera no support nosafari no support nowebview android no s...
scroll-margin-inline - CSS: Cascading Style Sheets
constituent properties this property is a shorthand for the following css properties: scroll-margin-inline-end scroll-margin-inline-start syntax /* <length> values */ scroll-margin-inline: 10px; scroll-margin-inline: 1em .5em ; /* global values */ scroll-margin-inline: inherit; scroll-margin-inline: initial; scroll-margin-inline: unset; values <length> an outset from the corresponding edge of the scroll container.
... note: here we are setting scroll-margin on the start and end of the inline axis (x in our case), but only the end edge is really relevant.
text-transform - CSS: Cascading Style Sheets
the capitalize line in the browser compatibility table contains the version the different engines started to support this now precisely-defined behavior.
... capitalize (dutch ij digraph) <p>initial string <strong lang="nl">the dutch word: "ijsland" starts with a digraph.</strong> </p> <p>text-transform: capitalize <strong><span lang="nl">the dutch word: "ijsland" starts with a digraph.</span></strong> </p> span { text-transform: capitalize; } strong { float: right; } this demonstrates how the dutch ij digraph must be handled like one single letter.
<transform-function> - CSS: Cascading Style Sheets
choose one, and the transform is applied to the cube; after 2 seconds, the cube reverts back to its starting state.
... the cube's starting state is slightly rotated using transform3d(), to allow you to see the effect of all the transforms.
visibility - CSS: Cascading Style Sheets
one of the start or ending values must therefore be visible or no interpolation can happen.
... the value is interpolated as a discrete step, where values of the timing function between 0 and 1 map to visible and other values of the timing function (which occur only at the start/end of the transition or as a result of cubic-bezier() functions with y values outside of [0, 1]) map to the closer endpoint.
Ajax - Developer guides
WebGuideAJAX
getting started an introduction to ajax.
... documentation getting started this article guides you through the ajax basics and gives you two simple hands-on examples to get you started.
Writing Web Audio API code that works in every browser - Developer guides
also, if new methods such as start are not detected in some nodes, the library will also alias them to their old names.
... thus, start is mapped to noteon, stop to noteoff, and so on.
Challenge solutions - Developer guides
this page provides solutions to the challenges posed in the css getting started tutorial.
... following values are reasonable approximations of the named colors: strong { color: #f00; /* red */ background-color: #ddf; /* pale blue */ font: 200% serif; } .carrot { color: #fa0; /* orange */ } .spinach { color: #080; /* dark green */ } p { color: #00f; /* blue */ } content add an image challenge add a one rule to your stylesheet so that it displays the image at the start of each line.
HTML attribute reference - HTML: Hypertext Markup Language
loop <audio>, <bgsound>, <marquee>, <video> indicates whether the media should start playing from the start when it's finished.
... start <ol> defines the first number if other than 1.
Block-level elements - HTML: Hypertext Markup Language
a block-level element always starts on a new line and takes up the full width available (stretches out to the left and right as far as it can).
... default formatting by default, block-level elements begin on new lines, but inline elements can start anywhere in a line.
<h1>–<h6>: The HTML Section Heading elements - HTML: Hypertext Markup Language
tag omission none, both the starting and ending tag are mandatory.
... avoid skipping heading levels: always start from <h1>, next use <h2> and so on.
<a>: The Anchor element - HTML: Hypertext Markup Language
WebHTMLElementa
can be used with or without a value: without a value, the browser will suggest a filename/extension, generated from various sources: the content-disposition http header the final segment in the url path the media type (from the (content-type header, the start of a data: url, or blob.type for a blob: url) defining a value suggests it as the filename.
... tag omission none, both the starting and ending tag are mandatory.
<bdo>: The Bidirectional Text Override element - HTML: Hypertext Markup Language
WebHTMLElementbdo
the text's characters are drawn from the starting point in the given direction; the individual characters' orientation is not affected (so characters don't get drawn backward, for example).
... tag omission none, both the starting and ending tag are mandatory.
<br>: The Line Break element - HTML: Hypertext Markup Language
WebHTMLElementbr
the text after the <br> begins again at the start of the next line of the text block.
... tag omission must have a start tag, and must not have an end tag.
<canvas>: The Graphics Canvas element - HTML: Hypertext Markup Language
WebHTMLElementcanvas
tag omission none, both the starting and ending tag are mandatory.
...</canvas> javascript then in the javascript code, call htmlcanvaselement.getcontext() to get a drawing context and start drawing onto the canvas: const canvas = document.queryselector('canvas'); const ctx = canvas.getcontext('2d'); ctx.fillstyle = 'green'; ctx.fillrect(10, 10, 100, 100); result accessibility concerns alternative content the <canvas> element on its own is just a bitmap and does not provide information about any drawn objects.
<col> - HTML: Hypertext Markup Language
WebHTMLElementcol
tag omission it must have start tag, but must not have an end tag.
... permitted parents <colgroup> only, though it can be implicitly defined as its start tag is not mandatory.
<command>: The HTML Command element - HTML: Hypertext Markup Language
WebHTMLElementcommand
tag omission the start tag is mandatory, but, as it is a void element, the use of an end tag is forbidden.
... permitted parent elements <colgroup> only, though it can be implicitly defined as its start tag is not mandatory.
<del>: The Deleted Text element - HTML: Hypertext Markup Language
WebHTMLElementdel
tag omission none, both the starting and ending tag are mandatory.
... del::before, del::after { clip-path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } del::before { content: " [deletion start] "; } del::after { content: " [deletion end] "; } some people who use screen readers deliberately disable announcing content that creates extra verbosity.
<details>: The Details disclosure element - HTML: Hypertext Markup Language
WebHTMLElementdetails
tag omission none, both the starting and ending tag are mandatory.
... an input device as well as some form of output device is recommended.</p> </details> the result from this html is this: creating an open disclosure box to start the <details> box in its open state, add the boolean open attribute: <details open> <summary>system requirements</summary> <p>requires a computer running an operating system.
<fieldset>: The Field Set element - HTML: Hypertext Markup Language
WebHTMLElementfieldset
if a <legend> is present, it is placed over the block-start border.
... tag omission none, both the starting and ending tag are mandatory.
<img>: The Image Embed element - HTML: Hypertext Markup Language
WebHTMLElementimg
usemap the partial url (starting with #) of an image map associated with the element.
... tag omission must have a start tag and must not have an end tag.
<input type="color"> - HTML: Hypertext Markup Language
WebHTMLElementinputcolor
here we establish some variables, setting up a variable that contains the color we'll set the color well to when we first load up, and then setting up a load handler to do the main startup work once the page is fully loaded.
... var colorwell; var defaultcolor = "#0000ff"; window.addeventlistener("load", startup, false); initialization once the page is loaded, our load event handler, startup(), is called: function startup() { colorwell = document.queryselector("#colorwell"); colorwell.value = defaultcolor; colorwell.addeventlistener("input", updatefirst, false); colorwell.addeventlistener("change", updateall, false); colorwell.select(); } this gets a reference to the color <input> element in a variable called colorwell, then sets the color input's value to the value in defaultcolor.
<input type="password"> - HTML: Hypertext Markup Language
WebHTMLElementinputpassword
value a domstring representing a password, or empty events change and input supported common attributes autocomplete, inputmode, maxlength, minlength, pattern, placeholder, readonly, required, and size idl attributes selectionstart, selectionend, selectiondirection, and value methods select(), setrangetext(), and setselectionrange() value the value attribute contains a domstring whose value is the current contents of the text editing control being used to enter the password.
... html <label for="userpassword">password: </label> <input id="userpassword" type="password" size="12"> <button id="selectall">select all</button> javascript document.getelementbyid("selectall").onclick = function() { document.getelementbyid("userpassword").select(); } result you can also use selectionstart and selectionend to get (or set) what range of characters in the control are currently selected, and selectiondirection to know which direction selection occurred in (or will be extended in, depending on your platform; see its documentation for an explanation).
<ins> - HTML: Hypertext Markup Language
WebHTMLElementins
tag omission none, both the starting and ending tag are mandatory.
... ins::before, ins::after { clip-path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } ins::before { content: " [insertion start] "; } ins::after { content: " [insertion end] "; } some people who use screen readers deliberately disable announcing content that creates extra verbosity.
<link>: The External Resource Link element - HTML: Hypertext Markup Language
WebHTMLElementlink
load = function() { // do something interesting; the sheet has been loaded } mystylesheet.onerror = function() { console.log("an error occurred loading the stylesheet!"); } </script> <link rel="stylesheet" href="mystylesheet.css" id="my-stylesheet"> note: the load event fires once the stylesheet and all of its imported content has been loaded and parsed, and immediately before the styles start being applied to the content.
... tag omission as it is a void element, the start tag must be present and the end tag must not be present permitted parents any element that accepts metadata elements.
<mark>: The Mark Text element - HTML: Hypertext Markup Language
WebHTMLElementmark
tag omission none, both the starting and ending tag are mandatory.
... mark::before, mark::after { clip-path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } mark::before { content: " [highlight start] "; } mark::after { content: " [highlight end] "; } some people who use screen readers deliberately disable announcing content that creates extra verbosity.
<marquee>: The Marquee element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementmarquee
onstart fires when the marquee starts scrolling.
... methods start() starts scrolling of the marquee.
<s> - HTML: Hypertext Markup Language
WebHTMLElements
tag omission none, both the starting and ending tag are mandatory.
... s::before, s::after { clip-path: inset(100%); clip: rect(1px, 1px, 1px, 1px); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px; } s::before { content: " [start of stricken text] "; } s::after { content: " [end of stricken text] "; } some people who use screen readers deliberately disable announcing content that creates extra verbosity.
<template>: The Content Template element - HTML: Hypertext Markup Language
WebHTMLElementtemplate
content categories metadata content, flow content, phrasing content, script-supporting element permitted content no restrictions tag omission none, both the starting and ending tag are mandatory.
... examples first we start with the html portion of the example.
<textarea> - HTML: Hypertext Markup Language
WebHTMLElementtextarea
notice how it disappears when you start typing into the box.
... permitted content text tag omission none, both the starting and ending tag are mandatory.
<time> - HTML: Hypertext Markup Language
WebHTMLElementtime
tag omission none, both the starting and ending tag are mandatory.
...:39 14:54:39.929 a valid local date and time string 2011-11-18t14:54:39.929 2011-11-18 14:54:39.929 a valid global date and time string 2011-11-18t14:54:39.929z 2011-11-18t14:54:39.929-0400 2011-11-18t14:54:39.929-04:00 2011-11-18 14:54:39.929z 2011-11-18 14:54:39.929-0400 2011-11-18 14:54:39.929-04:00 a valid duration string pt4h18m3s examples simple example html <p>the concert starts at <time datetime="2018-07-07t20:00:00">20:00</time>.</p> output datetime example html <p>the concert took place on <time datetime="2001-05-15t19:00">may 15</time>.</p> output specifications specification status comment html living standardthe definition of '<time>' in that specification.
<tt>: The Teletype Text element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementtt
the font-family property is a good place to start.
... tag omission none, both the starting and ending tag are mandatory.
itemtype - HTML: Hypertext Markup Language
for example, musicevent indicates a concert performance, with startdate and location properties specifying the concert's key details.
... in this case, musicevent would be the url used by itemtype, with startdate and location as itemprop's which musicevent defines.
Microdata - HTML: Hypertext Markup Language
this vocabulary defines a standard set of type names and property names, for example, schema.org music event indicates a concert performance, with startdate and location properties to specify the concert's key details.
... in this case, schema.org music event would be the url used by itemtype and startdate and location would be itemprop's that schema.org music event defines.
Using the application cache - HTML: Hypertext Markup Language
safari has a similar "empty cache" setting in its preferences but a browser restart may also be required.
... function onupdateready() { console.log('found new version!'); } window.applicationcache.addeventlistener('updateready', onupdateready); if(window.applicationcache.status === window.applicationcache.updateready) { onupdateready(); } to manually start testing for a new manifest file, you can use window.applicationcache.update().
Evolution of HTTP - HTTP
on august 6th 1991, tim berners-lee's post on the public alt.hypertext newsgroup is now considered as the official start of the world wide web as a public project.
...http/0.9 is extremely simple: requests consist of a single line and start with the only possible method get followed by the path to the resource (not the url as both the protocol, server, and port are unnecessary once connected to the server).
MIME types (IANA media types) - HTTP
as a multipart document format, it consists of different parts, delimited by a boundary (a string starting with a double dash --).
...for example, gif files start with the 47 49 46 38 39 hexadecimal value (gif89), and png files with 89 50 4e 47 (.png).
Browser detection using the user agent - HTTP
start by trying to identify why you want to do it.
... progressive enhancement this design technique involves developing your web site in 'layers', using a bottom-up approach, starting with a simpler layer and improving the capabilities of the site in successive layers, each using more features.
HTTP conditional requests - HTTP
the more flexible one makes use of if-unmodified-since and if-match and the server returns an error if the precondition fails; the client then restarts the download from the beginning: even if this method works, it adds an extra response/request exchange when the document has been changed.
...it is then up to the client to deal with the error: either by notifying the user to start again (this time on the newest version), or by showing the user a diff of both versions, helping them decide which changes they wish to keep.
Content-Range - HTTP
header type response header forbidden header name no cors-safelisted response-header no syntax content-range: <unit> <range-start>-<range-end>/<size> content-range: <unit> <range-start>-<range-end>/* content-range: <unit> */<size> directives <unit> the unit in which ranges are specified.
... <range-start> an integer in the given unit indicating the beginning of the request range.
Range - HTTP
WebHTTPHeadersRange
header type request header forbidden header name no syntax range: <unit>=<range-start>- range: <unit>=<range-start>-<range-end> range: <unit>=<range-start>-<range-end>, <range-start>-<range-end> range: <unit>=<range-start>-<range-end>, <range-start>-<range-end>, <range-start>-<range-end> range: <unit>=-<suffix-length> directives <unit> the unit in which ranges are specified.
... <range-start> an integer in the given unit indicating the beginning of the request range.
Set-Cookie - HTTP
__secure- prefix: cookies names starting with __secure- (dash is part of the prefix) must be set with the secure flag from a secure page (https).
... __host- prefix: cookies with names starting with __host- must be set with the secure flag, must be from a secure page (https), must not have a domain specified (and therefore aren't sent to subdomains) and the path must be /.
Strict-Transport-Security - HTTP
an example scenario you log into a free wifi access point at an airport and start surfing the web, visiting your online banking service to check your balance and pay a couple of bills.
...while the service is hosted by google, all browsers have stated an intent to use (or actually started using) the preload list.
Firefox user agent string reference - HTTP
starting in version 6, users can opt into using a geckoview-based focus for android with a hidden preference: it uses a geckoview ua string to advertise gecko compatibility.
... firefox os version number gecko version number 1.0.1 18.0 1.1 18.1 1.2 26.0 1.3 28.0 1.4 30.0 2.0 32.0 2.1 34.0 2.2 37 2.5 44 it's easy to find the correspondences by looking at the mercurial repository names: repositories starting by mozilla-b2g are the release repositories for firefox os, and have both firefox os and gecko versions in their names.
HTTP Index - HTTP
WebHTTPIndex
207 connect http, reference, request method the http connect method starts two-way communications with the requested resource.
... 220 103 early hints draft, http, informational, needscompattable, needscontent, status code the http 103 early hints information response status code is primarily intended to be used with the link header to allow the user agent to start preloading resources while the server is still preparing a response.
Redirections in HTTP - HTTP
redirect responses have status codes that start with 3, and a location header holding the url to redirect to.
... <head> <meta http-equiv="refresh" content="0; url=https://example.com/"> </head> the content attribute should start with a number indicating how many seconds the browser should wait before redirecting to the given url.
CSS Houdini
as you extend css with houdini, make sure to keep these considerations in mind, and start small before moving on to more ambitious projects.
... start by reading houdini, an introduction — this provides a brief history of houdini and an overview of its many features.
Concurrency model and the event loop - JavaScript
at some point during the event loop, the runtime starts handling the messages on the queue, starting with the oldest one.
... (function() { console.log('this is the start'); settimeout(function cb() { console.log('callback 1: this is a msg from call back'); }); // has a default time value of 0 console.log('this is just a message'); settimeout(function cb1() { console.log('callback 2: this is a msg from call back'); }, 0); console.log('this is the end'); })(); // "this is the start" // "this is just a message" // "this is the end" // "call...
Functions - JavaScript
within a function, you can address the arguments passed to it as follows: arguments[i] where i is the ordinal number of the argument, starting at 0.
... function parameters starting with ecmascript 2015, there are two new kinds of parameters: default parameters and rest parameters.
Loops and iteration - JavaScript
(note that it's possible that number could be zero!) the various loop mechanisms offer different ways to determine the start and end points of the loop.
... break; } } example 2: breaking to a label let x = 0; let z = 0; labelcancelloops: while (true) { console.log('outer loops: ' + x); x += 1; z = 1; while (true) { console.log('inner loops: ' + z); z += 1; if (z === 10 && x === 10) { break labelcancelloops; } else if (z === 10) { break; } } } continue statement the continue statement can be used to restart a while, do-while, for, or label statement.
Numbers and dates - JavaScript
decimal numbers 1234567890 42 // caution when using leading zeros: 0888 // 888 parsed as decimal 0777 // parsed as octal in non-strict mode (511 in decimal) note that decimal literals can start with a zero (0) followed by another decimal digit, but if every digit after the leading 0 is smaller than 8, the number gets parsed as an octal number.
...if the digits after 0x are outside the range (0123456789abcdef), the following syntaxerror is thrown: "identifier starts immediately after numeric literal".
Text formatting - JavaScript
startswith, endswith, includes returns whether or not the string starts, ends or contains a specified string.
... substring, substr return the specified subset of the string, either by specifying the start and end indexes or the start index and a length.
Working with objects - JavaScript
however, any property name that is not a valid javascript identifier (for example, a property name that has a space or a hyphen, or that starts with a number) can only be accessed using the square bracket notation.
...(var i in obj) { // obj.hasownproperty() is used to filter out properties from the object's prototype chain if (obj.hasownproperty(i)) { result += `${objname}.${i} = ${obj[i]}\n`; } } return result; } so, the function call showprops(mycar, "mycar") would return the following: mycar.make = ford mycar.model = mustang mycar.year = 1969 enumerate the properties of an object starting with ecmascript 5, there are three native ways to list/traverse object properties: for...in loops this method traverses all enumerable properties of an object and its prototype chain.
Memory Management - JavaScript
periodically, the garbage collector will start from these roots, find all objects that are referenced from these roots, then all objects referenced from these, etc.
... starting from the roots, the garbage collector will thus find all reachable objects and collect all non-reachable objects.
JavaScript error reference - JavaScript
together, these two properties provide a starting point toward understanding and resolving the error.
...use //# insteadsyntaxerror: a declaration in the head of a for-of loop can't have an initializersyntaxerror: applying the "delete" operator to an unqualified name is deprecatedsyntaxerror: for-in loop head declarations may not have initializerssyntaxerror: function statement requires a namesyntaxerror: identifier starts immediately after numeric literalsyntaxerror: illegal charactersyntaxerror: invalid regular expression flag "x"syntaxerror: missing ) after argument listsyntaxerror: missing ) after conditionsyntaxerror: missing : after property idsyntaxerror: missing ; before statementsyntaxerror: missing = in const declarationsyntaxerror: missing ] after element listsyntaxerror: missing formal parametersyntaxe...
Array.prototype.lastIndexOf() - JavaScript
the array is searched backwards, starting at fromindex.
... fromindex optional the index at which to start searching backwards.
Array - JavaScript
= fruits.splice(pos, 1) // this is how to remove an item // ["strawberry", "mango"] remove items from an index position let vegetables = ['cabbage', 'turnip', 'radish', 'carrot'] console.log(vegetables) // ["cabbage", "turnip", "radish", "carrot"] let pos = 1 let n = 2 let removeditems = vegetables.splice(pos, n) // this is how to remove items, n defines the number of items to be removed, // starting at the index position specified by pos and progressing toward the end of array.
... array.prototype.fill() fills all the elements of an array from a start index to an end index with a static value.
DataView.prototype.getBigInt64() - JavaScript
the getbigint64() method gets a signed 64-bit integer (long long) at the specified byte offset from the start of the dataview.
... syntax dataview.getbigint64(byteoffset [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to read the data from.
DataView.prototype.getBigUint64() - JavaScript
the getbiguint64() method gets an unsigned 64-bit integer (unsigned long long) at the specified byte offset from the start of the dataview.
... syntax dataview.getbiguint64(byteoffset [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to read the data from.
DataView.prototype.getFloat32() - JavaScript
the getfloat32() method gets a signed 32-bit float (float) at the specified byte offset from the start of the dataview.
... syntax dataview.getfloat32(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data.
DataView.prototype.getFloat64() - JavaScript
the getfloat64() method gets a signed 64-bit float (double) at the specified byte offset from the start of the dataview.
... syntax dataview.getfloat64(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data.
DataView.prototype.getInt16() - JavaScript
the getint16() method gets a signed 16-bit integer (short) at the specified byte offset from the start of the dataview.
... syntax dataview.getint16(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data.
DataView.prototype.getInt32() - JavaScript
the getint32() method gets a signed 32-bit integer (long) at the specified byte offset from the start of the dataview.
... syntax dataview.getint32(byteoffset [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view where to read the data.
DataView.prototype.getInt8() - JavaScript
the getint8() method gets a signed 8-bit integer (byte) at the specified byte offset from the start of the dataview.
... syntax dataview.getint8(byteoffset) parameters byteoffset the offset, in byte, from the start of the view where to read the data.
DataView.prototype.getUint16() - JavaScript
the getuint16() method gets an unsigned 16-bit integer (unsigned short) at the specified byte offset from the start of the dataview.
... syntax dataview.getuint16(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data.
DataView.prototype.getUint32() - JavaScript
the getuint32() method gets an unsigned 32-bit integer (unsigned long) at the specified byte offset from the start of the dataview.
... syntax dataview.getuint32(byteoffset [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to read the data.
DataView.prototype.getUint8() - JavaScript
the getuint8() method gets an unsigned 8-bit integer (unsigned byte) at the specified byte offset from the start of the dataview.
... syntax dataview.getuint8(byteoffset) parameters byteoffset the offset, in byte, from the start of the view where to read the data.
DataView.prototype.setBigInt64() - JavaScript
the setbigint64() method stores a signed 64-bit integer (long long) value at the specified byte offset from the start of the dataview.
... syntax dataview.setbigint64(byteoffset, value [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to store the data from.
DataView.prototype.setBigUint64() - JavaScript
the setbiguint64() method stores an unsigned 64-bit integer (unsigned long long) value at the specified byte offset from the start of the dataview.
... syntax dataview.setbiguint64(byteoffset, value [, littleendian]) parameters byteoffset the offset, in bytes, from the start of the view to store the data from.
DataView.prototype.setFloat32() - JavaScript
the setfloat32() method stores a signed 32-bit float (float) value at the specified byte offset from the start of the dataview.
... syntax dataview.setfloat32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
DataView.prototype.setFloat64() - JavaScript
the setfloat64() method stores a signed 64-bit float (double) value at the specified byte offset from the start of the dataview.
... syntax dataview.setfloat64(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
DataView.prototype.setInt16() - JavaScript
the setint16() method stores a signed 16-bit integer (short) value at the specified byte offset from the start of the dataview.
... syntax dataview.setint16(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
DataView.prototype.setInt32() - JavaScript
the setint32() method stores a signed 32-bit integer (long) value at the specified byte offset from the start of the dataview.
... syntax dataview.setint32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
DataView.prototype.setInt8() - JavaScript
the setint8() method stores a signed 8-bit integer (byte) value at the specified byte offset from the start of the dataview.
... syntax dataview.setint8(byteoffset, value) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
DataView.prototype.setUint16() - JavaScript
the setuint16() method stores an unsigned 16-bit integer (unsigned short) value at the specified byte offset from the start of the dataview.
... syntax dataview.setuint16(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
DataView.prototype.setUint32() - JavaScript
the setuint32() method stores an unsigned 32-bit integer (unsigned long) value at the specified byte offset from the start of the dataview.
... syntax dataview.setuint32(byteoffset, value [, littleendian]) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
DataView.prototype.setUint8() - JavaScript
the setuint8() method stores an unsigned 8-bit integer (byte) value at the specified byte offset from the start of the dataview.
... syntax dataview.setuint8(byteoffset, value) parameters byteoffset the offset, in byte, from the start of the view where to store the data.
Date - JavaScript
// using date objects let start = date.now() // the event to time goes here: dosomethingforalongtime() let end = date.now() let elapsed = end - start // elapsed time in milliseconds // using built-in methods let start = new date() // the event to time goes here: dosomethingforalongtime() let end = new date() let elapsed = end.gettime() - start.gettime() // elapsed time in milliseconds // to test a function and get back it...
...s return function printelapsedtime(ftest) { let nstarttime = date.now(), vreturn = ftest(), nendtime = date.now() console.log(`elapsed time: ${ string(nendtime - nstarttime) } milliseconds`) return vreturn } let yourfunctionreturn = printelapsedtime(yourfunction) note: in browsers that support the web performance api's high-resolution time feature, performance.now() can provide more reliable and precise measurements of elapsed time than date.now().
Error.prototype.stack - JavaScript
ack trace example</title> <body> <script> function trace() { try { throw new error('myerror'); } catch(e) { alert(e.stack); } } function b() { trace(); } function a() { b(3, 4, '\n\n', undefined, {}); } a('first call, firstarg'); </script> assuming the above markup is saved as c:\example.html on a windows file system it produces an alert message box with the following text: starting with firefox 30 and later containing the column number: trace@file:///c:/example.html:9:17 b@file:///c:/example.html:16:13 a@file:///c:/example.html:19:13 @file:///c:/example.html:21:9 firefox 14 to firefox 29: trace@file:///c:/example.html:9 b@file:///c:/example.html:16 a@file:///c:/example.html:19 @file:///c:/example.html:21 firefox 13 and earlier would instead produce the following text...
...: error("myerror")@:0 trace()@file:///c:/example.html:9 b(3,4,"\n\n",(void 0),[object object])@file:///c:/example.html:16 a("first call, firstarg")@file:///c:/example.html:19 @file:///c:/example.html:21 stack of eval'ed code starting with firefox 30, the error stack of code in function() and eval() calls, now produces stacks with more detailed information about the line and column numbers inside these calls.
Intl.DateTimeFormat.prototype.formatRangeToParts() - JavaScript
syntax intl.datetimeformat.prototype.formatrangetoparts(startdate, enddate) examples basic formatrangetoparts usage this method receives two dates and returns an array of objects containing the locale-specific tokens representing each part of the formatted date range.
...let date2 = new date(date.utc(2007, 0, 10, 11, 0, 0)); // > 'wed, 10 jan 2007 10:00:00 gmt' // > 'wed, 10 jan 2007 11:00:00 gmt' let fmt = new intl.datetimeformat("en", { hour: 'numeric', minute: 'numeric' }); console.log(fmt.formatrange(date1, date2)); // > '10:00 – 11:00 am' fmt.formatrangetoparts(date1, date2); // return value: // [ // { type: 'hour', value: '10', source: "startrange" }, // { type: 'literal', value: ':', source: "startrange" }, // { type: 'minute', value: '00', source: "startrange" }, // { type: 'literal', value: ' – ', source: "shared" }, // { type: 'hour', value: '11', source: "endrange" }, // { type: 'literal', value: ':', source: "endrange" }, // { type: 'minute', value: '00', source: "endrange" }, // ...
RegExpInstance.lastIndex - JavaScript
the lastindex is a read/write integer property of regular expression instances that specifies the index at which to start the next match.
... if lastindex is equal to or less than the length of the string and if the regular expression matches the empty string, then the regular expression matches input starting from lastindex.
RegExp.prototype.source - JavaScript
empty regular expressions and escaping starting with ecmascript 5, the source property no longer returns an empty string for empty regular expressions.
... new regexp().source; // "(?:)" new regexp('\n').source === '\n'; // true, prior to es5 new regexp('\n').source === '\\n'; // true, starting with es5 specifications specification ecmascript (ecma-262)the definition of 'regexp.prototype.source' in that specification.
SharedArrayBuffer - JavaScript
apis which use sharedarraybuffer objects webglrenderingcontext.bufferdata() webglrenderingcontext.buffersubdata() webgl2renderingcontext.getbuffersubdata() security requirements shared memory and high-resolution timers were effectively disabled at the start of 2018 in light of spectre.
...s from your origin) cross-origin-opener-policy: same-origin cross-origin-embedder-policy: require-corp to check if cross origin isolation has been successful, you can test against the crossoriginisolated property available to window and worker contexts: if (crossoriginisolated) { // post sharedarraybuffer } else { // do something else } see also planned changes to shared memory which is starting to roll out to browsers (firefox 79, for example.) always use the new operator to create a sharedarraybuffer sharedarraybuffer constructors are required to be constructed with a new operator.
TypedArray.prototype.lastIndexOf() - JavaScript
the typed array is searched backwards, starting at fromindex.
...the index at which to start searching backwards.
WeakRef - JavaScript
examples using a weakref object this example starts a counter shown in a dom element, stopping when the element doesn't exist anymore: class counter { constructor(element) { // remember a weak reference to the dom element this.ref = new weakref(element); this.start(); } start() { if (this.timer) { return; } this.count = 0; const tick = () => { // get the element from the weak reference, if it stil...
... } else { // the element doesn't exist anymore console.log("the element is gone."); this.stop(); this.ref = null; } }; tick(); this.timer = setinterval(tick, 1000); } stop() { if (this.timer) { clearinterval(this.timer); this.timer = 0; } } } const counter = new counter(document.getelementbyid("counter")); counter.start(); settimeout(() => { document.getelementbyid("counter").remove(); }, 5000); specifications specification weakrefsthe definition of 'weakref' in that specification.
let - JavaScript
let x = 1; switch(x) { case 0: { let foo; break; } case 1: { let foo; break; } } temporal dead zone unlike variables declared with var, which will start with the value undefined, let variables are not initialized until their definition is evaluated.
...the variable is in a "temporal dead zone" from the start of the block until the initialization is processed.
Codecs used by WebRTC - Web media technologies
if the connection is in the process of starting up, you can use the icegatheringstatechange event to watch for the completion of ice candidate gathering, then fetch the list.
...the code starts by getting a list of all of the rtcpeerconnection's transceivers.
Mapping the width and height attributes of media container elements to their aspect-ratio - Web media technologies
to keep images from breaking out of their containers when the container becomes narrower than the image, developers started using css like the following: img { max-width: 100%; height: auto; } this is really useful for responsive layouts, but unfortunately it causes the jank problem to return — the above css overrides the width and height attribute information, meaning that if the image has not loaded for some reason, its height will be set to 0.
...therefore, once the image is loaded, we start using the intrinsic aspect ratio of the loaded image rather than the aspect ratio from the attributes, so it displays at the correct aspect ratio.
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
notifications let's start with notifications — they can work without push, but are very useful when combined with them.
... let's explore all of these index.js the index.js file starts by registering the service worker: navigator.serviceworker.register('service-worker.js') .then(function(registration) { return registration.pushmanager.getsubscription() .then(async function(subscription) { // registration part }); }) .then(function(subscription) { // subscription part }); it is a little bit more complicated than the service worker we saw in the js13kpwa demo.
Graphic design for responsive sites - Progressive web apps (PWAs)
textual content is not a problem, as text boxes are innately responsive, but the picture starts to get ugly when you start including graphics and complex layouts on your pages — especially when those graphics and layouts need to adapt to different displays!
...most hi res devices apply a default zoom factor to the whole web page so that the content is a bit more legible, but the downside of this is that the images in question start to look pixellated and ugly because they have been zoomed in.
Progressive web apps (PWAs)
it describes the name of the app, the start url, icons, and all of the other details necessary to transform the website into an app-like format.
...we will start with analyzing the js13kpwa application, why it is built that way, and what benefits it brings.pwa developer guidein the articles listed here, you'll find guides about every aspect of development specific to the greation of progressive web applications (pwas).structural overview of progressive web appsin this structural overview, we'll look at the features that make up a standard web application,...
Web technology reference
if you're new to web development, consider starting with our learning area, which is filled with step-by-step tutorials that will guide you from total webdev newbie to at least semi-pro!
... introduction to css | getting started with css | learn css | common css questions | reference javascript — dynamic client-side scripting the javascript programming language is used to add interactivity and other dynamic features to web sites.
SVG Event Attributes - SVG: Scalable Vector Graphics
WebSVGAttributeEvents
event attributes always have their name starting with "on" followed by the name of the event for which they are intended.
... attributes animation event attributes onbegin, onend, onrepeat document event attributes onabort, onerror, onresize, onscroll, onunload document element event attributes oncopy, oncut, onpaste 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, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, ons...
cx - SVG: Scalable Vector Graphics
WebSVGAttributecx
value <length-percentage> default value 0 animatable yes note: starting with svg2 cx, is a geometry property, meaning this attribute can also be used as css property for circles.
... value <length-percentage> default value 0 animatable yes note: starting with svg2 cx, is a geometry property, meaning this attribute can also be used as css property for ellipses.
cy - SVG: Scalable Vector Graphics
WebSVGAttributecy
value <length> | <percentage> default value 0 animatable yes note: starting with svg2, cy is a geometry property meaning this attribute can also be used as a css property for circles.
... value <length> | <percentage> default value 0 animatable yes note: starting with svg2, cy is a geometry property meaning this attribute can also be used as a css property for ellipses.
rx - SVG: Scalable Vector Graphics
WebSVGAttributerx
value <length> | <percentage> | auto default value auto animatable yes note: starting with svg2, rx is a geometry property meaning this attribute can also be used as a css property for ellipses.
... value <length> | <percentage> | auto default value auto animatable yes note: starting with svg2, rx is a geometry property meaning this attribute can also be used as a css property for rects.
ry - SVG: Scalable Vector Graphics
WebSVGAttributery
value <length> | <percentage> | auto default value auto animatable yes note: starting with svg2, ry is a geometry property meaning this attribute can also be used as a css property for ellipses.
... value <length> | <percentage> | auto default value auto animatable yes note: starting with svg2, ry is a geometry property meaning this attribute can also be used as a css property for rects.
textLength - SVG: Scalable Vector Graphics
css .controls { font: 16px "open sans", "arial", sans-serif; } svg let's start with the svg.
...it starts by stashing references to the elements it will need to access, using document.getelementbyid(): const widthslider = document.getelementbyid("widthslider"); const widthdisplay = document.getelementbyid("widthdisplay"); const textelement = document.getelementbyid("hello"); const baselength = math.floor(textelement.textlength.baseval.value); widthslider.value = baselength; widthslider.addeventli...
Content type - SVG: Scalable Vector Graphics
the format of an rgb value in the functional notation is an rgb start-function, followed by a comma-separated list of three numerical values (either three integer values or three percentage values) followed by ")".
... an rgb start-function is the case-insensitive string "rgb(", for example "rgb(" or "rgb(".
<line> - SVG: Scalable Vector Graphics
WebSVGElementline
html,body,svg { height:100% } <svg viewbox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"> <line x1="0" y1="80" x2="100" y2="20" stroke="black" /> <!-- if you do not specify the stroke color the line will not be visible --> </svg> attributes x1 defines the x-axis coordinate of the line starting point.
... value type: <length>|<percentage>|<number> ; default value: 0; animatable: yes y1 defines the y-axis coordinate of the line starting point.
<text> - SVG: Scalable Vector Graphics
WebSVGElementtext
of the text is set with the * * fill property, the color property is for html only */ .rrrrr { font: italic 40px serif; fill: red; } </style> <text x="20" y="35" class="small">my</text> <text x="40" y="35" class="heavy">cat</text> <text x="55" y="55" class="small">is</text> <text x="65" y="55" class="rrrrr">grumpy!</text> </svg> attributes x the x coordinate of the starting point of the text baseline.
... value type: <length>|<percentage> ; default value: 0; animatable: yes y the y coordinate of the starting point of the text baseline.
<tspan> - SVG: Scalable Vector Graphics
WebSVGElementtspan
</text> </svg> attributes x the x coordinate of the starting point of the text baseline.
... value type: <length>|<percentage> ; default value: none; animatable: yes y the y coordinate of the starting point of the text baseline.
SVG 2 support in Mozilla - SVG: Scalable Vector Graphics
ute implementation status unknown kerning property removed implementation status unknown path attribute for <textpath> implemented (bug 1446617) reference basic shapes to <textpath> implementation status unknown side attribute for <textpath> implemented (bug 1446650) render characters for one loop of a single closed path, effected by the startoffset attribute and text-anchor property implementation status unknown <tref> removed implementation status unknown <altglyph>, <altglyphdef>, <altglyphitem> and <glyphref> removed <altglyph>, <altglyphdef> and <altglyphitem> removed (bug 1260032), <glyphref> never really implemented (bug 1302693) svgtextcontentelement.selectsubstring() deprecated implementa...
...3 (firefox 26.0 / thunderbird 26.0 / seamonkey 2.23)) child keyword for <paint> values and marker properties implementation status unknown vector-effect property only none and non-scaling-stroke values are supported (bug 528332 (firefox 15 / thunderbird 15 / seamonkey 2.12), bug 1318208) arcs value for stroke-linejoin not implemented (bug 1239142) auto-start-reverse value for <marker>'s orient attribute implemented (bug 879659) svgpaint removed implementation status unknown fill and stroke taking multiple paints implementation status unknown z-index not implemented (bug 360148 child(<integer>) paint value implementation status unknown display of zero-length subpaths depends on stroke-linecap...
Gradients in SVG - SVG: Scalable Vector Graphics
for instance, this one tells the gradient to start at the color red, change to transparent-black in the middle, and end at the color blue.
..."reflect" causes the gradient to continue on, but reflected in reverse, starting with the color offset at 100% and moving back to the offset at 0%, and then back up again.
Positions - SVG: Scalable Vector Graphics
we start with the svg root element: <svg width="100" height="100"> the above element defines a simple svg canvas with 100x100px.
...these 200x200 pixels display an area that starts at user unit (0,0) and spans 100x100 user units to the right and to the bottom.
SVG and CSS - SVG: Scalable Vector Graphics
copy and paste the content from here, making sure that you scroll to get all of it: <svg width="600px" height="600px" viewbox="-300 -300 600 600" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>svg demonstration</title> <desc>mozilla css getting started - svg demonstration</desc> <defs> <radialgradient id="fade" cx="0" cy="0" r="200" gradientunits="userspaceonuse"> <stop id="fade-stop-1" offset="33%"/> <stop id="fade-stop-2" offset="95%"/> </radialgradient> </defs> <text id="heading" x="-280" y="-270">svg demonstration</text> <text id="caption" x="-280" y="-250">move your mouse pointer over the flower.</t...
... <svg width="600px" height="600px" viewbox="-300 -300 600 600" xmlns="http://www.w3.org/2000/svg"> <title>svg demonstration</title> <desc>mozilla css getting started - svg demonstration</desc> <defs> <g id="segment" class="segment"> <path class="segment-fill" d="m0,0 v-200 a40,40 0 0,0 -62,10 z"/> <path class="segment-edge" d="m0,-200 a40,40 0 0,0 -62,10"/> </g> <g id="quadrant"> <use xlink:href="#segment"/> <use xlink:href="#segment" transform="rotate(18)"/> <use xlink:href="#segment" transform="rotate(36)"/> ...
Texts - SVG: Scalable Vector Graphics
WebSVGTutorialTexts
the attribute text-anchor, which can have the values "start", "middle", "end" or "inherit", decides in which direction the text flows from this point.
... dx start drawing the text with a horizontal offset dx from the default current position.
Subdomain takeovers - Web security
start provisioning by claiming the virtual host; create dns records last.
... start deprovisioning by removing dns records first.
Using templates and slots - Web Components
ck example: <template id="my-paragraph"> <p>my paragraph</p> </template> this won't appear in your page until you grab a reference to it with javascript and then append it to the dom, using something like the following: let template = document.getelementbyid('my-paragraph'); let templatecontent = template.content; document.body.appendchild(templatecontent); although trivial, you can already start to see how this could be useful.
...aragraph"> <style> p { color: white; background-color: #666; padding: 5px; } </style> <p>my paragraph</p> </template> now we can use it by just adding it to our html document: <my-paragraph></my-paragraph> note: templates are well-supported in browsers; the shadow dom api is supported by default in firefox (version 63 onwards), chrome, opera, safari, and edge (starting with version 79).
<xsl:number> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementnumber
the processor starts at the current node and proceeds in reverse document order, stopping if it reaches a match to any from attribute.
... from specifies where the numbering should start or start over.
Compiling a New C/C++ Module to WebAssembly - WebAssembly
prerequisites get the emscripten sdk, using these instructions: https://emscripten.org/docs/getting_started/downloads.html compiling an example with the environment set up, let's look at how to use it to compile a c example to emscripten.
... to start with, save the following code as hello3.c in a new directory: #include <stdio.h> #include <emscripten/emscripten.h> int main(int argc, char ** argv) { printf("hello world\n"); } #ifdef __cplusplus extern "c" { #endif void emscripten_keepalive myfunction(int argc, char ** argv) { printf("myfunction called\n"); } #ifdef __cplusplus } #endif by default, emscripten-generated code al...
Caching compiled WebAssembly modules - WebAssembly
the function starts off by defining some necessary constants: function instantiatecachedurl(dbversion, url, importobject) { const dbname = 'wasm-cache'; const storename = 'wasm-cache'; setting up the database the first helper function contained inside instantiatecachedurl() — opendatabase() — creates an object store for storing wasm modules, and also handles clearing out the database if the dbversion is ...
...we start by trying to open a database, then see if we already have a compiled module with the key url stored in the given db: return opendatabase().then(db => { return lookupindatabase(db).then(module => { if we do, we instantiate it with the given import object: console.log(`found ${url} in wasm cache`); return webassembly.instantiate(module, importobject); }, if not, we compile...
Compiling from Rust to WebAssembly - WebAssembly
this is added automatically, but you must restart your terminal for it to take effect.
...let's give this a shot: $ npm install $ npm run serve this starts a web server.
Using the WebAssembly JavaScript API - WebAssembly
starting soon in firefox, in addition to viewing webassembly as text, developers will be able to debug (place breakpoints, inspect the callstack, single-step, etc.) webassembly using the text format.
... let’s start exploring this by looking at a quick example.
2015 MDN Fellowship Program - Archive of obsolete content
self-starter and autonomous worker mentor information brittany storoz, mozilla apps engineering.
Loading Content Scripts - Archive of obsolete content
it takes one of three possible values: "start" loads the scripts immediately after the document element for the page is inserted into the dom.
self - Archive of obsolete content
on() start listening to messages from the main add-on code: self.on("message", function(addonmessage) { // handle the message }); this takes two parameters: the name of the event, and the handler function.
Contributor's Guide - Archive of obsolete content
getting started learn how to contribute to the add-on sdk.
Module structure of the SDK - Archive of obsolete content
to use sdk modules, you can pass require() a complete path, starting with "sdk", to the module you want to use.
SDK API Lifecycle - Archive of obsolete content
don’t start using it, and plan to migrate away from this module to its replacement.
XUL Migration Guide - Archive of obsolete content
because sdk-based extensions are restartless, they can't use xul overlays.
Guides - Archive of obsolete content
contributor's guide getting started learn how to contribute to the sdk: getting the code, opening/taking a bug, filing a patch, getting reviews, and getting help.
notifications - Archive of obsolete content
if the user's system does not support desktop notifications or if its notifications service is not running: if firefox was started normally, notifications are logged to firefox's error console if the user launched firefox from the command line, notifications are logged to the terminal.
self - Archive of obsolete content
loadreason this property contains of the following strings describing the reason your add-on was loaded: install enable startup upgrade downgrade isprivatebrowsingsupported this property indicates whether or not the add-on supports private browsing.
simple-prefs - Archive of obsolete content
experimental store preferences across application restarts.
console/plain-text - Archive of obsolete content
it's implemented using console.jsm, and is prefixed with the addon's name, and log levels set based off of startup instruction.
content/loader - Archive of obsolete content
this may take one of the following values: "start": load content scripts immediately after the document element for the page is inserted into the dom, but before the dom content itself has been loaded "ready": load content scripts once dom content has been loaded, corresponding to the domcontentloaded event "end": load content scripts once all the content (dom, js, css, images) for the page has been loaded, at the time the window.onload event ...
core/promise - Archive of obsolete content
r a given time ms -- kind of promise based alternative to settimeout: function delay(ms, value) { let { promise, resolve } = defer(); settimeout(resolve, ms, value); return promise; } delay(10, 'hello world').then(console.log); // after 10ms => 'helo world' advanced usage if general defer and promised should be enough to doing almost anything you may think of with promises, but once you start using promises extensively you may discover some missing pieces and this section of documentation may help you to discover them.
event/core - Archive of obsolete content
also see the tutorial on implementing event targets to get started with this api.
event/target - Archive of obsolete content
also see the tutorial on implementing event targets to get started with this api.
system/runtime - Archive of obsolete content
globals properties insafemode this value is true if firefox was started in safe mode, otherwise false.
ui/frame - Archive of obsolete content
events attach this event is emitted whenever a new frame instance is constructed and the browser has started to load its document: for example, when the user opens a new browser window, if that window has a toolbar containing this frame.
util/match-pattern - Archive of obsolete content
the url must start with a scheme, end with a slash, and contain no wildcards.
cfx to jpm - Archive of obsolete content
entry point the add-on's entry point is the file that's executed when the add-on needs to initialize itself: for example, when firefox starts, or when the add-on's installed, enabled, or upgraded.
jpm-mobile - Archive of obsolete content
note that unlike cfx, jpm-mobile is available in every command prompt you start, as long as you installed it with the -g flag.
jpmignore - Archive of obsolete content
here is an example: # ignore .ds_store files created by mac .ds_store # ignore any zip or xpi files *.zip *.xpi # ignore specific directory # you can start patterns with a forward slash (/) to avoid recursivity.
Overview - Archive of obsolete content
getting started let's get started by creating a directory called "annotator".
Creating Event Targets - Archive of obsolete content
this consists of three functions: on(): start listening for events or a given type once(): listen for the next occurrence of a given event, and then stop removelistener(): stop listening for events of a given type the on() and once() exports delegate to the corresponding function from event/core, and use bind() to pass the exports object itself as the target argument to the underlying function.
Display a Popup - Archive of obsolete content
// // set the focus to the text area so the user can // just start typing.
Logging - Archive of obsolete content
the console.log() method prints an informational message: console.log("hello world"); try it out: create a new directory, and navigate to it execute jpm init, accepting all the defaults open "index.js" and add the line above execute jpm run firefox will start, and the following line will appear in the command window you used to execute jpm run: info: hello world!
Troubleshooting - Archive of obsolete content
this page lists some starting points that might help you track down your problem.
Using third-party modules (jpm) - Archive of obsolete content
in your add-on code, you can require() modules by passing a path to the module starting from, but not including "node_modules": var menuitems = require("menuitem"); details create a new directory called, for example, "my-menuitem", navigate to it, type "jpm init" and accept all the defaults: mkdir my-menuitem cd my-menuitem jpm init install the menuitem package from npm: npm install menuitem --save this will install the package in the current directory, under a directory ...
Localization - Archive of obsolete content
the files: use the .properties format are named "xx-yy.properties", where "xx-yy" is the name of the locale in question contain one entry for each string you want to localize, consisting of an identifier for the string and its translation in that locale, in the format identifier=translation need to use utf-8 without bom encoding lines starting with "#" (after optional whitespace) are comments suppose your add-on contains a single localizable string, represented in english as "hello!", and you want to supply us english and french french localizations.
File I/O - Archive of obsolete content
progs d user start menu programs directory (for example, c:\documents and settings\username\start menu\programs).
HTML to DOM - Archive of obsolete content
d of iframe frame.parentnode.removechild(frame); // or set location "about:blank" // frame.contentdocument.location.href = "about:blank"; },10); }, true); } // load a page frame.contentdocument.location.href = "http://www.mozilla.org/"; // or // frame.webnavigation.loaduri("http://www.mozilla.org/",components.interfaces.nsiwebnavigation,null,null,null); if you are starting with an html string, you can convert it to a data uri and use that to load in the browser element.
JavaScript Debugger Service - Archive of obsolete content
(jsdifilter.flag_enabled | jsdifilter.flag_pass) : jsdifilter.flag_enabled, urlpattern: pattern, startline: 0, endline: 0 }; return filter; }, we then add the filters we want.
Post data to window - Archive of obsolete content
most of the time, post data starts as a data string in the form of "name1=data1&name2=data2&...", so you must convert it before passing the data to one of the methods.
Rosetta - Archive of obsolete content
we can show, however, a possible way to start from.
SVG General - Archive of obsolete content
svg template here is a basic markup template to start building an svg document: <svg xmlns="http://www.w3.org/2000/svg"> <!-- svg elements go here --> </svg> note: it is recommended that you do not use dtd's with svg documents.
JavaScript timers - Archive of obsolete content
this timestamp is equal to the number of milliseconds since the navigationstart attribute of the performance.timing interface.
Toolbar - Archive of obsolete content
this should only be done on the first run of your add-on after installation so that if the user decides to remove your button, it doesn't show up again every time they start the application.
Tree - Archive of obsolete content
clicked(event){ var tree = document.getelementbyid("my-tree"); var tbo = tree.treeboxobject; // get the row, col and child element at the point var row = { }, col = { }, child = { }; tbo.getcellat(event.clientx, event.clienty, row, col, child); var celltext = tree.view.getcelltext(row.value, col.value); alert(celltext); } getting the selected indices of a multiselect tree var start = {}, end = {}, numranges = tree.view.selection.getrangecount(), selectedindices = []; for (var t = 0; t < numranges; t++){ tree.view.selection.getrangeat(t, start, end); for (var v = start.value; v <= end.value; v++) selectedindices.push(v); } other resources xul: tree documentation xul tutorial: tree selection ...
Code snippets - Archive of obsolete content
this snippets shows a possible way to start from.
Common Pitfalls - Archive of obsolete content
these are the sort of things that super-review should be catching for code that goes into the tree; avoiding these to start with saves super-reviewers a lot of effort.
Creating custom Firefox extensions with the Mozilla build system - Archive of obsolete content
finally, we define the variable force_static_lib, resulting in a makefile that starts something like this: depth = ../../../../..
Custom about: URLs - Archive of obsolete content
s_error_no_aggregation; } return new this.component(); } register() { cm.registerfactory(this.component.classid, this.component.classdescription, this.component.contractid, this); } unregister() { cm.unregisterfactory(this.component.prototype.classid, this); } } instantiation firefox 4+ now in the startup procedure of your bootstrapped addon make sure to do register the factory, for example: let factory; function startup(adata, areason) { // ...
Displaying web content in an extension without security issues - Archive of obsolete content
so in the simplest case you would have: <iframe type="content" src="data:text/html,%3chtml%3e%3cbody%3e%3c/body%3e%3c/html%3e"/> but usually you don’t want to start with an empty document, you would rather want to load some template into the frame: var request = new xmlhttprequest(); request.open("get", "chrome://foo/content/template.html", false); request.send(null); frame.setattribute("src", "data:text/html," + encodeuricomponent(request.responsetext)); that way you can have the template in your extension but still strip it off all privileges when it is l...
Extension Packaging - Archive of obsolete content
note: starting in gecko 2.0, xpi files are no longer unpacked when extensions are installed.
Migrating raw components to add-ons - Archive of obsolete content
as you'll see, add-ons give you much more flexibility than simply loading a component, but in order to get started, all you'll need is your directory structure and install manifest.
Multiple item extension packaging - Archive of obsolete content
the extension manager will read the install.rdf install manifest to determine if this is a multiple item package and then start the installation of the individual packages it contains automatically.
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
note: to look at the firefox 3 source code, choose "firefox 3" in the starting points list.
Adding windows and dialogs - Archive of obsolete content
never open modal windows at startup.
Introduction - Archive of obsolete content
we'll start with a brief introduction to some key concepts, in case you're not familiar with mozilla and firefox.
The Box Model - Archive of obsolete content
if you're not familiar with css, you should read this css getting started guide and other online resources before continuing with this tutorial.
The Essentials of an Extension - Archive of obsolete content
now we'll look into its files and code, starting with the install.rdf file.
XUL School Tutorial - Archive of obsolete content
introduction introduction getting started with firefox extensions the essentials of an extension setting up a development environment javascript object management basic functionality adding menus and submenus adding toolbars and toolbar buttons adding events and commands adding windows and dialogs adding sidebars user notifications and alerts intermediate functionality intercepting page loads connecting to remote content handling preferences local storage advanced topics the...
Overlay extensions - Archive of obsolete content
this methodology has largely been superseded by restartless extensions, and the add-on sdk, which is built on top of them.
Extensions support in SeaMonkey 2 - Archive of obsolete content
starting with seamonkey 2 alpha 1 seamonkey supports toolkit/-style extensions.
Signing an XPI - Archive of obsolete content
echo started at %date% %time% > %x%\build.log md build\chrome cd chrome zip -r -0 "%x%.jar" * >> %x%\build.log move "%x%.jar" ..\build\chrome >> %x%\build.log cd ..
Creating reusable content with CSS and XBL - Archive of obsolete content
copy and paste the content from here: <!doctype html public "-//w3c//dtd html 4.0//en"> <html> <head> <title>mozilla css getting started - xbl demonstration</title> <link rel="stylesheet" type="text/css" href="style6.css"> </head> <body> <h1>xbl demonstration</h1> <div id="square">click me</div> </body> </html> make a new css file, style6.css.
MozAudioAvailable - Archive of obsolete content
time read only float timestamp for these samples measured from the start in seconds.
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
let's start defining what we mean by inner-browsing.
List of Former Mozilla-Based Applications - Archive of obsolete content
applications that switched to another technology name description additional information angelsoft tools for startups, vcs, and angel investors switched from xulrunner-based client to a web application autodesk maya 3d modeling tool switched off of gecko for help browser in version 8.5 blam feed reader switched to webkit in version 1.8.6 boxee media center software switched to webkit in version 1.0 epiphany browser switched from gecko to webkit flock social browsing ...
No Proxy For configuration - Archive of obsolete content
limitations a domain, including sub-domains domain suffix "mozilla.org" does not block domains that end in the same string (amozilla.org) sub-domains domain suffix, starting with a dot ".mozilla.org" does not block the main domain (mozilla.org) a hostname (without domain) hostname-only (see problems below) "localhost" also blocks any possible domains that start with the entry ("www.otherdomain.localhost") a hostname (with domain) domain name "www.mozilla.org" does not block hostnames or domains that end in the same string ...
Same-origin policy for file: URIs - Archive of obsolete content
starting in gecko 1.9, files are allowed to read only certain other files.
Using content preferences - Archive of obsolete content
starting in gecko 9.0, when in private browsing mode, the content preference service stores preferences in memory instead of on disk, and automatically forgets them when leaving private browsing mode.
Misc top level - Archive of obsolete content
images, tables, and mysterious gapsalmost no matter when you started creating web pages, odds are pretty high you have one or more designs based on the classic "convoluted tables and lots of images" paradigm.
Automated testing tips and tricks - Archive of obsolete content
how to quit the browser on all platforms window.close() of the last open window does not quit the application on mac http://people.mozilla.com/~davel/scripts/ - look at quit.js and quit.xul install manifest file in appdir/chrome to map chrome://tests/content to directory containing quit.js and quit.xul example: content tests file:///users/davel/work/tests/ start app with command line flag -chrome chrome://tests/content/quit.xul how to create a new profile from the command line first, use the -createprofile command line flag to add a profile entry to profiles.ini and populate the new profile directory with a prefs.js file firefox-bin -createprofile "testprofile ${profile_dir}/testprofile" next, start firefox to populate t...
How Mozilla finds its configuration files - Archive of obsolete content
all other files in that directory are dynamically created by mozilla on first start.
Locked config settings - Archive of obsolete content
note that the file must start with //, or else it is not recognized by mozilla.
Protecting Mozilla's registry.dat file - Archive of obsolete content
in summary, you can use the following series of commands in your logon script (usually stored in /home/samba/netlogon/startup.bat on the server): rem ================================================== rem mozilla rem ================================================== attrib -r -s "%userprofile%\application data\mozilla" >nul 2>nul attrib -r -s "%userprofile%\application data\mozilla\registry.dat" >nul 2>nul mkdir "%userprofile%\application data" >nul 2>nul mkdir "%userprofile%\application data\mozilla" >nul 2>nul cop...
Blackwood - Archive of obsolete content
the blackwood project, started by engineers at sun microsystems, is an attempt to better integrate the java platform with the mozilla browser.
Conclusion - Archive of obsolete content
try installing the extension, restarting mozilla, and see if it works.
Finding the file to modify - Archive of obsolete content
in particular, positioning information can be specified in both the structure layer and the style layer, and some behavior can be partly defined in the style layer.) we're going to add code to all three ui layers, starting with the structure layer.
Making it into a static overlay - Archive of obsolete content
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <script type="application/javascript" src="chrome://navigator/content/tinderstatus.js" /> <statusbar id="status-bar"> <statusbarpanel class="statusbarpanel-iconic" id="tinderbox-status" insertbefore="offline-status" status="none"/> </statusbar> </overlay> tinderstatusoverlay.xul starts with an xml processing instruction that identifies the file as xml (all xul files need to include this).
Specifying the appearance - Archive of obsolete content
if you restart mozilla now you should see the "no status" icon appear in the browser's status bar.
Creating a Skin for SeaMonkey 2.x - Archive of obsolete content
contents getting started ...
Creating a Microsummary - Archive of obsolete content
install the extension (restarting firefox to complete installation) then go to the spread firefox home page, find the firefox download count (a large number at the bottom of the right-hand column), context click on the number, and select view xpath from the context menu.
In-Depth - Archive of obsolete content
change: -moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-primary"); to -moz-binding: url("chrome://communicator/skin/toolbar/toolbarbindings.xml#toolbar-primary"); now every toolbar has a spot for an image on the right hand side and we can start adding images, but first we need to make sure we can see the images that we add.
Creating a Skin for Mozilla - Archive of obsolete content
contents getting started setup changing borders and colours changing images creating the install script in-depth system colours mozilla css commands how do i know what to modify?
Dehydra - Archive of obsolete content
documentation installing dehydra download, installation and dependency info for dehydra using dehydra examples for getting started writing analysis scripts.
Developing New Mozilla Features - Archive of obsolete content
learn the codebase and coding practices before you start your feature include learning time in your schedule.
Download Manager improvements in Firefox 3 - Archive of obsolete content
examples monitoring downloads an example showing how to use the new download manager apis to create a download log window that shows all past and present downloads and their status, including the start and end times of the downloads, the download speed, and more.
Embedding FAQ - Archive of obsolete content
faq mozilla.dev.embedding how to start embedding you can find a examples, faqs, and the api from mozilla itself.
Disabling interruptible reflow - Archive of obsolete content
add the following variables to your environment to disable gecko interruptible reflow: gecko_reflow_interrupt_mode=counter gecko_reflow_interrupt_frequency=1000000 gecko_reflow_interrupt_checks_to_skip=1000000 now start firefox within this environment.
Downloading Nightly or Trunk Builds - Archive of obsolete content
anyone can be a tester, you don't need to get approval before you can start testing.
Code snippets - Archive of obsolete content
components.utils.import("resource://services-sync/main.js"); weave.service._freshstart(); // if you want to do it without wiping the server (which will cause corruption!): weave.service.generatenewsymmetrickeys(); print out a list of large bookmark records // change '1000' as appropriate.
Isp Data - Archive of obsolete content
getting started first take a look at the number of examples available: http://infosec.ufl.edu/tbird/gatorlink.xml mailnews/base/ispdata/aol.rdf see the thunderbird isp hooks for more details.
JavaScript crypto - Archive of obsolete content
in the add case, the module will be placed in the nss secmod.db database and will be loaded automatically on application restart.
Java in Firefox Extensions - Archive of obsolete content
see also liveconnect overview https://jdk6.dev.java.net/plugin2/#liveconnect https://jdk6.dev.java.net/plugin2/liveconnect/ http://forums.sun.com/thread.jspa?th...66932&start=15 ...
Enabling Experimental Jetpack Features - Archive of obsolete content
stringmountpathstring that enumerates where, starting from the jetpack base, the feature will be mounted.
Enabling - Archive of obsolete content
stringmountpathstring that enumerates where, starting from the jetpack base, the feature will be mounted.
Menu - Archive of obsolete content
ArchiveMozillaJetpackUIMenu
the api is fairly comprehensive, so you may want to start by reading through some examples.
Enabling Experimental Jetpack Features - Archive of obsolete content
ArchiveMozillaJetpackdocsMetaFuture
stringmountpathstring that enumerates where, starting from the jetpack base, the feature will be mounted.
Jetpack - Archive of obsolete content
get started visit the getting started tutorial download the add-on sdk (formerly called the jetpack sdk) documentation check out the documentation, including tutorials, examples, guides, and api reference join the jetpack community follow jetpack on the mozilla add-ons blog report a bug check out the open bugs discuss jetpack grab the source code join us in #jetpack on irc.mozilla.org ...
Metro browser chrome tests - Archive of obsolete content
each test can have start up and tear down logic, plus the body of the test contained in run().
Microsummary XML grammar reference - Archive of obsolete content
the following example identifies a generator as being able to summarize all pages on the www.example.com web site except pages named about.html: <pages> <include> ^http://www\.example\.com/ </include> <exclude>/about\.html</exclude> </pages> note: regular expressions intended to match the beginnings of page urls should start with the caret (^) to ensure they do not inadvertently match urls which merely contain the urls they intend to match.
Modularization techniques - Archive of obsolete content
an objects reference count generally starts at zero.
LIR - Archive of obsolete content
category op code code name return type featured description miscellaneous 0 start void start of a fragment 1 regfence void a register fence causes no code to be generated, but it affects register allocation so that no registers are live when it is reached.
Plug-n-Hack Get Involved - Archive of obsolete content
while this project has been started by the mozilla security team and has been validated with firefox and owasp zap, this is an open project and we welcome involvement from anyone, especially people working on other browsers and security tools.
Plug-n-Hack Phase1 - Archive of obsolete content
the configuration document should then listen for a number of other events: configuresectoolstarted - this notifies the document that the browser is processing the configuration; if this event is not received within a reasonable amount of time after the configuresectool event has been fired, you might want to warn the user that pnh does not seem to be supported by this browser (perhaps prompting them to install the appropriate addon).
Plugin Architecture - Archive of obsolete content
sequence of events in content a content node for a plugin dom element gets created in bindtotree (usually) or another function, it calls loadobject loadobject either notices directly that it is dealing with a plugin, or it starts a network request and notices this in onstartrequest when it realizes that, it tries to create a frame, if anotify is true and no frame exists yet if a frame exists now, it is asked to instantiate the plugin that was the normal case.
FAQ - Archive of obsolete content
ArchiveMozillaPrismFAQ
it lets users start web applications from their desktop, start menu, and dock, and it opens those applications in their own window separate from a web browser and without the browser interface (back and forward buttons, location bar, etc.).
Scripting - Archive of obsolete content
it can contain the following functions: startup when the app starts, before the user interface is displayed.
RDF Datasource How-To - Archive of obsolete content
starting with the resource that corresponds to the tree element, http://foo.bar.com/, the graph will be traversed and content will be constructed using the pattern specified within the template tags.
Reading textual data - Archive of obsolete content
getservice(components.interfaces.nsiutf8converterservice); var data = utf8converter.converturispectoutf8 (str, "utf-8"); gecko 1.8 and newer reading strings starting with gecko 1.8 (seamonkey 1.0, firefox 1.5), you can use nsiconverterinputstream to read strings from a stream (nsiinputstream).
Remotely debugging Firefox for Metro - Archive of obsolete content
if you're using a version of firefox older than 27, you'll need to restart the browser for the setting to take effect.
Remote debugging - Archive of obsolete content
a good place to start is a detailed stack (in gdb, use bt followed by bt full).
Running Windows Debug Builds Downloaded From Tinderbox - Archive of obsolete content
if you run the windows debug builds you will often get "this application has failed to start because the application configuration is incorrect..." this is because the debug builds need the msvc80 crt debug dlls.
String Quick Reference - Archive of obsolete content
id mymethod(const nsstring& input, nsstring& output); new way: use nsastring& and nsacstring& void mymethod(const nsastring& input, nsastring& output); substrings what: get direct references to string fragments why: avoid making multiple copies of the string old way: use a bunch of nsautostrings, and use left(), right() and mid() to grab a segment of a string: // get an 8-character string starting at the 4th position nsautostring leftside; str.left(leftside, 12); nsautostring middle; leftside.right(middle, 8); new way: use substring() to grab a direct reference to those characters: // get an 8-character string starting at the 4th position const nsastring& middle = substring(str, 4, 8); unicode literals what: use macro tricks to make wide-character literal strings.
String Rosetta Stone - Archive of obsolete content
find a substring nsstring findinreadable(const nsastring& pattern, nsastring::const_iterator start, nsastring::const_iterator end, nsstringcomparator& acomparator = nsdefaultstringcomparator()) std::string size_type find(const basic_string& s, size_type pos = 0) const size_type find(const chart* s, size_type pos, size_type n) const size_type find(const chart* s, size_type pos = 0) const size_type find(chart c, size_type pos = 0) const qstring int qstring::indexof ( const qstring & str, int from = 0, qt::casesensitivity cs = qt::casesensitive ) const format a printf style string nsstring appendprintf() std::string n/a qstring qstring & qstring::sprintf ( const char * cformat, ...
Supporting private browsing mode - Archive of obsolete content
the temporary cookie and local storage databases start out empty.
Table Cellmap - Border Collapse - Archive of obsolete content
if this corner is a start for a horizontal segment, if this corner is a start for a vertical segment, if this corner should be beveled.
Table Layout Regression Tests - Archive of obsolete content
start the layout debugger via mozilla -layoutdebug - p foo where foo is just another profile than your main profile.
Tamarin Acceptance Test Template - Archive of obsolete content
* * ***** end license block ***** */ var section = "test"; // provide a document reference (ie, actionscript section) var version = "as3"; // version of ecmascript or actionscript var title = "test"; // provide ecma section title or a description var bugnumber = ""; starttest(); // leave this alone /** * calls to addtestcase here.
The Download Manager schema - Archive of obsolete content
starttime integer the download's start time.
TraceVis - Archive of obsolete content
building with tracevis these are the steps to build a js shell with tracevis, starting from a mozilla source directory.
Using gdb on wimpy computers - Archive of obsolete content
(gdb) r starting program: /home/blizzard/src/mozilla/mozilla/dist/bin/./mozilla-bin breakpoint 1, main (argc=1, argv=0xbffff894) at nsapprunner.cpp:811 811 installunixsignalhandlers(argv[0]); (gdb) set auto-solib-add 0 (gdb) c continuing.
Using Breakpoints in Venkman - Archive of obsolete content
when you set a breakpoint at line 81, you can start animation on the web page in the browser window and see venkman stop execution as it enters the onflipx function.
Elements - Archive of obsolete content
css: div { -moz-binding: url(mybinding.xml#default); } dom: elementreference.style.mozbinding = "url(mybinding.xml#default)"; in both cases above we are using binding with id="default" contained in file mybinding.xml starting with firefox 3, you can also use a data: url to embed the binding inline: div { -moz-binding: url(data:text/xml;charset=utf-8,%3c%3fxml%20version%3d%221.0%22%3f%3e%0a%3cbindings%20id%3d%22xbltestbindings%22%20xmlns%3d%22http%3a//www.mozilla.org/xbl%22%3e%0a%20%20%3cbinding%20id%3d%22xbltest%22%3e%3ccontent%3epass%3c/content%3e%3c/binding%3e%0a%3c/bindings%3e%0a); } since data: urls don't ...
XML in Mozilla - Archive of obsolete content
we don't use that always, so if you want to avoid doing duplicate work you could start working on bugs that have future milestone, or otherwise have a milestone that is set way into the future.
Examples - Archive of obsolete content
the following samples demonstrate some of the principal installation functions in the xpinstall api: file.macalias file.windowsshortcut [install.]adddirectory [install.]addfile installtrigger.installchrome installtrigger.startsoftwareupdate windows install example ...
confirm - Archive of obsolete content
method of install object syntax int confirm( string atext ); int confirm( string atext, string adialogtitle, number abuttonflags, string abutton0title, string abutton1title, string abutton2title, string acheckmsg, object acheckstate ); parameters the second, extended confirm() method is supported starting with gecko 1.8.
deleteRegisteredFile - Archive of obsolete content
if the file is currently being used, the name of the file that is to be deleted is saved and netscape 6 attempts to delete it each time it starts up until the file is successfully deleted.
execute - Archive of obsolete content
if you do not set this flag and launch an executable that is not a part of the installation, you will raise an error when you restart the browser.
refreshPlugins - Archive of obsolete content
description refreshplugins lets you register new plug-ins without having to restart the browser.
Properties - Archive of obsolete content
startsoftwareupdate("http://webserver/argstest.xpi?argument_string") will result in the value of install.arguments being argument_string #).
Learn XPI Installer Scripting by Example - Archive of obsolete content
verifying the target the first thing the installation script does when it's executed is to check that there is adequate disk space for the software to be installed, where the verifydiskspace function is called as a condition of the main installation block that starts at line 24).
XTech 2006 Presentations - Archive of obsolete content
this talk demonstrates how firefox will incorporate microsummaries into its ui, starting with bookmark labels.
A XUL Bestiary - Archive of obsolete content
in other words, a chrome url like the global pointer above picks up a file called global.css, and the help pointer above could also be written as chrome://help/content, because the name of the package itself is "help." viewing chromes other than mozilla's there is a special flag you can use to start mozilla with some chrome other than the default.
align - Archive of obsolete content
start child elements are aligned starting from the left or top edge of the box.
multiline - Archive of obsolete content
if the user presses enter, a new line is started.
pack - Archive of obsolete content
ArchiveMozillaXULAttributepack
start child elements are placed starting from the left or top edge of the box.
pageid - Archive of obsolete content
the wizard always starts with the wizardpage that appears first in the wizard child list.
panel.flip - Archive of obsolete content
a sliding panel will have the start (or end) position extended such that the panel can be the requested size, meaning the arrow will no longer be at the start (or end) of the panel - i.e., the arrow will appear to have been slid along the panel to ensure the arrow is still pointing at the anchor.
popup.position - Archive of obsolete content
valid single-word values are after_start, after_end, before_start, before_end, end_after, end_before, start_after, start_before, overlap, at_pointer or after_pointer.
preference.name - Archive of obsolete content
for example, the browser's home page is set with the preference browser.startup.homepage.
rel - Archive of obsolete content
ArchiveMozillaXULAttributerel
less the numeric value of the subject must be less than the value greater the numeric value of the subject must be greater than the value before the string value of subject must come before value alphabetically after the string value of subject must come after value alphabetically startswith the value of subject must start with the value endswith the value of subject must end with the value contains the value of subject must contain the value as a substring ...
resizer.dir - Archive of obsolete content
bottomstart resized down and toward the start of the line (toward the left for left-to-right locales, toward the right for right-to-left locales).
width - Archive of obsolete content
<vbox width="30" align="start" style="background-color: red;"> <label value="vbox xul width 10px red"/> </vbox> note: when used on treecol objects, the width attribute can be used to allow a tree to be scrolled horizontally if the column widths add up to be wider than the containing object.
Dynamically modifying XUL-based user interface - Archive of obsolete content
var element = document.getelementbyid("someelement"); while(element.haschildnodes()){ element.removechild(element.firstchild); } inserting menu items to a menu this example adds two new menu items to a <menupopup>: to the start and to the end of it.
XUL Events - Archive of obsolete content
attribute: ondragexit draggesture this event is sent when the user starts dragging the element, usually by holding down the mouse button and moving the mouse.
How to implement a custom XUL query processor component - Archive of obsolete content
tion(adatasources, arootnode, aistrusted, abuilder, ashoulddelaybuilding) { // todo: parse the adatasources variable // for now, ignore everything and let's just signal that we have data return this._data; }, initializeforbuilding: function(adatasource, abuilder, arootnode) { // perform any initialization that can be delayed until the content builder // is ready for us to start }, done: function() { // called when the builder is destroyed to clean up state }, compilequery: function(abuilder, aquery, arefvariable, amembervariable) { // outputs a query object.
getIndexOfItem - Archive of obsolete content
items are numbered starting at the first item displayed in the list.
getNextItem - Archive of obsolete content
« xul reference home getnextitem( startitem, delta ) return type: element this method returns the item a given distance (delta) after the specified startitem, or null if no such item exists.
getPreviousItem - Archive of obsolete content
« xul reference home getpreviousitem( startitem, delta ) return type: element this method returns the item a given distance (delta) before the specified startitem, or null if no such item exists.
openPopup - Archive of obsolete content
position possible values for position are: before_start, before_end, after_start, after_end, start_before, start_after, end_before, end_after, overlap, and after_pointer.
selectItemRange - Archive of obsolete content
« xul reference home selectitemrange( startitem, enditem ) return type: no return value selects the items between the two items given as arguments, including the start and end items.
setSelectionRange - Archive of obsolete content
« xul reference home setselectionrange( start, end ) 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.
Methods - Archive of obsolete content
removecurrenttab removeitemat removeitemfromselection removenotification removeprogresslistener removesession removetab removetabsprogresslistener removetransientnotifications replacegroup reset rewind scrollbyindex scrollbypixels scrolltoindex select selectall selectitem selectitemrange selecttabatindex setselectionrange showpane showpopup sizeto startediting stop stopediting swapdocshells syncsessions timedselect toggleitemselection related dom element methods dom:element.addeventlistener dom:element.appendchild dom:element.comparedocumentposition dom:element.dispatchevent dom:element.getattribute dom:element.getattributenode dom:element.getattributenodens dom:element.getattributens dom:element.getelementsbytagn...
MenuModification - Archive of obsolete content
indicies are counted starting at 0, so to insert an item before the fourth item pass 3 as the argument.
Menus - Archive of obsolete content
setting activechild to null will deactivate all items, and keyboard navigation will start from the top of the menu.
Special per-platform menu considerations - Archive of obsolete content
for instance, the edit menu always starts with the undo command if such a feature is available in the application, followed by redo, cut, copy, paste, and so forth.
name - Archive of obsolete content
ArchiveMozillaXULPropertyname
for example, the browser's home page is set with the preference browser.startup.homepage.
pageid - Archive of obsolete content
the wizard always starts with the wizardpage that appears first in the wizard child list.
Property - Archive of obsolete content
y radiogroup readonly readonly ref resource resultspopup scrollboxobject scrollincrement scrollheight scrollwidth searchbutton searchcount searchlabel searchparam searchsessions second secondleadingzero securityui selected selectedbrowser selectedcount selectedindex selecteditem selecteditems selectedpanel selectedtab selectionend selectionstart selstyle seltype sessioncount sessionhistory showcommentcolumn showpopup size smoothscroll spinbuttons src state statusbar statustext stringbundle strings style subject suppressonselect tabcontainer tabindex tabs tabscrolling tabpanels tag textlength textvalue timeout title toolbarname toolbarset tooltip tooltiptext top treeboxob...
Building Hierarchical Trees - Archive of obsolete content
when the user opens the row, the template will be re-examined for results using the photo as the starting point instead of the top level ref value.
Building Trees - Archive of obsolete content
<rule> <query> <content uri="?start"/> <member container="?start" child="?photo"/> <triple subject="?photo" predicate="http://www.xulplanet.com/rdf/country" object="?country"/> <triple subject="?country" predicate="http://purl.org/dc/elements/1.1/title" object="?countrytitle"/> </query> <action> <treechildren> <treeitem uri="?photo"> <treerow properti...
SQLite Templates - Archive of obsolete content
the action body, starting at the node with uri="?" is repeated for each result returned from the query.
Simple Query Syntax - Archive of obsolete content
at its simplest, the simple query syntax is equivalent to the following: <query> <content uri="?start"/> <member container="?start" child="?photo"/> </query> the template builder uses the simple query syntax whenever a template does not have a <query> element.
Template Builder Interface - Archive of obsolete content
if you do plan on determining the datasources dynamically, it is common to start with an empty datasource using the special uri 'rdf:null'.
Using Multiple Queries to Generate More Results - Archive of obsolete content
<template> <queryset> <query> <content uri="?start"/> <member container="?start" child="?item"/> </query> <rule> <binding subject="?item" predicate="http://purl.org/dc/elements/1.1/title" object="?title"/> <action> <label uri="?item" value="?title" class="header"/> </action> </rule> </queryset> <queryset> <query> <content uri="?start"/> <triple subject="?start" predicate="http://www.
The Joy of XUL - Archive of obsolete content
web developers already familiar with dynamic html (dhtml) will learn xul quickly and can start building applications right away.
Code Samples - Archive of obsolete content
const name = "calendarmainwindow" const uri = "chrome://calendar/content/" * at the time of writing, sunbird's passwords window is broken close the current window to close the window containing the button, possibly leaving other windows open: close() exit the application to exit the application, first closing all its windows: components .classes['@mozilla.org/toolkit/app-startup;1'] .getservice(components.interfaces.nsiappstartup) .quit(components.interfaces.nsiappstartup.eattemptquit) ...
Adding Event Handlers - Archive of obsolete content
pressing the find button should start the search.
Adding Methods to XBL-defined Elements - Archive of obsolete content
note that the less-than symbol has to be escaped because otherwise it would look like the start of a tag.
Advanced Rules - Archive of obsolete content
to do this, use the member element as in the following: <tree id="citiestree" datasources="weather.rdf" ref="http://www.xulplanet.com/rdf/weather/cities"> <template> <rule> <conditions> <content uri="?list"/> <member container="?list" child="?city"/> </conditions> <rule> <template> </tree> the template builder starts by grabbing the value of the ref attribute, which in this case is http://www.xulplanet.com/rdf/weather/cities.
Commands - Archive of obsolete content
mozilla uses the convention that command id's start with 'cmd_'.
Creating a Window - Archive of obsolete content
you can use the command-line parameter '-chrome' to specify the xul file to open when mozilla starts.
Custom Tree Views - Archive of obsolete content
the rows are supplied as numeric values starting at 0.
Features of a Window - Archive of obsolete content
gecko 1.9.2 note starting in gecko 1.9.2 (firefox 3.6), overriding the position of a window using window features will not change the persisted values saved by the session store feature.
Install Scripts - Archive of obsolete content
start the process of installing the necessary files.
Modifying the Default Skin - Archive of obsolete content
see also : creating a skin for firefox and css getting started in the next section, we will look at creating a new skin.
More Wizards - Archive of obsolete content
for example, here are a set of wizard pages (the inner content has been omitted): <wizardpage pageid="type" next="font"> <wizardpage pageid="font" next="done"> <wizardpage pageid="color" next="done"> <wizardpage pageid="done"> the wizard always starts at the first page, which in this case has the page id type.
Splitters - Archive of obsolete content
if you set the minimum width of panel 1 to 50 pixels, you would only be able to drag the splitter 10 pixels to the left (as it starts at 60 pixels wide).
Stacks and Decks - Archive of obsolete content
pages are numbered starting from zero.
Trees and Templates - Archive of obsolete content
like with other templates, the uri attribute on an element indicates where to start generating content.
Using Spacers - Archive of obsolete content
if you change the size of the find files window, you can see that the elements have remained where they started.
XBL Example - Archive of obsolete content
note that one is added to the index because indicies start at 0.
XPCOM Interfaces - Archive of obsolete content
we've seen that interfaces are often named starting with 'nsi' or 'mozi'.
XUL Structure - Archive of obsolete content
however, if you just want to get started building a simple application, you may skip ahead to creating a window and save this section for later.
Using nsIXULAppInfo - Archive of obsolete content
starting with mozilla/xulrunner 1.8, there now is a way to find out which application, application version, and gecko version your code is running on.
Using spell checking in XUL - Archive of obsolete content
spell checking functionality is available starting in firefox 2.
XUL Parser in Python/source - Archive of obsolete content
def strip(snip): t = re.sub('http://.*?\s', '', snip) return t class xulparser(xmllib.xmlparser): def unknown_starttag(self, t, a): name = strip(t) if name not in el_list: el_list[name] = {} for attr,val in a.items(): el_list[name][strip(attr)] = strip(val) def syntax_error(self, message): pass p = xulparser() cmd = 'dir /s /b *.xul' chrome_dir = 'c:\program files\netscape\netscape 6\chrome' os.chdir(chrome_dir) files = os.popen(cmd).readlines() for file in files: file = file.strip() print ...
XUL Reference - Archive of obsolete content
icationbox observes overlay page panel param popupset preference preferences prefpane prefwindow progressmeter query queryset radio radiogroup resizer richlistbox richlistitem row rows rule scale script scrollbar scrollbox scrollcorner separator spacer spinbuttons splitter stack statusbar statusbarpanel stringbundle stringbundleset tab tabbrowser (firefox-only starting with firefox 3/gecko 1.9) tabbox tabpanel tabpanels tabs template textnode textbox textbox (firefox autocomplete) textbox (mozilla autocomplete) timepicker titlebar toolbar toolbarbutton toolbargrippy toolbaritem toolbarpalette toolbarseparator toolbarset toolbarspacer toolbarspring toolbox tooltip tree treecell treechildren treecol treecols treeitem treerow trees...
XML - Archive of obsolete content
when an attribute is assigned a value (e.g., flex="1" or "onload='dointerestingstartupthing()'") that value must be double-quoted.
attribute.align - Archive of obsolete content
parameters start child elements are aligned starting from the left or top edge of the box.
preferences - Archive of obsolete content
lnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata related preferences system documentation: introduction: getting started | examples | troubleshooting reference: prefwindow | prefpane | preferences | preference | xul attributes ...
radiogroup - Archive of obsolete content
items are numbered starting at the first item displayed in the list.
tabbrowser - Archive of obsolete content
note: starting in firefox 3 (xulrunner/gecko 1.9), this is only used in the main firefox window and cannot be used in other xul windows by third-party applications or extensions.
tabs - Archive of obsolete content
ArchiveMozillaXULtabs
items are numbered starting at the first item displayed in the list.
toolbar - Archive of obsolete content
note: starting in gecko 1.9.1, toolbar items are moved from the toolbarpalette and added to the toolbar when a toolbar is first displayed.
where - Archive of obsolete content
ArchiveMozillaXULwhere
less the numeric value of the subject must be less than the value greater the numeric value of the subject must be greater than the value before the string value of subject must come before value alphabetically after the string value of subject must come after value alphabetically startswith the value of subject must start with the value endswith the value of subject must end with the value contains the value of subject must contain the value as a substring subject type: string the variable or string to compare.
XULRunner FAQ - Archive of obsolete content
if you want to help with xulrunner but don't know where to start, visit the xulrunner:community page and ask questions on the newsgroups or the irc channel.
MacFAQ - Archive of obsolete content
commandline support commandline handlers work great on the mac if it's a cold start.
Make your xulrunner app match the system locale - Archive of obsolete content
the code described lives in the pybridge component's onstartup method which gets called automatically.
XUL Application Packaging - Archive of obsolete content
optional - default value is any xulrunner less than xulrunner 2 example: maxversion=1.8.0.* the [xre] section the xre section specifies various features of xulrunner startup that can be enabled enableextensionmanager specifies whether to enable extensions and extension management.
toolkit.defaultChromeFeatures - Archive of obsolete content
see also: xulrunner:specifying startup chrome window, dom:window.open, toolkit.defaultchromeuri, toolkit.singletonwindowtype.
toolkit.defaultChromeURI - Archive of obsolete content
see also: xulrunner:specifying startup chrome window, toolkit.defaultchromefeatures, toolkit.singletonwindowtype.
toolkit.singletonWindowType - Archive of obsolete content
see also: xulrunner:specifying startup chrome window, toolkit.defaultchromefeatures ...
xulauncher - Archive of obsolete content
#!/bin/bash -e # a simple bash script to create a minimal xulrunner dir structure and # needed meta files in /tmp, copy the xul-file over and start it # usage: # xulauncher xulfile.xul [options] ############################################################################## # check if theres atleast one parameter ############################################################################## if [ $# -lt 1 ] then echo "you need to give the xul file as first parameter" exit fi # check if 1st parameter is a file ############################################################################## if [ !
mozilla.dev.platform FAQ - Archive of obsolete content
visual studio express 2005 q: when i try to run xulrunner-stub.exe i get the error "this application failed to start because msvcr80.dll was not found." a: see bug 350616 ...
Mozrunner - Archive of obsolete content
example api usage: from mozrunner import firefoxrunner # start firefox on a new profile runner = firefoxrunner() runner.start() ...
nsIContentPolicy - Archive of obsolete content
this method is called before loading the resource specified by acontentlocation to determine whether or not to start loading the requested resource.
Format - Archive of obsolete content
summary: mozilla.dev.planning - july 17-23, 2006 announcements firefox 2/gecko 1.8.1 bug approvals starting on friday july 21 at 10:00a pdt the release triage team will no longer be accepting bugs unless they meet one of the posted criteria.
Mozilla.dev.apps.firefox-2006-09-29 - Archive of obsolete content
summary: mozilla.dev.apps.firefox - september 22-29, 2006 announcements bon echo 20060921 nightly to recieve "major update" offer mike beltnzer announced that 'users running the bon echo 20060921 nightly build will be offered the chance to upgrade to a "new version"' firefox start up performance boris zbarsky recently performed some profiling of firefox's start up - these are some of the details discussions problem handling dmg files on mac discussion about why sometimes dmg files are not mounted correctly after they are downloaded.
2006-10-06 - Archive of obsolete content
discussions dialogs on app startup discussion regarding improvement of dialog of app window what are tasks?
2006-09-29 - Archive of obsolete content
summary: mozilla.dev.apps.firefox - september 22-29, 2006 announcements bon echo 20060921 nightly to recieve "major update" offer mike beltnzer announced that 'users running the bon echo 20060921 nightly build will be offered the chance to upgrade to a "new version"' firefox start up performance boris zbarsky recently performed some profiling of firefox's start up - these are some of the details discussions problem handling dmg files on mac discussion about why sometimes dmg files are not mounted correctly after they are downloaded.
2006-10-20 - Archive of obsolete content
christopher finke is asking the community members for tutorials or any tips on how to get started.
2006-11-24 - Archive of obsolete content
announcements svg build dependency on cairo gfx on 11/22 november 21st: t rowley announced that: he will be landing his patch that starts the process of switching svg over to thebes (bug 354866).
2006-11-17 - Archive of obsolete content
how to start a localization how to start a localization po format usage discussion on how to make l10n easier due to expansion to 100 locales.
2006-07-17 - Archive of obsolete content
announcements sfirefox 2/gecko 1.8.1 bug approvals starting on friday july 21 at 10:00a pdt the release triage team will no longer be accepting bugs unless they meet one of the posted criteria.
2006-10-20 - Archive of obsolete content
started wed, oct 18 2006 9:38 am - a xulrunner developer, frank, discusses his desire to make xul/browser based applications.
2006-12-01 - Archive of obsolete content
summary: mozilla.dev.platform - november 25th - december 1st, 2006 announcements no announcements this week traffic alex vincent posts that he has started a xulrunner/mac faq here on mozdev.
2006-11-03 - Archive of obsolete content
discussions extended validation certificates major discussion this week started by gervase markham about security certificates, more specifically extended validation certificates.
2006-10-27 - Archive of obsolete content
discussions importing outlook address files a discussion was started to attempt the export of outlook datae from ms outlook.
NPByteRange - Archive of obsolete content
syntax typedef struct _npbyterange { int32 offset; /* negative offset = from the end */ uint32 length; struct _npbyterange* next; } npbyterange; fields the data structure has the following fields: offset offset in bytes to the start of the requested range.
NPEvent - Archive of obsolete content
ticks since start-up.
NPN_Enumerate - Archive of obsolete content
identifiers a pointer to receive a pointer to the start of an array of string identifiers of the names of the properties and methods of npobj.
NPN_GetValue - Archive of obsolete content
gecko 1.9.2 note starting with gecko 1.9.2 (firefox 3.6), the variables npnvservicemanager, npnvdomelement, and npnvdomwindow are no longer supported.
NPP_Write - Archive of obsolete content
buf buffer of data, delivered by the stream, that contains len bytes of data offset bytes from the start of the stream.
The First Install Problem - Archive of obsolete content
unless gecko does a pre-emptive scan upon startup for desirable plugins that are not in the browser's plugins directory first, the best way to solve this problem is to encourage plugin vendors to leave dlls (and xpt files, if applicable) in a location that gecko can discover at runtime.
Writing a plugin for Mac OS X - Archive of obsolete content
getting started if you check out the mozilla source code in mac os x, you can simply open basicplugin.xcodeproj in xcode, click build, and you're done.
XEmbed Extension for Mozilla Plugins - Archive of obsolete content
hosting using gtk2.x included below are a couple of code snippits that should help you get started as well as some hints on building a successful plugin.
Slash - Archive of obsolete content
ArchiveRSSModuleSlash
getting started a guided tutorial that will help you get started with the rss slash module.
Well-Formed Web - Archive of obsolete content
getting started a guided tutorial that will help you get started with the well-formed web rss module.
0.90 - Archive of obsolete content
ArchiveRSSVersion0.90
specification the original rss 0.90 specification has disappeared from its original location: http://my.netscape.com/publish/help/quickstart.html copies of it have been saved, and can be viewed at the following locations: http://www.purplepages.ie/rss/netscape/rss0.90.html http://web.archive.org/web/*/http://...uickstart.html ...
RSS - Archive of obsolete content
getting started a guided tutorial that will help you get started with rss.
Introduction to SSL - Archive of obsolete content
if the client can be successfully authenticated, the server uses its private key to decrypt the premaster secret, then performs a series of steps (which the client also performs, starting from the same premaster secret) to generate the master secret.
Create Your Own Firefox Background Theme - Archive of obsolete content
submitting your theme images to get started submitting your images, go to the theme submission page: name your theme — pick a unique name for your theme.
Creating a Skin for Firefox - Archive of obsolete content
contents getting started original document information author(s): neil marshall and tucker lee other contributors: brent marshall, cdn (http://themes.mozdev.org), jp martin, boris zbarsky, asa dotzler, wesayso, david james, dan mauch, anders conbere, tim regula (http://www.igraphics.nn.cx) copyright information: copyright 2002-2003 neil marshall, permission given to mdc to migrate into the wiki april 2005 via email...
Settings - Archive of obsolete content
show panes on startup when this option is enabled, the debugger's variables pane is visible when you first start the debugger.
Scratchpad - Archive of obsolete content
as an alternative, starting in firefox 71, you can use the multi-line mode of the javascript console input.
Developing cross-browser and cross-platform pages - Archive of obsolete content
") { isns8 = true; alert("netscape 8"); }; } else if (navigator.appversion.indexof("msie") != -1) { isie = true; alert("internet explorer"); }; while this kind of checking in the above code can work in a crude sense, sharp readers may wonder what happens when internet explorer 8 is released or when an opera 8.x user visits the page or even when an user with any non-netscape browser starting with a "8" character in the appversion string visits that page.
Browser Detection and Cross Browser Support - Archive of obsolete content
for rv: 3.12.42, // getgeckorv() returns 3.1242 // for rv:1.9.1.3 it returns 1.090103 // function geckogetrv() { if (navigator.product != 'gecko') { return -1; } var rvvalue = 0; var ua = navigator.useragent.tolowercase(); var rvstart = ua.indexof('rv:'); var rvend = ua.indexof(')', rvstart); var rv = ua.substring(rvstart+3, rvend); var rvparts = rv.split('.'); var exp = 1; for (var i = 0; i < rvparts.length; i++) { var val = parseint(rvparts[i]); rvvalue += val / exp; exp *= 100; } return rvvalue; } // determine if the browser is any gecko // branch >= 1.0.1 or netscape 6.2.x/compuse...
-ms-content-zoom-chaining - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-content-zoom-limit-max - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-content-zoom-limit-min - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-content-zoom-limit - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-content-zoom-snap-points - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-content-zoom-snap-type - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-content-zoom-snap - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-content-zooming - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-scroll-rails - Archive of obsolete content
starting with windows 8.1, this property is also supported for touchpad interaction.
-ms-scroll-snap-x - Archive of obsolete content
starting with windows 8.1, this property is also supported for mouse, keyboard, and touchpad interaction.
-ms-scroll-snap-y - Archive of obsolete content
starting with windows 8.1, this property is also supported for mouse, keyboard, and touchpad interaction.
-ms-touch-select - Archive of obsolete content
in addition, selection will start even if an onclick, onmsgesturetap, or onmouseup handler is present.
:-moz-system-metric() - Archive of obsolete content
rollbar-end-backward) css pseudo-class will match an element if the computer's user interface includes a backward arrow button at the end of scrollbars.:-moz-system-metric(scrollbar-end-forward)the :-moz-system-metric(scrollbar-end-forward) css pseudo-class will match an element if the computer's user interface includes a forward arrow button at the end of scrollbars.:-moz-system-metric(scrollbar-start-backward)the :-moz-system-metric(scrollbar-start-backward) css pseudo-class will match an element if the computer's user interface includes a backward arrow button at the start of scrollbars.:-moz-system-metric(scrollbar-start-forward)the :-moz-system-metric(scrollbar-start-forward) css pseudo-class will match an element if the computer's user interface includes a forward arrow button at the star...
Array comprehensions - Archive of obsolete content
the array comprehensions syntax is non-standard and removed starting with firefox 58.
Expression closures - Archive of obsolete content
the expression closure syntax is a deprecated firefox-specific feature and has been removed starting with firefox 60.
Function.prototype.isGenerator() - Archive of obsolete content
it has been removed from firefox starting with version 58.
Generator comprehensions - Archive of obsolete content
the generator comprehensions syntax is non-standard and removed starting with firefox 58.
ActiveXObject - Archive of obsolete content
to create an automation object, assign the new activexobject to an object variable: var excelapp = new activexobject("excel.application"); var excelsheet = new activexobject("excel.sheet"); this code starts the application creating the object (in this case, a microsoft excel worksheet).
Debug.write - Archive of obsolete content
if you are using an earlier version of internet explorer, see how to: enable and start script debugging from internet explorer.
Debug.writeln - Archive of obsolete content
if you are using an earlier version of internet explorer, see how to: enable and start script debugging from internet explorer.
ECMAScript 2015 support in Mozilla - Archive of obsolete content
refox 46) generic regexp.prototype.tostring (firefox 39) regexp.prototype[@@match]() (firefox 49) regexp.prototype[@@replace]() (firefox 49) regexp.prototype[@@search]() (firefox 49) regexp.prototype[@@split]() (firefox 49) get regexp[@@species] (firefox 49) additions to the string object string.fromcodepoint() (firefox 29) string.prototype.codepointat() (firefox 29) string.prototype.startswith(), string.prototype.endswith() (firefox 17) string.prototype.includes() (firefox 40) (formerly string.prototype.contains() (firefox 17)) string.prototype.repeat() (firefox 24) string.prototype.normalize() (firefox 31) string.raw() (firefox 34) \u{xxxxxx} unicode code point escapes (firefox 40) new symbol object symbol (firefox 36) symbol.iterator (firefox 36) symbol.for() - globa...
for each...in - Archive of obsolete content
firefox now warns about the usage of for each...in and it no longer works starting with firefox 57.
Archived JavaScript Reference - Archive of obsolete content
it has been removed from firefox starting with version 58.generator comprehensionsthe generator comprehension syntax was a javascript expression which allowed you to quickly assemble a new generator function based on an existing iterable object.
LiveConnect Overview - Archive of obsolete content
starting with javascript 1.2, these classes are delivered in a .jar file; in previous versions of javascript, these classes are delivered in a .zip file.
Old Proxy API - Archive of obsolete content
typeof typeof anobjectproxy === "object" typeof afunctionproxy === "function" instanceof anobjectproxy instanceof c === true if and only if the prototype with which anobjectproxy was initialized equals or inherits from c.prototype afunctionproxy instanceof function === true common mistakes and misunderstanding when starting using proxies, there are often a few beginners' mistakes and misunderstandings: not implementing all traps.
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
thus, the text starts 159 pixels from the leftmost edge of the card (4px left margin plus 5px left border plus 150px left padding).
background-size - Archive of obsolete content
if so, feel free to change the en/css_reference/property_template and all css property pages ; ) start with -webkit-background-size and investigate support of contain and cover keywords and "omitted second value" behavior.
Reference - Archive of obsolete content
ruakh 14:40, 27 february 2007 (pst) please don't start making large changes without getting an ok from dev-mdc.
Writing JavaScript for XHTML - Archive of obsolete content
if they get the hint and are not too annoyed, perhaps they start to implement xml features in their libraries.
Troubleshooting XForms Forms - Archive of obsolete content
if your binding expression starts with a /, make sure the first thing is the name of the root node of the instance.
Requests For Enhancement - Archive of obsolete content
ArchiveWebXFormsRFE
now we need to start teaching xforms to web newcomers before they are brainwashed into believing that the only way to build cool web apps is to do dom surgery with javascript!
XForms Styling - Archive of obsolete content
just a starting draft.
XForms - Archive of obsolete content
documentation implementation status implementation status of the mozilla xforms extension building get started with building your own xforms extensions from source.
The Business Benefits of Web Standards - Archive of obsolete content
by using standards to start with we have a known benchmark to measure the known deviations of legacy user agents.
XUL Booster - Archive of obsolete content
extension quick start xul booster makes creating and packaging an extension very easy.
Archive of obsolete content
starting with firefox 2, a sax parser is available to xul applications and extensions.
Using the DOM File API in chrome code - Extensions
notes starting in gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5), you can also do this in component code.
bootstrap.js - Extensions
function startup(data, reason) { /// bootstrap data structure @see /docs/extensions/bootstrapped_extensions#bootstrap_data /// string id /// string version /// nsifile installpath /// nsiuri resourceuri /// /// reason types: /// app_startup /// addon_enable /// addon_install /// addon_upgrade /// addon_downgrade } function shutdown(data, reason) { /// bootstrap data structure @see ...
Game monetization - Game development
if your game goes viral and people start sharing it, you can get a lot of downloads and money out of adverts.
Explaining basic 3D theory - Game development
this article explains all of the basic theory that's useful to know when you are getting started working with 3d.
Building up a basic demo with PlayCanvas - Game development
engine vs editor the engine itself can be used as a standard library by including its javascript file directly in your html, so you can start coding right away; in addition the playcanvas toolset comes with an online editor that you can use to drag and drop components onto the scene — a great way to create games and other apps requiring scenes if you're more of a designer than a coder.
GLSL Shaders - Game development
environment setup to start with the webgl shaders you don't need much.
WebVR — Virtual Reality for the Web - Game development
you can check the webvr boilerplate sources — it's a good example to start learning webvr from, and a starting point for any web-based vr experience.
3D games on the Web - Game development
the rise of libraries and frameworks coding raw webgl is fairly complex, but you'll want to get to grips with it in the long run, as your projects get more advanced (see our webgl documentation to get started.) for real-world projects you'll probably also make use of a framework to speed up development and help you manage the project you're working on.
Async scripts for asm.js - Game development
in gecko, async compilation allows the javascript engine to compile the asm.js off the main thread when the game is loading and cache the generated machine code so that the game doesn't need to be compiled on subsequent loads (starting in firefox 28).
Implementing controls using the Gamepad API - Game development
store everything related to the api: var gamepadapi = { controller: {}, turbo: false, connect: function() {}, disconnect: function() {}, update: function() {}, buttonpressed: function() {}, buttons: [], buttonscache: [], buttonsstatus: [], axesstatus: [] }; the buttons array contains the xbox 360 button layout: buttons: [ 'dpad-up','dpad-down','dpad-left','dpad-right', 'start','back','axis-left','axis-right', 'lb','rb','power','a','b','x','y', ], this can be different for other types of gamepads like the ps3 controller (or a no-name, generic one), so you have to be careful and not just assume the button you're expecting will be the same button you'll actually get.
Techniques for game development - Game development
optimizing startup performance how to make sure your game starts up quickly, smoothly, and without appearing to lock up the user's browser or device.
Build the brick field - Game development
var brickrowcount = 3; var brickcolumncount = 5; var brickwidth = 75; var brickheight = 20; var brickpadding = 10; var brickoffsettop = 30; var brickoffsetleft = 30; here we've defined the number of rows and columns of bricks , their width and height, the padding between the bricks so they won't touch each other and a top and left offset so they won't start being drawn right from the edge of the canvas.
Track the score and win - Game development
the document.location.reload() function reloads the page and starts the game again once the alert button is clicked.
Extra lives - Game development
if yes, then the player still has some lives left and can continue to play — they will see the life lost message, the ball and paddle positions will be reset on screen and on the next input (click or touch) the message will be hidden and the ball will start to move again.
Load the assets and print them on screen - Game development
having a ball let's start by creating a javascript variable to represent our ball.
Randomizing gameplay - Game development
below are some suggestions as to how you could expand our little game, to get you started: add a second ball or paddle.
Win the game - Game development
if there are no more bricks left alive, then we show a winning message, restarting the game once the alert is dismissed.
Touch Event Horizon - Game development
this article is for touch event horizon and a game related to it touch gestures and events link the example game github repository live demo setting up the canvas counting the taps touchstart, touchend collecting the bonus touchmove future developments summary this tutorial shows how to use touch events to create a game on a <canvas>.
Control flow - MDN Web Docs Glossary: Definitions of Web-related terms
control flow means that when you read a script, you must not only read from start to finish but also look at program structure and how it affects order of execution.
Endianness - MDN Web Docs Glossary: Definitions of Web-related terms
big-endian is also often called "network byte order", because internet standards usually require data to be stored big-endian, starting at the standard unix socket level and going all the way up to standardized web binary data structures.
Fallback alignment - MDN Web Docs Glossary: Definitions of Web-related terms
first baseline start last baseline safe end baseline start space-between flex-start (start) space-around center space-evenly center stretch flex-start (start) learn more css box alignment ...
First contentful paint - MDN Web Docs Glossary: Definitions of Web-related terms
this is the first time users could start consuming page content.
Gaia - MDN Web Docs Glossary: Definitions of Web-related terms
once firefox os starts, anything drawn to screen is a product of the gaia layer (e.g., the lock screen, home screen, standard apps).
Global object - MDN Web Docs Glossary: Definitions of Web-related terms
for example: in a web browser, any code which the script doesn't specifically start up as a background task has a window as its global object.
HTTP header - MDN Web Docs Glossary: Definitions of Web-related terms
headers are case-insensitive, begins at the start of a line and are immediately followed by a ':' and a value depending of the header itself.
Identifier - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, identifiers are case-sensitive and can contain unicode letters, $, _, and digits (0-9), but may not start with a digit.
Lazy load - MDN Web Docs Glossary: Definitions of Web-related terms
if correctly implemented, this delay in asset loading is seamless to the user experience and might help improve initial load performance, including time to interactive, as fewer assets are required for the page to start working.
Microsoft Internet Explorer - MDN Web Docs Glossary: Definitions of Web-related terms
learn more general knowledge internet explorer on wikipedia history of internet explorer on wikipedia internet explorer versions on wikipedia learning about internet explorer http://windows.microsoft.com/en-us/internet-explorer/download-ie http://windows.microsoft.com/en-us/windows7/getting-started-with-internet-explorer-9 http://windows.microsoft.com/en-us/internet-explorer/internet-explorer-help http://windows.microsoft.com/en-us/internet-explorer/make-ie-default-browser#ie=ie-11 technical reference http://windows.microsoft.com/en-us/internet-explorer/products/ie-8/system-requirements http://windows.microsoft.com/en-us/internet-explorer/products/ie-9/system-requirements http://...
Mobile First - MDN Web Docs Glossary: Definitions of Web-related terms
the rationale behind the mobile-first approach is to provide users with good user experiences at all screen sizes—by starting with creating a user experience that works well on small screens, and then building on top of that to further enrich the user experience as the screen size increases.
PHP - MDN Web Docs Glossary: Definitions of Web-related terms
examples basic syntax // start of php code <?php // php code goes here ?> // end of php code printing data on screen <?php echo "hello world!"; ?> php variables ​​​​​​​​​​​​​​<?php // variables $nome='danilo'; $sobrenome='santos'; $pais='brasil'; $email='danilocarsan@gmailcom'; ​​​​​​​ // printing the variables echo $nome; echo $sobrenome; echo $pais; echo $email; ?> ...
Parse - MDN Web Docs Glossary: Definitions of Web-related terms
html tokens include start and end tags, as well as attribute names and values.
Quality values - MDN Web Docs Glossary: Definitions of Web-related terms
browser-specific information firefox starting with firefox 18, the quality factor values are clamped to 2 decimal places.
Random Number Generator - MDN Web Docs Glossary: Definitions of Web-related terms
truly random numbers (say, from a radioactive source) are utterly unpredictable, whereas all algorithms are predictable, and a prng returns the same numbers when passed the same starting parameters or seed.
Session Hijacking - MDN Web Docs Glossary: Definitions of Web-related terms
most authentication occurs only at the start of a tcp session.
Smoke Test - MDN Web Docs Glossary: Definitions of Web-related terms
smoke testing answers questions like "does the program start up correctly?" "do the main control buttons function?" "can you save a simple blank new test user account?" if this basic functionality fails, there is no point investing time in more detailed qa work at this stage.
TCP - MDN Web Docs Glossary: Definitions of Web-related terms
tcp has concurrence control, which means the initial requests start small, increasing in size to the levels of bandwidth the computers, servers, and network can support.
TCP handshake - MDN Web Docs Glossary: Definitions of Web-related terms
the three messages transmitted by tcp to negotiate and start a tcp session are nicknamed syn, syn-ack, and ack for synchronize, synchronize-acknowledgement, and acknowledge respectively.
Transmission Control Protocol (TCP) - MDN Web Docs Glossary: Definitions of Web-related terms
the three messages transmitted by tcp to negotiate and start a tcp session are nicknamed syn, syn-ack, ack for synchronize, synchronize-acknowledgement, and acknowledge.
Array - MDN Web Docs Glossary: Definitions of Web-related terms
in javascript, arrays start at index zero and can be manipulated with various methods.
Speculative parsing - MDN Web Docs Glossary: Definitions of Web-related terms
the html parser starts speculative loads for scripts, style sheets and images it finds ahead in the stream and runs the html tree construction algorithm speculatively.
Time to first byte - MDN Web Docs Glossary: Definitions of Web-related terms
ttfb is the time it takes between the start of the request and the start of the response, in milliseconds: ttfb = responsestart - requeststart see also: a typical http session performanceresourcetiming performancetiming ...
MDN Web Docs Glossary: Definitions of Web-related terms
tatement static method static typing strict mode string stun style origin stylesheet svg svn symbol symmetric-key cryptography synchronous syntax syntax error synthetic monitoring t tag tcp tcp handshake tcp slow start telnet texel thread three js time to first byte time to interactive tld tofu transmission control protocol (tcp) transport layer security (tls) tree shaking trident truthy ttl turn type type coercion type conversion u ...
About Scriptable Interfaces - Interfaces
status of this document this is just a starter document, it should not be considered complete.
Accessible multimedia - Learn web development
basic setup first, grab a copy of our custom-controls-start.html, custom-controls.css, rabbit320.mp4, and rabbit320.webm files and save them in a new directory on your hard drive.
Images, media, and form elements - Learn web development
images will not stretch, and instead will be aligned to the start of the grid area or flex container.
Type, class, and ID selectors - Learn web development
class selectors the class selector starts with a full stop (.) character and will select everything in the document with that class applied to it.
CSS selectors - Learn web development
the following for example selects paragraphs that are direct children of <article> elements using the child combinator (>): article > p { } next steps you can take a look at the reference table of selectors below for direct links to the various types of selectors in this learn section or on mdn in general, or continue on to start your journey by finding out about type, class, and id selectors.
Sizing items in CSS - Learn web development
in our example below, that border stretches to the width of the container, because it is a block level element, a behavior that should be starting to become familiar to you.
Supporting older browsers - Learn web development
therefore, a well-structured html document should always be your starting point.
Typesetting a community school homepage - Learn web development
starting point to get this assessment started, you should: go and grab the html and css files for the exercise, and the provided external link icon.
Styling text - Learn web development
get started prerequisites before starting this module, you should already have basic familiarity with html, as discussed in the introduction to html module, and be comfortable with css fundamentals, as discussed in introduction to css.
How do you make sure your website works properly? - Learn web development
now, you can start digging deeper into various subjects.
How do you upload your files to a web server? - Learn web development
we've covered the basics of using this in the publishing your website article from our getting started with the web guide, so we aren't going to repeat it all here.
What are hyperlinks? - Learn web development
when you're starting out, you don't have to worry about external and incoming links as much, but they are very important if you want search engines to find your site (see below for more details).
What is a Domain Name? - Learn web development
if you want to get hands-on, it's a good time to start digging into design and explore the anatomy of a web page.
What software do I need to build a website? - Learn web development
bear in mind that (s)ftp is now somewhat old-fashioned, and other uploading systems are starting to become popular, such as rsync and git/github.
Common questions - Learn web development
how do i start to design my website?
Advanced form styling - Learn web development
let's start by unstyling the original check boxes: input[type="checkbox"] { -webkit-appearance: none; appearance: none; } we can use the :checked and :disabled pseudo-classes to change the appearance of our custom checkbox as its state changes: input[type="checkbox"] { position: relative; width: 1em; height: 1em; border: 1px solid gray; /* adjusts the position of the checkboxes on the text ...
The HTML5 input types - Learn web development
weeks start on monday and run to sunday.
Use JavaScript within a webpage - Learn web development
if you want to learn javascript itself, you can start with our javascript basics article.
Using data attributes - Learn web development
any attribute on any element whose attribute name starts with data- is a data attribute.
Mozilla splash page - Learn web development
starting point to start off this assessment, you need to grab the html and all the images available in the mdn-splash-page-start directory on github.
Choosing the right approach - Learn web development
single delayed operation repeating operation multiple sequential operations multiple simultaneous operations no yes no (unless it is the same one) no code example a simple animated spinner; you can find this example live on github (see the source code also): const spinner = document.queryselector('div'); let rotatecount = 0; let starttime = null; let raf; function draw(timestamp) { if(!starttime) { starttime = timestamp; } rotatecount = (timestamp - starttime) / 3; if(rotatecount > 359) { rotatecount %= 360; } spinner.style.transform = 'rotate(' + rotatecount + 'deg)'; raf = requestanimationframe(draw); } draw(); pitfalls you can't choose a specific framerate with requestan...
Image gallery - Learn web development
starting point to get this assessment started, you should go and grab the zip file for the example, unzip it somewhere on your computer, and do the exercise locally to begin with.
Function return values - Learn web development
as you go further into your programming career, you'll start doing the same kinds of things over and over again.
JavaScript building blocks - Learn web development
get started prerequisites before starting this module, you should have some familiarity with the basics of html and css, and you should have also worked through our previous module, javascript first steps.
Silly story generator - Learn web development
starting point to get this assessment started, you should: go and grab the html file for the example, save a local copy of it as index.html in a new directory somewhere on your computer, and do the assessment locally to begin with.
Object prototypes - Learn web development
by default, a constructor's prototype always starts empty.
Test your skills: JSON - Learn web development
the json is loaded into the page as a text string and made available in the catstring parameter of the displaycatinfo() function, called when the provided promise chain (which starts by fetching the json data) is fulfilled.
Measuring performance - Learn web development
this is a good start for getting an idea about what you are already doing well and what could be improved.
Web performance resources - Learn web development
best practices start with learning the critical rendering path of the browser.
Introduction to the server side - Learn web development
eventually, you will start to be redirected to pages explaining how to subscribe, and you will be unable to access articles.
Server-side website programming first steps - Learn web development
prerequisites before starting this module, you don't need to have any knowledge of server-side website programming, or indeed any other type of programming.
Chrome Worker Modules
start by importing the module loader.
omni.ja (formerly omni.jar)
note: starting with firefox 10 and thunderbird 10, the file extension .ja is used because windows system restore does not back up files with the .jar extension, but it does back up .ja files.
Mozilla accessibility architecture
nt event_create (atk) event_reorder (msaa) domsubtreemodified w3c dom mutation event event_reorder domnoderemoved w3c dom mutation event event_destroy (atk) event_reorder (msaa) checkboxstatechange, radiostatechange mozilla dom event_state_change popupshowing mozilla dom event_menustart popuphiding mozilla dom event_menuend nsdocaccessible::scrollpositiondidchange(), then nsdocaccessible::scrolltimercallback() nsiscrollpositonlistener and nsitimer callbacks event_scrollingend (quick timer is used to determine when scrolling pauses or stops, to avoid extra events being fired) nsdocaccessible::onstatechange(),...
Accessibility information for UI designers and developers
on desktop with a keyboard, it lets people type a character, say ‘k’, to jump directly to options starting with ‘k’.
Information for Assistive Technology Vendors
mozilla now has enough accessibility support that we're reading for early adopters and testers to start giving it a try.
Mozilla’s UAAG evaluation report
(p1) ni cannot slow animations 4.5 start, stop, pause, and navigate multimedia.
Index
if you just want to get started, head to the submit a new add-on page on amo.
Lightweight themes
submitting your theme image to get started submitting your images, go to the theme submission page: name your theme — pick a unique name for your theme.
Benchmarking
the poisoning can be disabled by setting the environment variable jsgc_disable_poisoning=1 before starting the browser.
Testopia
this is not an trivial task, it takes time (it started in august 2014), and we decided that it was not a good idea to release half-baked code which still needs testing to make sure we didn't regress anything.
Continuous Integration
tests currently run are primarily startup tests.
Creating a Login Manager storage module
you should start with the existing code if you want to implement that in your extension.
Debugging Chrome
unfortunately, it requires using --single-process which crashes on startup for me.
Debugging Internet Explorer
use jrmuizel's script to get started.
Debugging OpenGL
if you start up firefox with this variable defined, the following behavior changes occur: each time you issue an opengl call, a check is performed to ensure that the gl context is current, using a thread-local static variable to keep track of this.
Debugging a hang on OS X (Archived)
now, click "start recording".
Adding APIs to the navigator object
starting with gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6), you can easily add new apis to the window.navigator object by using the category manager.
Articles for new developers
when first getting started as a contributor to the mozilla project, there's a lot of information to sort through and understand.
Configuring Build Options
adding the following line to your mozconfig allows you to change the objdir: mk_add_options moz_objdir=@topsrcdir@/obj-@config_guess@ it is a good idea to have your objdir name start with obj so that mercurial ignores it.
Simple Firefox for Android build
deprecated: this documentation has moved, please visit geckoview-quick-start for up-to-date documentation on building geckoview for android.
Simple Instantbird build
building instantbird what you need to do to build instantbird rather than firefox is: echo 'ac_add_options --enable-application=im' >> .mozconfig to start the build, cd into the comm-central subdirectory (created automatically by the hg clone command), and run: ./mozilla/mach build mach is our command-line tool to streamline common developer tasks.
Simple SeaMonkey build
after that all should be well.) open a shell window by running: c:\mozilla-build\start-msvc2013.bat.
Simple Sunbird build
after that all should be well.) open a shell window by running: c:\mozilla-build\start-msvcx.bat (where x is 8 for vs 2005, and 9 for vs 2008).
Updating NSPR or NSS in mozilla-central
(because some developers might not be aware that nspr/nss are separately maintained and released, the mozilla hg server rejects accidental changes/forking, if the required keywords are missing in the commit comment.) if nspr or nss must be upgraded to a new static tag, follow this procedure: before starting, make sure your local repository is updated to mozilla-central tip and that there are no local changes: $ hg status -mard pull the new sources $ python client.py update_nspr nspr_tag_name or $ python client.py update_nss nss_tag_name if you update a branch older than mozilla 17 (without the change from bug 782784), you must manually add a dummy change (add or remove a blank lin...
Commenting IDL for better documentation
but by following the guidelines here, you can help make sure that our tools can generate a "good start" version of the documentation for your interfaces, and that the writers will be able to easily figure out what the tools are not able to do automatically.
Working with Mozilla source code
getting a pre-configured mozilla build system virtual machine this is the easiest way to get started: use a virtualbox virtual machine which is already configured with a complete build environment for you to use.
Experimental features in Firefox
nightly 63 no developer edition 63 no beta 63 no release 63 starting in firefox 68, on android only preference name dom.visualviewport.enabled constructable stylesheets the addition of a constructor to the cssstylesheet interface as well as a variety of related changes makes it possible to directly create new stylesheets without having to add the sheet to the html.
Index
171 tracking protection privacy, private browsing, blocking, tracking starting in version 42, firefox desktop and firefox for android include built-in tracking protection.
Storage access policy: Block cookies from trackers
specifically, we check the exact hostname of the resource against the list, as well as the last four hostnames formed by starting with the last five components and successively removing the leading component.
Firefox UI considerations for web developers
ks roughly like this: <link rel="shortcut icon" href="/dist/images/icons/favicon.ico"> <link rel="apple-touch-icon-precomposed" href="/dist/images/icons/apple-touch-icon.png"> <link rel="apple-touch-icon-precomposed" sizes="72x72" href="/dist/images/icons/apple-touch-icon_72.png"> <link rel="apple-touch-icon-precomposed" sizes="114x114" href="/dist/images/icons/apple-touch-icon@2x.png"> firefox starts by looking for an svg icon; there is none.
Using the Browser API
MozillaGeckoChromeAPIBrowser APIUsing
this is implemented in our sample app with the following functions: browser.addeventlistener('mozbrowserloadstart',function() { stopreload.textcontent = 'x'; }); browser.addeventlistener('mozbrowserloadend',function(e) { canmovebwd(); canmovefwd(); stopreload.textcontent = 'r'; console.log(e.detail.backgroundcolor); controls.style.background = e.detail.backgroundcolor; }); when the mozbrowserloadstart event fires, the latest page request has started loading, and we change the button to a cross ...
HTMLIFrameElement.goBack()
by calling this method, the browser <iframe> changes its location for the previous location available in its navigation history, which sends a series of related events: mozbrowserlocationchange, mozbrowserloadstart, and so on.
HTMLIFrameElement.goForward()
by calling this method, the browser <iframe> changes its location to the next location available in its navigation history, which sends a series of related events: mozbrowserlocationchange, mozbrowserloadstart and so on.
mozbrowseractivitydone
owser = document.queryselector("iframe"); browser.addeventlistener("mozbrowseractivitydone", function(event) { if(event.details.success) { console.log('activity completed successfully'); } else { console.log('activity not completed successfully'); } }); related events mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserasyncscroll
examples var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserasyncscroll", function( event ) { console.log("the scroll top position of the document is:" + event.details.top + "px"); }); related events mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowsercaretstatechanged
examples var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsercaretstatechanged", function( event ) { // do stuff with event.details }); related events mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserclose
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserclose", function() { console.log("browser window has been closed; iframe will be destroyed."); }); related events mozbrowserasyncscroll mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowsercontextmenu
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsercontextmenu", function(event) { console.log("asking for menu:" + json.stringify(event.details)); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserdocumentfirstpaint
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserdocumentfirstpaint", function() { console.log("first content painted."); }); related events mozbrowserasyncscroll mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowsererror
re remotexul unsafecontenttype corruptedcontenterror certerror other example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsererror", function( event ) { console.log("an error occurred:" + event.detail); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserfindchange
ample var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserfindchange", function(event) { console.log("currently highlighted: " + event.details.activematchordinal + " out of " + event.details.numberofmatches); }); related events mozbrowserasyncscroll mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserfirstpaint
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserfirstpaint", function(event) { console.log("first content painted."); }); related events mozbrowserasyncscroll mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowsericonchange
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsericonchange", function( event ) { console.log("the url of the new favicon is:" + event.details.href); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserlocationchange
var browser = document.queryselector("iframe"); browser.addeventlistener('mozbrowserlocationchange', function (event) { urlbar.value = event.detail.url; }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowsermanifestchange
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsermanifestchange", function(event) { console.log("new manifest url: " + event.details.href); }); related events mozbrowserasyncscroll mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowsermetachange
its name is " + event.details.name + ", and its content is " + event.details.content + "."); }); related events mozbrowserasyncscroll mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowseropensearch
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowseropensearch", function( event ) { console.log("new search engine encountered: " + event.details.title); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsertitlechange ...
mozbrowseropentab
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowseropentab", function( event ) { console.log("a new document has opened containing the content at " + event.details.url + "."); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowseropenwindow
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowseropenwindow", function( event ) { console.log("a new window has opened containing the content at " + event.details.url + "."); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserresize
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserresize", function( event ) { console.log("the new window size is " + event.details.width + " x " + event.details.height + "."); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserscroll
var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserscroll", function( event ) { console.log("the new scroll position is " + event.details.left + " across and " + event.details.top + "down."); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserscrollareachanged
var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowserscrollareachanged", function( event ) { console.log("the new scroll area is " + event.details.width + " x " + event.details.height + "."); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowsersecuritychange
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsersecuritychange", function( event ) { console.log("the ssl state is:" + event.details.state); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowserselectionstatechanged
"); browser.addeventlistener("mozbrowserselectionstatechanged", function( event ) { if(event.details.visible) { console.log("the current selection is visible."); } else { console.log("the current selection is not visible."); } }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowsershowmodalprompt
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsershowmodalprompt", function( event ) { console.log("asking for prompt:" + json.stringify(event.detail)); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsertitlechange mozbrowserusernameandpasswordrequired ...
mozbrowsertitlechange
example var browser = document.queryselector("iframe"); browser.addeventlistener("mozbrowsertitlechange", function( event ) { console.log("the title of the document is:" + event.detail); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsershowmodalprompt mozbrowserusernameandpasswordrequired ...
mozbrowserusernameandpasswordrequired
example var browser = document.queryselector("iframe[mozbrowser]"); browser.addeventlistener("mozbrowserusernameandpasswordrequired", function( event ) { console.log("the auth realm is:" + event.detail.realm); }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsertitlechange ...
mozbrowservisibilitychange
document.queryselector("iframe"); browser.addeventlistener("mozbrowservisibilitychange", function( event ) { if(event.details.visible) { console.log("the browser is visible."); } else { console.log("the browser is hidden."); } }); related events mozbrowserasyncscroll mozbrowserclose mozbrowsercontextmenu mozbrowsererror mozbrowsericonchange mozbrowserloadend mozbrowserloadstart mozbrowserlocationchange mozbrowseropenwindow mozbrowsersecuritychange mozbrowsertitlechange ...
Overview of Mozilla embedding APIs
currently, once gecko has been shutdown, it cannot be restarted in the same process space...
Script security
(a is the start of the arrow, and b is the end.) computing a wrapper the following diagram shows the factors that determine the kind of wrapper that compartment a would get when trying to access an object in compartment b.
Geckoview-Junit Tests
running tests locally if desired, connect an android device to your computer, or start an emulator, and make sure your device is visible to adb: $ adb devices list of devices attached emulator-5554 device if no device is found, 'mach geckoview-junit' will offer to start an emulator.
HTTP Cache
cacheentry::asyncopen consumer reference -- cacheentry::asyncopen (entry atomic): the opener is added to fifo, consumer reference ++ (dropped back after an opener is removed from the fifo) state == notloaded: state = loading when open_truncate flag was used: cachefile is created as 'new', state = empty otherwise: cachefile is created and load on it started cacheentry::onfileready notification is now expected state == loading: just do nothing and exit call to cacheentry::invokecallbacks cacheentry::invokecallbacks (entry atomic): called on: a new opener has been added to the fifo via an asyncopen call asynchronous result of cachefile open the writer throws the entry away the output stream of the entry has b...
How to get a process dump with Windows Task Manager
run firefox, reproduce the hang start firefox and perform whatever steps are necessary to cause firefox to hang.
PBackground
note: if you want more detailed information on ipdl, start out by reading the ipdl tutorial.
IPDL Tutorial
ipdl protocols start with the letter p.
IPC Protocol Definition Language (IPDL)
current docs ipdl tutorial quick start: creating a new protocol quick start: extending a protocol ipdl type serialization ipdl best practices ipdl glossary pbackground future planned docs ipdl language reference error and shutdown handling in ipdl protocols how ipdl uses processes, threads, and sockets ipdl shared memory ...
Introduction to Layout in Mozilla
tent dll auto-registers a document loader factory (dlf) @mozilla.org/content-viewer-factory/view;1?type=text/html all mime types mapped to the same class, nscontentdlf nsdocshell receives inbound content via nsdsuricontentlistener invokes nsidlf::createinstance, passes mime type to dlf nscontentdlf creates a nshtmldocument object, invokes startdocumentload.
AddonUpdateChecker
updateinfo getnewestcompatibleupdate( in updateinfo updates[], in string appversion, in string platformversion ) parameters updates an array of update objects appversion the version of the application or null to use the current version platformversion the version of the platform or null to use the current version checkforupdates() starts an update check.
TypeListener
void ontypeadded( in addontype type ) parameters type the addontype that is being added needsrestart true if an application restart is necessary for the change to take effect ontyperemoved() called when an add-on type has been removed.
JavaScript OS.Constants
winstartmenuprogsdir the path to the programs subdirectory in the user's start menu.
Log.jsm
info interesting runtime events (startup/shutdown).
Deferred
starting from gecko 30, this object is obsolete and should not be used anymore.
Services.jsm
r3 prefs nsiprefbranch nsiprefbranch2 nsiprefservice preferences service prompt nsipromptservice prompt service scriptloader mozijssubscriptloader javascript subscript loader service scriptsecuritymanager nsiscriptsecuritymanager script security manager search nsibrowsersearchservice browser search service startup nsiappstartup application startup service storage mozistorageservice storage api service strings nsistringbundleservice string bundle service sysinfo nsipropertybag2 system info service telemetry nsitelemetry telemetry service tm nsithreadmanager thread manager service urifixup nsiurifixup uri fixup ...
Sqlite.jsm
if the transaction fails, the database is rolled back to its state before the transaction started.
Using workers in JavaScript code modules
note: as of gecko 8.0, the nsiworkerfactory interface has been removed starting in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), you can use workers in javascript code modules (jsms).
XPCOMUtils.jsm
create the nsgetfactory() or nsgetmodule() entry point finally, you need to implement the nsgetmodule() entry point so gecko can start up your component: // "components" is the array created in the previous section if ("generatensgetfactory" in xpcomutils) var nsgetfactory = xpcomutils.generatensgetfactory(components); // gecko 2.0+ else var nsgetmodule = xpcomutils.generatensgetmodule(components); // gecko 1.9.x method overview function definelazygetter(aobject, aname, alambda); function definelazym...
Mozilla Content Localized in Your Language
ex: most asian countries start from big to small: [country] [postal code][state/province][city][district][street number and name][building and suite numbers][addressee] countries of european languages start from small to big: [addressee][street number and name][building and suite numbers][district][city][state/province][postal code][country] name convention what are the order of family name and given name in your language.
Localization content best practices
note: if you're a localizer and you want to contribute to the localization of mozilla products, you might want to read our localization quick start guide for information on localizing mozilla code.
Localizing with Mercurial
go to start > run...
Patching a Localization
start bash and do the following: create a clean directory for your work.
Localization prerequisites
on windows, mozillabuild offers a start-shell-l10n.bat in c:\mozilla-build.
Translation phase
note: if you are starting a new localization and decide to use an offline tool for localizing mozilla applications, you will need to become familiar with using mercurial (hg).
Uplifting a localization from Central to Aurora
if hg merge starts asking you questions, you have a merge conflict.
Web Localizability
why localizability is important there are many reasons why you should start thinking about making your web app localizable as soon as possible.
What every Mozilla translator should know
when a development is started for an specific version, a new repository is created under hg.mozilla.org/releases/.
MathML Screenshots
screenshot of start screenshot of basics.
Mozilla MathML Status
the mathvariant attribute is fully supported starting with (firefox 28.0 / thunderbird 28.0 / seamonkey 2.25).
Mozilla MathML Project
mathml in mozilla developer network mathml accessibility in mozilla sample mathml documents screenshots mathml start page - with translations in different languages ( arabic, chinese, hebrew, thai) mathml basics - document tailored to display correctly with just the symbol font that is pre-installed by default on most os configurations.
Activity Monitor, Battery Status Menu and top
testing shows that once an energy-intensive application is started it takes less than a minute for it to show up in the battery status menu.
Build Metrics
static constructors are undesirable because their initialization imposes an unavoidable time penalty every time firefox is started.
Automated performance testing and sheriffing
we have several test harnesses that test firefox for various performance characteristics (page load time, startup time, etc.).
Power profiling overview
it serves as a starting point for anybody doing power profiling for the first time.
TimerFirings logging
2082435840[100445640]: [81190] fn timer (one_shot 8000 ms): [from dladdr] gfxfontinfoloader::delayedstartcallback(nsitimer*, void*) second, on linux the code uses dladdr to get the symbol library and address, which can be post-processed by tools/rb/fix_stacks.py.
dtrace
a good starting command for profiling wakeups is the following.
powermetrics
quick start powermetrics provides a vast number of measurements.
Phishing: a short definition
as most phishing attacks start with unsolicited email messages, a clear starting point is improving spam filters, thus reducing the number of fraudulent messages reaching users.
A brief guide to Mozilla preferences
this method has the advantage of resetting preferences back to administrator defaults at every start-up.
browser.dom.window.dump.file
changes require an application restart.
browser.urlbar.trimURLs
if the address starts with http:// and neither starts with a ftp.
mail.tabs.drawInTitlebar
starting in thunderbird 17.0, the tabs are drawn in the title bar.
Preferences system
reference information about them is available below: preferences system documentation: introduction: getting started | examples | troubleshooting reference: prefwindow | prefpane | preferences | preference | xul attributes use code for a typical preferences window may look like this: <prefwindow id="apppreferences" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <prefpane id="pane1" label="&pane1.title;"> <preferences> <preference id="pref1" name="pref.name"...
A guide to searching crash reports
grouping by platform for example, if we start with a default search for all firefox crashes in the past week, but then replace the "signature" facet with "platform" and "moz crash reason", we get search results with two facet tabs.
L20n HTML Bindings
the monolingual mode may be useful when you first start a new project, when you want to test something quickly or when using server-side language negotiation.
MailNews automated testing
performance testing mail leak and bloat tests these tests start up thunderbird or seamonkey and record any leaks found, as well as the total memory requirement.
Midas editor module security preferences
save the file and restart firefox.
Midas
internet explorer also supports the ability to edit specific elements using the contenteditable attribute; starting with firefox 3, gecko also supports contenteditable.
About NSPR
nspr20, an effort started in 1996, built on that original idea, though very little is left of the original code.
Creating a Cookie Log
linux start a command shell (these instructions are for bash, if you use something else, you probably know how to modify these instructions already).
Optimizing Applications For NSPR
the work to undo this dependency has already been started and the result will be made available soon.
Date and Time
pr_msec_per_sec pr_usec_per_sec pr_nsec_per_sec pr_usec_per_msec pr_nsec_per_msec types and constants types and constants defined for nspr dates and times are: prtime prtimeparameters prexplodedtime time parameter callback functions in some geographic locations, use of daylight saving time (dst) and the rule for determining the dates on which dst starts and ends have changed a few times.
PL_HashTableEnumerateEntries
for each entry, the enumerator function is invoked with the entry, the index (in the sequence of enumeration, starting from 0) of the entry, and arg as arguments.
PRErrorCode
nspr assumes error numbers starting at -6000 (decimal) and progressing towards zero.
PRExplodedTime
note that it starts from 1 as opposed to 0.
PR_Listen
it creates a queue for pending connections and starts to listen for connection requests on the socket.
PR_NewTCPSocket
typically, the server binds its socket to a well-known port with pr_bind, calls pr_listen to start listening for connection setup requests, and calls pr_accept to accept a connection.
PR_OpenTCPSocket
typically, the server binds its socket to a well-known port with pr_bind, calls pr_listen to start listening for connection setup requests, and calls pr_accept to accept a connection.
PR_SetLogBuffering
ordinarily, a user application need not use this function, as nspr initializes logging at nspr startup.
PR_SetLogFile
ordinarily, a user application need not use this function, as nspr initializes logging at nspr startup.
PR_Unmap
syntax #include <prio.h> prstatus pr_memunmap( void *addr, pruint32 len); parameters the function has the following parameters: addr the starting address of the memory region to be unmapped.
Certificate functions
removecertlistnode mxr 3.6 and later cert_rfc1485_escapeandquote mxr 3.2 and later cert_savesmimeprofile mxr 3.2 and later cert_setsloptime mxr 3.2 and later cert_setocspfailuremode mxr 3.11.7 and later cert_setocsptimeout mxr 3.12 and later cert_setusepkixforvalidation mxr 3.12 and later cert_startcertextensions mxr 3.5 and later cert_startcertificaterequestattributes mxr 3.10 and later cert_startcrlentryextensions mxr 3.10 and later cert_startcrlextensions mxr 3.10 and later cert_uncachecrl mxr 3.10 and later cert_verifycertname mxr 3.2 and later cert_verifycacertforusage mxr 3.6 and later ...
NSS FAQ
MozillaProjectsNSSFAQ
nss includes detailed documentation of the ssl api and sample code that demonstrates basic ssl functionality (setting up an encrypted session, server authentication, and client authentication) to help jump start the integration process.
FIPS Mode - an explanation
in fips mode, every user must have a good strong "master password", and must enter it each time he starts or restarts firefox before he can visit any web sites that use cryptography (https).
HTTP delegation
look for function sec_registerdefaulthttpclient and all functions having names that start with sec_http.
HTTP delegation
look for function sec_registerdefaulthttpclient and all functions having names that start with sec_http.
JSS FAQ
MozillaProjectsNSSJSSJSS FAQ
in version previous to jss 3.1, jss removes the default sun provider on startup.
JSS
MozillaProjectsNSSJSS
read using jss to get you started with development after you've built and downloaded it.
NSS Key Log Format
note: starting with nss 3.24 (used by firefox 48 and 49 only), the sslkeylogfile approach is disabled by default for optimized builds using the makefile (those using gyp via build.sh are not affected).
NSS 3.12.5 release_notes
environment variables nss_fips will start nss in fips mode.
NSS 3.28 release notes
the certificate validation code contains checks to no longer trust certificates that are issued by old wosign and startcom cas, after october 21, 2016.
NSS 3.33 release notes
when nss is compiled without nss_force_fips=1 startup checks are no longer performed.
NSS 3.34 release notes
sha-256 fingerprint: d8:e0:fe:bc:1d:b2:e3:8d:00:94:0f:37:d2:7d:41:34:4d:99:3e:73:4b:99:d5:65:6d:97:78:d4:d8:14:36:24 cn = startcom certification authority sha-256 fingerprint: c7:66:a9:be:f2:d4:07:1c:86:3a:31:aa:49:20:e8:13:b2:d1:98:60:8c:b7:b7:cf:e2:11:43:b8:36:df:09:ea cn = startcom certification authority sha-256 fingerprint: e1:78:90:ee:09:a3:fb:f4:f4:8b:9c:41:4a:17:d6:37:b7:a5:06:47:e9:bc:75:23:22:72:7f:cc:17:42:a9:11 cn = startcom certification authority g2 sha-2...
NSS 3.35 release notes
starting with version 3.35, nss uses the sql file format by default.
NSS 3.37 release notes
starting with nss version 3.31, an alternative implementation for rng seeding on the linux/unix platform was available (bug 1346735), which performed seeding exclusively based on /dev/urandom.
NSS 3.39 release notes
starting with version 3.39, nss requires the encoding to contain the null parameter.
NSS 3.42 release notes
bug 1513913 - a fix for solaris where firefox 60 core dumps during start when using profile from version 52 this bugzilla query returns all the bugs fixed in nss 3.42: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.42 compatibility nss 3.42 shared libraries are backward compatible with all older nss 3.x shared libraries.
NSS 3.47.1 release notes
bugs fixed in nss 3.47.1 cve-2019-11745 - encryptupdate should use maxout, not block size bug 1590495 - fix a crash that could be caused by client certificates during startup bug 1589810 - fix compile-time warnings from uninitialized variables in a perl script this bugzilla query returns all the bugs fixed in nss 3.47: https://bugzilla.mozilla.org/buglist.cgi?resolution=fixed&classification=components&query_format=advanced&product=nss&target_milestone=3.47 compatibility nss 3.47.1 shared libraries are backward compatible with all older nss 3.x shared libraries...
Enc Dec MAC Output Public Key as CSR
te request */ cr = cert_createcertificaterequest(subject, spki, null); if (!cr) { pr_fprintf(pr_stderr, "unable to make certificate request\n"); rv = secfailure; goto cleanup; } arena = port_newarena(der_default_chunksize); if (!arena) { fprintf(stderr, "out of memory"); rv = secfailure; goto cleanup; } exthandle = cert_startcertificaterequestattributes(cr); if (exthandle == null) { port_freearena (arena, pr_false); rv = secfailure; goto cleanup; } cert_finishextensions(exthandle); cert_finishcertificaterequestattributes(cr); /* der encode the request */ encoding = sec_asn1encodeitem(arena, null, cr, sec_asn1_get(cert_certificatereques...
NSS Sample Code sample2
fer; ivitem.data = giv; ivitem.len = sizeof(giv); secparam = pk11_paramfromiv(ciphermech, &ivitem); if (secparam == null) { fprintf(stderr, "failure to set up pkcs11 param (err %d)\n", pr_geterror()); goto out; } /* sample data we'll encrypt and decrypt */ strcpy(data, "encrypt me!"); fprintf(stderr, "clear data: %s\n", data); /* ========================= start section ============================= */ /* if using the the same key and iv over and over, stuff before this */ /* section and after this section needs to be done only once */ /* encrypt data into buf1.
nss tech note4
}; static const secitem myoiditem = { (secitemtype) 0, (unsigned char *)myoid, sizeof(myoid) }; secitem myextvalue; mycertextdata data; secstatus rv = cert_findcertextensionbyoid(cert, &myoiditem, &myextvalue); if (rv == secsuccess) { sec_asn1decodercontext * context = sec_asn1decoderstart(null, &data, mycertexttemplate); rv = sec_asn1decoderupdate( context, (const char *)(myextvalue.data), myextvalue.len); if (rv == secsuccess) { /* now you can extract info from secitem fields of your extension data structure */ /* see "misc helper functions" below */ .......
nss tech note8
a sid (or sslsessionid struct) contains all the info needed to restart the ssl session at a later time on another socket.
NSS Tools sslstrength
step-up step up is a mode where the connection starts out with 40-bit encryption, but due to a 'change-cipher-spec' handshake, changes to 128-bit encryption.
Notes on TLS - SSL 3.0 Intolerant Servers
firefox 2 and later starting with firefox 2, support for ssl 2.0 has been disabled by default; unless it is expressly re-enabled by the user using about:config.
PKCS11 FAQ
MozillaProjectsNSSPKCS11FAQ
once nss starts using a token for a given operation (like s/mime or ssl), it works hard to keep using that same token (so keys don't get moved around).
PKCS11 module installation
provisioning pkcs #11 modules using the pkcs11 api starting with firefox 58, extensions can use the pkcs11 browser extension api to enumerate pkcs #11 modules and make them accessible to the browser as sources of keys and certificates.
PKCS #11 Module Specs
if the value is quoted, then the value is terminated with and ending quote of the form ', ", ), ], }, or > matching the respective starting quote.
PKCS 12 functions
sec_pkcs12decodergetcerts mxr 3.4 and later sec_pkcs12decoderimportbags mxr 3.2 and later sec_pkcs12decoderiterateinit mxr 3.10 and later sec_pkcs12decoderiteratenext mxr 3.10 and later sec_pkcs12decodersettargettokencas mxr 3.8 and later sec_pkcs12decoderstart mxr 3.2 and later sec_pkcs12decoderupdate mxr 3.2 and later sec_pkcs12decodervalidatebags mxr 3.2 and later sec_pkcs12decoderverify mxr 3.2 and later sec_pkcs12destroyexportcontext mxr 3.2 and later sec_pkcs12enablecipher mxr 3.2 and later ...
Build instructions
(the free edition works, and other versions like visual studio 2008 and visual studio 2012 may also work.) use start-shell-msvc2010.bat from mozillabuild to get a bash shell with the path already configured, and execute these instructions from within that bash shell.
FC_DigestUpdate
description fc_digestupdate starts or continues a multi-part digest operation.
FC_InitToken
(user certs are the certificates that have their associated private keys in the key database.) a user must be able to call fc_inittoken() without logging into the token (to assume the nss user role) because either the user's password hasn't been set yet or the user forgets the password and needs to blow away the password-encrypted private key database and start over.
FC_SignUpdate
description fc_signupdate starts or continues a multi-part signature operation.
FC_VerifyUpdate
description fc_verifyupdate starts or continues a multi-part signature verification operation where the signature is an appendix to the data.
NSS environment variables
3.12 nss_fips string ("fips","true","on","1") will start nss in fips mode.
NSS tools : pk12util
return codes o 0 - no error o 1 - user cancelled o 2 - usage error o 6 - nls init error o 8 - certificate db open error o 9 - key db open error o 10 - file initialization error o 11 - unicode conversion error o 12 - temporary file creation error o 13 - pkcs11 get slot error o 14 - pkcs12 decoder start error o 15 - error read from import file o 16 - pkcs12 decode error o 17 - pkcs12 decoder verify error o 18 - pkcs12 decoder validate bags error o 19 - pkcs12 decoder import bags error o 20 - key db conversion version 3 to version 2 error o 21 - cert db conversion version 7 to version 5 error o 22 - cert and key dbs patch error o 23 - get default cert db error o 24 - find cert by nickna...
gtstd.html
upgraded documentation may be found in the current nss reference getting started with ssl chapter 2 getting started with ssl this chapter describes how to set up your environment, including certificate and key databases.
SSL functions
sl_optionsetdefault mxr 3.2 and later ssl_peercertificate mxr 3.2 and later ssl_preencryptedfiletostream mxr 3.2 and later ssl_preencryptedstreamtofile mxr 3.2 and later ssl_rehandshake mxr 3.2 and later ssl_rehandshakewithtimeout mxr 3.11.4 and later ssl_resethandshake mxr 3.2 and later ssl_restarthandshakeaftercertreq mxr 3.2 and later ssl_restarthandshakeafterservercert mxr 3.2 and later ssl_revealcert mxr 3.2 and later ssl_revealpinarg mxr 3.2 and later ssl_revealurl mxr 3.2 and later ssl_securitystatus mxr 3.2 and later ssl_setmaxservercachelocks mxr 3.4 and later ssl_setpkcs11pinarg...
NSS Tools certutil
starting from nss 3.35, the database format was upgraded to support sqlite as described in this document.
NSS Tools pk12util
error codes pk12util can return the following values: 0 - no error 1 - user cancelled 2 - usage error 6 - nls init error 8 - certificate db open error 9 - key db open error 10 - file initialization error 11 - unicode conversion error 12 - temporary file creation error 13 - pkcs11 get slot error 14 - pkcs12 decoder start error 15 - error read from import file 16 - pkcs12 decode error 17 - pkcs12 decoder verify error 18 - pkcs12 decoder validate bags error 19 - pkcs12 decoder import bags error 20 - key db conversion version 3 to version 2 error 21 - cert db conversion version 7 to version 5 error 22 - cert and key dbs patch error 23 - get default cert db error 24 - find cert by nickname error 25 - create export co...
NSS Tools sslstrength
step-up step up is a mode where the connection starts out with 40-bit encryption, but due to a 'change-cipher-spec' handshake, changes to 128-bit encryption.
NSS tools : pk12util
return codes o 0 - no error o 1 - user cancelled o 2 - usage error o 6 - nls init error o 8 - certificate db open error o 9 - key db open error o 10 - file initialization error o 11 - unicode conversion error o 12 - temporary file creation error o 13 - pkcs11 get slot error o 14 - pkcs12 decoder start error o 15 - error read from import file o 16 - pkcs12 decode error o 17 - pkcs12 decoder verify error o 18 - pkcs12 decoder validate bags error o 19 - pkcs12 decoder import bags error o 20 - key db conversion version 3 to version 2 error o 21 - cert db conversion version 7 to version 5 error o 22 - cert and key dbs patch error o 23 - get defa...
Necko Architecture
an nsistreamlistener is told when the uri transaction has "started," when data is available (in the case of reading data), and when it has "stopped." it is up to the nsistreamlistener implementation to decide what to do with these various notifications.
Necko FAQ
a word rhyming with gecko and starting with the same letters as networking.
Necko Interfaces Overview
http) maps uri string to nsiuri instance via newuri method creates nsichannel instance from nsiuri instance via newchannel method nsistreamlistener : nsirequestobserver implemented by the consumer of a nsichannel instance passed to nsichannel::asyncopen method nsirequestobserver::onstartrequest - notifies start of async download nsistreamlistener::ondataavailable - notifies presence of downloaded data nsirequestobserver::onstoprequest - notifies completion of async download, possibly w/ error nsiloadgroup : nsirequest attribute of a nsirequest channel impl adds itself to its load group during invocation of asyncopen channel impl removes itself from its load group when dow...
Proxies in Necko
proxies and local hosts requires gecko 9.0(firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) starting with gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6), proxy servers are not used when accessing hosts with no dots in their names, if manual proxy configuration is used and "<local>" is added to the "no proxy for:" text field field.
Pork
the core of pork is a c++ parser that provides exact character positions for the start and end of every ast node, as well as the set of macro expansions that contain any location.
Rhino history
the rhino project was started at netscape in the autumn of 1997.
Rhino shell
starting with rhino 1.7 this options is no longer available.
Rebranding SpiderMonkey (1.8.5)
if you have failed to insert your brand name in any of the previous steps where it is called for, you must delete this build directory and restart this process from the beginning.
Creating JavaScript jstest reftests
performance tests or stress tests tests of spidermonkey's comformance to the ecmascript standard a brief history: in 2017, spidermonkey started comsuming test262, a comprehensive tests suite for ecmascript implementations.
Creating JavaScript tests
even tests that check for polynomial time complexity will start to fail in a few years when they have sped up enough to run faster than the granularity of the os scheduler or when run on platforms with higher latencies than your development workstation.
FOSS
getting started here.
Invariants
even if the function is native, there is serious trouble: js_newobject with null parent argument calculates the parent from cx->fp->scopechain, which can be stale if we're on trace.) the chain of properties starting at any jsshape and chasing jsshape::parent never forms a cycle and does not contain any duplicate jsscopeproperty::slot values other than -1.
Property cache
(informally: if another property shadows x'.p, the shape of x' will change.) o---->o---->o---->o ^x ^x' ^object.prototype, perhaps (----> indicates the proto relation) scope chain shadowing guarantee — if at time t0 the object x has shape s and a name lookup for p starting at scope chain head x finds p on an object x' of shape s', where x !== x'; and the lookup called no resolve hooks or non-native lookup ops; and each object examined along the parent chain, except possibly the one along whose prototype chain x' was found, had no prototype or was a block object; and at time t1 x has shape s and x' has shape s'; and no shape-regenerating gc occurred; then at t1 t...
SpiderMonkey Internals: Thread Safety
note: starting in gecko 12.0, jsruntime is single-threaded.
INT_FITS_IN_JSVAL
starting in spidermonkey 1.8.5, jsval can store a full 32-bit integer, so this check isn't needed any longer for 32-bit integers.
INT_TO_JSVAL
starting in spidermonkey 1.8.5, jsval can store a full 32-bit integer, so this check isn't needed any longer for 32-bit integers.") }} if i does not fit into a jsval (see int_fits_in_jsval), the behavior is undefined.
JS::Add*Root
description the js::add*root and functions add a c/c++ variable to the garbage collector's root set, the set of variables used as starting points each time the collector checks to see what memory is reachable.
JS::CallArgs
embedders should start internally switching away from using argc and vp directly, except to create a callargs.
JSClass
obsolete since jsapi 16the jsclass_new_resolve_gets_start flag further affects this hook.
JS_AddExternalStringFinalizer
in a js_threadsafe build, this function must be invoked on the primordial thread only, at startup—or else the entire program must single-thread itself while loading a module that calls this function.
JS_Add*Root
description the js_add*root and functions add a c/c++ variable to the garbage collector's root set, the set of variables used as starting points each time the collector checks to see what memory is reachable.
JS_ClearContextThread
each request runs from start to finish on a single thread.
JS_InitClass
note: starting with spidermonkey 1.8, the prototype and constructor are set up with stub getter and setter operations instead of class operations.
JS_LookupProperty
these functions all have similar behavior: the search starts with obj and proceeds along the prototype chain.
JS_MakeStringImmutable
in memory it is represented as a pointer to the other string and a pair of integers for the substring's starting point and length, rather than as a separate copy of all the characters.
JS_NewObject
starting with gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5), you can create a new object in a specific compartment using the components.utils.createobjectin() method.
JS_NewRegExpObject
m jsreg_sticky only match starting at lastindex.
JS_NewUCString
description js_newstring creates and returns a new string, using the memory starting at buf and ending at buf + length as the character storage.
JS_THREADSAFE
*/ js_endrequest(cx); a request is always associated with a specific jscontext and runs from start to finish on a single thread.
Profiling SpiderMonkey
when we have js scriptable profiling options available for all tier 1 platforms, we'll look at adding global start/stop profiling functions.
SpiderMonkey 1.8.8
js_isscriptframe jsclass_new_resolve_gets_start flag js_newnumbervalue api changes break out and discuss all api changes here...
SpiderMonkey 17
js_isscriptframe jsclass_new_resolve_gets_start flag js_newnumbervalue js_finalizestub js_clearnewbornroots jsclass_mark_is_trace flag js_setscriptstackquota api changes break out and discuss all api changes here...
SpiderMonkey 45
181175) js::disposeperformancemonitoring (bug 1208747) js::setstopwatchismonitoringcpow (bug 1156264) js::getstopwatchismonitoringcpow (bug 1156264) js::setstopwatchismonitoringjank (bug 1156264) js::getstopwatchismonitoringjank (bug 1156264) js::isstopwatchactive (bug 674779) js::getperfmonitoringtestcpurescheduling (bug 1181175) js::addcpowperformancedelta (bug 1181175) js::setstopwatchstartcallback (bug 1208747) js::setstopwatchcommitcallback (bug 1208747) js::setgetperformancegroupscallback (bug 1208747) js_stringhasbeeninterned renamed to js_stringhasbeenpinned (bug 1178581) js_internjsstring renamed to js_atomizeandpinjsstring (bug 1178581) js_internstringn renamed to js_atomizeandpinstringn (bug 1178581) js_internstring renamed to js_atomizeandpinstring (bug 1178581) js_i...
SavedFrame
if the asynchronous call was started in a descendant frame to which the requester of the property does not have access, this will be the generic string "async".
TPS Pref Lists
for example: var prefs1 = [ { name: "browser.startup.homepage", value: "http://www.getfirefox.com" }, { name: "browser.urlbar.maxrichresults", value: 20 }, { name: "browser.tabs.autohide", value: true } ]; pref lists and phase actions the only actions supported for preference asset lists are modify and verify: prefs.modify prefs.verify sync only syncs certain preferences.
Zest
the zest part of the talk starts at 23:47.
Secure Development Guidelines
most memory allocators use a linked list or binary tree bbv: off-by-one the array index starts at 0 not at 1 char array[1024]; array[0] = first element!
Security and the jar protocol
so starting with gecko 1.8.0.15 and 1.8.1.10, the jar: protocol is only allowed if the mime type of the file is application/java-archive.
Gecko object attributes
applied to role_cell hypertext attributes formatting "block" if the object uses block formatting, and thus starts on a new line and ends with a hard line break that is not visible in the actual text.
Implementation Details
msaa at-spi how to find the content window and load the document in xul-based clients, screen readers may need to find the content window so that they know where to start grabbing the accessible tree, in order to load the current document into a buffer in their own process.
AT APIs Support
however most of described features are supported starting from gecko 1.9.0 (firefox 3.0).
XForms Accessibility
assistive technologies api for xforms is supported starting from firefox 3 (gecko 1.9).
DocShell
docshell is the second iteration of what originally started out as webshell.
Embedded Dialog API
the mfc example implements its promptservice in a separate dll, and overrides the default promptservice only if it is able to load the override dll at application startup.
The Places database
the position column numbers each of the peers beneath a given parent starting with 0 and incrementing higher with each addition.
Places Developer Guide
istory browserhistory.removepage(oururi); // remove all visits for multiple urls from history var uristodelete = [oururi]; // will call nsinavhistoryobserver.onbeginupdatebatch/onendupdatebatch var donotify = false; browserhistory.removepages(uristodelete, uristodelete.length, donotify); // remove all visits within a given time period var enddate = date.now() * 1000; // now, in microseconds var startdate = enddate - (7 * 86400 * 1000 * 1000); // one week ago, in microseconds browserhistory.removepagesbytimeframe(startdate, enddate); // remove all pages for a given host var entiredomain = true; // will delete from all hosts from the given domain browserhistory.removepagesfromhost("mozilla.com", true); // remove all history visits browserhistory.removeallpages(); querying history the code samp...
Retrieving part of the bookmarks tree
this document provides a quick start for those wishing to quickly retrieve a portion of the bookmarks tree.
FUEL
we want to start with areas that will provide the most benefit.
SMILE
we want to start with areas that will provide the most benefit.
XML Extras
begins with lower case letter xmlhttprequest creation new activexobject("msxml2.xmlhttp") new xmlhttprequest() xmlhttprequest.send("some string") ok ok starting with milestone 0.9.7 (actually nightly 2001-11-28).
XPCOM Glue without mozalloc
starting with xulrunner 2.0, the frozen linkage dependent glue (xpcomglue_s.lib on windows, libxpcomglue_s.a on linux and mac) is dependent on the new infallible memory allocation routines (mozalloc).
XPCOM glue
MozillaTechXPCOMGlue
then, the code must call xpcomgluestartup, which will dynamically link against the xpcom runtime.
XPCOM array guide
MozillaTechXPCOMGuideArrays
for example, to remove three objects, starting at the third object in the array (that is, the object with index value 2): myarray.removeobjectsat(2, 3); nstarray<t> nstarray<t> is a typesafe array for holding various objects.
Avoiding leaks in JavaScript XPCOM components
garbage collection garbage collection is generally used to refer to algorithms that (1) determine which objects are still needed by starting from a set of roots and finding all objects reachable from those objects and (2) returning all remaining objects to the heap.
Setting up the Gecko SDK
this writes to the complist.dat file in your profile) regxpcom -x "c:\program files (x86)\mozilla firefox\" -c "c:\users\<user>\appdata\roaming\mozilla\firefox\profiles\<profile>\compreg.dat" -d "c:\users\<user>\appdata\roaming\mozilla\firefox\profiles\<profile>\xpti.dat" "c:\users\<user>\appdata\roaming\mozilla\firefox\profiles\<profile>\extensions\bob@george.com\cspecialthing.dll" now if you start up firefox using that profile, you should have your new component installed.
Creating XPCOM components
s in xpcom coding for the registration process the registration methods creating an instance of your component weblock1.cpp using xpcom utilities to make things easier xpcom macros generic xpcom module macros common implementation macros declaration macros weblock2.cpp string classes in xpcom using strings nsembedstring and nsembedcstring smart pointers starting weblock getting called at startup registering for notifications getting access to the category manager providing access to weblock creating the weblock programming interface defining the weblock interface in xpidl the xpidl syntax scriptable interfaces subclassing nsisupports the web locking interface implementing weblock declaration macros representing re...
Making cross-thread calls using runnables
public: picalculatetask(picallback callback, int digits) : mcallback(callback) , mdigits(digits) { } ns_imethod run() { nscstring result; calculatepi(mdigits, result); nscomptr<nsirunnable> resultrunnable = new piresulttask(mcallback, result); ns_dispatchtomainthread(resultrunnable); } private: picallback mcallback; int mdigits; }; putting it all together to start a new thread, create it using the thread manager: #include "nsxpcomcidinternal.h" void calculatepiasynchronously(int digits, picallback callback) { // to create a new thread, get the thread manager nscomptr<nsithreadmanager> tm = do_getservice(ns_threadmanager_contractid); nscomptr<nsithread> mythread; nsresult rv = tm->newthread(0, 0, getter_addrefs(mythread)); if (ns_failed(rv)) { ...
XPCOM guide
MozillaTechXPCOMGuide
mozilla::services namespacethe services c++ namespace offers an easy and efficient alternative for obtaining a service as compared to the indirect xpcom approach: getservice(), callgetservice(), etc methods are expensive and should be avoided when possible.receiving startup notificationssometimes it's necessary for xpcom components to receive notifications as to the progress of the application's startup process, so they can start new services at appropriate times, for example.xpcom array guidemozilla has many array classes because each array is optimized for a particular usage pattern.
Components.isSuccessCode
const cc = components.classes; const ci = components.interfaces; const cr = components.results; // global flags polled externally var copyfailed = false; var copyinprogress = false; function copybufferedstream(instream, outstream) { var copyobserver = { onstartrequest: function(request, context) { copyinprogress = true; }, onstoprequest: function(request, context, statuscode) { copyinprogress = false; // did the copy fail?
Components.utils.evalInSandbox
the evaluated code is assumed to start at line 25 of the document at that url.
Components.utils.importGlobalProperties
the downside of using hiddendomwindow is that on startup of firefox, the hiddendomwindow objects cannot be accessed until it is fully loaded.
Components.utils.unload
this can be particularly handy with restartless (boostrapped) extensions, so that you can unload an old version of a code module when a new version of your add-on is installed.
PyXPCOM
this article gives you a head start to pyxpcom.
Using components
commonly, we start our scripts like so: var cc = components.classes; var ci = components.interfaces; if we want to get a hold of a component, we then do something like: var rc = cc["@mozilla.org/registry;1"]; var rs = rc.getservice(ci.nsiregistry); see also: xpcshell -- how to get a command line interface to javascript more info as was already stated, it is common to start addon scripts like: var cc = components.classes; var ci = components.interfaces; there is also another way to start, which is exactly equivalent to the above.
HOWTO
however, when you start your script, it exits immediately, before the network request returns.
xpcshell
read xpconnect:using components to get started with that.
Language bindings
this can be particularly handy with restartless (boostrapped) extensions, so that you can unload an old version of a code module when a new version of your add-on is installed.components.utils.unwaivexraysundo a previous call to components.utils.waivexrays(), restoring xray vision for the caller.components.utils.waivexrayswaives xray vision for an object, giving the caller a transparent wrapper to the underlying object.javaxpcomjavaxpcom a...
BeginReading
example code // count the number of times a particular character appears in the string pruint32 countchar(const nsacstring& str, char c) { const char* start = str.beginreading(); const char* end = str.endreading(); pruint32 count = 0; while (start != end) { if (*start++ == c) ++count; } return count; } see also length, endreading ...
Cut
void cut( index_type acutstart, size_type acutlength ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
BeginReading
example code // count the number of times a particular character appears in the string pruint32 countchar(const nsastring& str, prunichar c) { const prunichar* start = str.beginreading(); const prunichar* end = str.endreading(); pruint32 count = 0; while (start != end) { if (*start++ == c) ++count; } return count; } see also length ...
Cut
void cut( index_type acutstart, index_type acutlength ); parameters acutstart [in] the starting index of the section to remove, measured in storage units.
IAccessible2
the number generator would emit numbers starting at 1.
amIWebInstallPrompt
methods confirm() gets a confirmation that the user wants to start the installs.
mozIJSSubScriptLoader
as of gecko 8.0, scripts are loaded from the startup cache where possible.
mozIRegistry
i'm just starting to understand the role it plays in this and it isn't really under my jurisdiction, so there's nothing about it here right now.
mozIStorageFunction
javascript starting in gecko 1.9.1.4 (firefox 3.0.15), you can directly pass your function into the mozistorageconnection method mozistorageconnection, like this: dbconn.createfunction("square", 1, function(aarguments) { let value = aarguments.getint32(0); return value * value; }); // run some query that uses the function.
mozIStoragePendingStatement
starting with gecko 1.9.2, this information is no longer provided and the method doesn't return a value.
nsIAccessNode
obsolete since gecko 2.0 innerhtml domstring the innerhtml for the dom node this is a text string of all the markup inside the dom node, not including the start and end tag for the node.
nsIAccessibleTextChangeEvent
start long returns offset of changed text in accessible.
nsIApplicationUpdateService
downloadupdate() starts downloading a software update.
nsIAsyncStreamCopier
1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void asynccopy(in nsirequestobserver aobserver, in nsisupports aobservercontext); void init(in nsiinputstream asource, in nsioutputstream asink, in nsieventtarget atarget, in boolean asourcebuffered, in boolean asinkbuffered, in unsigned long achunksize, in boolean aclosesource, in boolean aclosesink); methods asynccopy() starts the copy operation.
nsIBrowserHistory
this can be and is called before the page is actually added to history, since the page isn't added until it actually starts loading.
nsICacheListener
oncacheentrydoomed() this method is called when the processing started by nsicachesession.doomentry() is completed.
nsICacheService
note: starting in gecko 2.0, cache i/o is handled asynchronously.
nsICacheVisitor
return value returns true to start visiting all entries for this device, otherwise returns false to advance to the next device.
nsICycleCollectorListener
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) the order of calls will be call to begin(); then for every node in the graph a call to noteobject() and calls to noteedge() for every edge starting at that node; then a call to begindescriptions(); then for every black node in the cycle collector graph a call to either describerefcountedobject() or to describegcedobject(); and then a call to end().
nsIDNSService
to access the service, use: var dnsservice = components.classes["@mozilla.org/network/dns-service;1"] .createinstance(components.interfaces.nsidnsservice); note: starting in gecko 7.0, the "happy eyeballs" strategy is used to reduce lengthy timeouts when attempting backup connections during attempts to connect from clients that have broken ipv6 connectivity.
nsIDOMChromeWindow
this method tells the window manager to start dragging the window.
nsIDOMEvent
examples of epoch time are the time of the system start or 0:0:0 utc 1st january 1970.
nsIDOMFileList
gecko 1.9.2 note starting in gecko 1.9.2, this is also used by the datatransfer object to support dragging and dropping files into web applications.
nsIDOMGeoGeolocation
starting in gecko 1.9.2, you can access this service using: var geolocation = components.classes["@mozilla.org/geolocation;1"] .getservice(components.interfaces.nsidomgeogeolocation); note: if nsidgeogeolocation throws an exception when importing, try using this: var geolocation = components.classes["@mozilla.org/geolocation;1"] .getservice(compon...
nsIDOMMouseScrollEvent
must be one of "abort", "error", "load", "loadstart", or "progress".
nsIDOMMozNetworkStats
start date start date of the stats samples.
nsIDOMProgressEvent
must be one of "abort", "error", "load", "loadstart", or "progress".
nsIDOMStorageItem
1.0 66 introduced gecko 1.8 inherits from: nsisupports last changed in gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) gecko 1.9.1 note starting in gecko 1.9.1 (firefox 3.5), this is only used for session storage; previously, it was also used for global storage.
nsIDOMXPathEvaluator
note: prior to gecko 1.9, you could call this method on documents other than the one you planned to run the xpath against; starting with gecko 1.9, however, you must call it on the same document.
nsIDOMXULElement
starting in gecko 1.8 this is a live list of elements rather than a snapshot.
nsIDebug2
iptable adds access to additional information in debug builds of mozilla code by expanding upon the features in nsidebug 1.0 66 introduced gecko 1.9.2 inherits from: nsidebug last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) attributes attribute type description assertioncount long the number of assertions since process start.
nsIDownload
starttime long long the time at which the transfer was started.
nsIDownloadManagerUI
reason_new_download 1 when opening the download manager user interface, this value indicates that the user interface is being displayed because a new download is being started.
nsIEditorIMESupport
handles the start of inline input composition.
nsIEffectiveTLDService
remarks note: prior to gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1), this method worked if you passed host strings starting with a period (".").
ExtensionManager (Toolkit)
note: this api is obsolete starting in gecko 2.0, and has been replaced by the new add-on manager.
nsIFeedProcessor
void parseasync( in nsirequestobserver requestobserver, in nsiuri uri ); parameters requestobserver the observer to be notified when parsing starts and stops.
nsIFile
in unix, hidden files start with a period.
nsIFilePicker
this should be set this before calling open() or show() to specify a starting point.
nsIFrameLoader
loadframe() starts loading the frame.
nsIHttpActivityObserver
activity_subtype_response_start 0x5003 the http response has started to arrive.
nsIHttpChannelInternal
the onstartrequest and onstoprequest events are still delivered and the listener gets full control over the socket if and when nsihttpupgradelistener.ontransportavailable() is delivered.
nsIMacDockSupport
note: the hidden window of firefox (services.appshel.hiddendomwindow) loads on browser startup, so if you would like to access it on startup of the browser make sure to check and wait for the window to be loaded.
nsIMemoryMultiReporter
attributes attribute type description explicitnonheap print64 the sum of all of this multi-reporter's measurements that have a path that starts with "explicit" and are of the kind kind_nonheap.
nsIMessageWakeupService
by using this service, you can avoid starting those components until they're needed.
nsIMsgAccountManagerExtension
you have to register any new account manager extensions via the the category manager at start up.
nsIMsgFilterCustomAction
filtertype manual only) * @param filtertype type of filter being applied * @param msgwindow message window */ void apply(in nsiarray msghdrs /* nsimsgdbhdr array */, in autf8string actionvalue, in nsimsgcopyservicelistener copylistener, in nsmsgfiltertypetype filtertype, in nsimsgwindow msgwindow); /* does this action start an async action?
nsIMsgProtocolInfo
canloginatstartup boolean true if the account type can perform biff during startup.
nsIMsgThread
getfirstunreadchild() nsimsgdbhdr getfirstunreadchild(); enumeratemessages() nsisimpleenumerator enumeratemessages(in nsmsgkey parent); parameters parent a key representing the message to start enumerating with.
nsIMsgWindow
if you are checking this flag, you need to clear it before you start your operation since there's no convenient place to clear it.
nsINavBookmarkObserver
onbeginupdatebatch() this method notifies this observer that a batch transaction has started.
nsINavHistoryResultNode
these indices start at 0 and increase in the order at which the nodes appear in the bookmark folder.
nsINavHistoryService
this can be and is called before the page is actually added to history, since the page isn't added until it actually starts loading.
nsIObserver
ces.nsiobserverservice); observerservice.addobserver(this, "mytopicid", false); }, unregister: function() { var observerservice = components.classes["@mozilla.org/observer-service;1"] .getservice(components.interfaces.nsiobserverservice); observerservice.removeobserver(this, "mytopicid"); } } instantiation - this should be fired once you're ready to start observing (for example a window's load event).
nsIPluginHost
it will *always malloc()* output buffer (caller is responsible to free it) if input buffer starts with lf, which comes from 4.x spec http://developer.netscape.com/docs/manuals/communicator/plugin/pgfn2.htm#1007754 "if no custom headers are required, simply add a blank line ('\n') to the beginning of the file or buffer.", it skips that '\n' and considers rest of the input buffer as data.
nsIPrintingPrompt
the service is automatically registered at start up.
nsIProtocolProxyService
each proxy filter is registered with an associated position that determines the order in which the filters are applied (starting from position 0).
nsISHistory
requestedindex long the index of the last document that started to load that is not yet finished loading.
nsIScreen
gecko 1.9.2 note starting in gecko 1.9.2, gecko running on microsoft windows reports 24 bits per pixel instead of 32 bits per pixel on 8-bits per color component displays, since this is typically what the caller is actually looking for.
nsIScriptableIO
files are located by starting at a known directory, specified using a location key string.
nsISelection3
"extend" leaves the start of the selection unchanged, and applies movement direction/granularity to the end of the selection.
nsISocketTransport
inherits from: nsitransport last changed in gecko 6.0 (firefox 6.0 / thunderbird 6.0 / seamonkey 2.3) note: connection setup is triggered by opening an input or output stream, it does not start on its own.
nsISound
note: this second usage is obsolete starting in gecko 1.9.2.
nsISpeculativeConnect
the code implementing this method may use this information to start a tcp and/or ssl level handshake for that resource immediately so that it is ready (or at least in the process of becoming ready) when the transaction is actually submitted.
nsIStreamListener
so, in all the three methods - ondataavailable(), nsirequestobserver.onstartrequest() and nsirequestobserver.onstoprequest() have to be implemented.
nsITaskbarProgress
widget/public/nsitaskbarprogress.idlscriptable starting in windows 7, applications can display a progress notification in the taskbar.
nsITaskbarWindowPreview
if the enablecustomdrawing attribute is true, the controller you implement will start receiving calls to its nsitaskbarpreviewcontroller.drawpreview() and nsitaskbarpreviewcontroller.drawthumbnail() methods, as well as reads of its width, height, and thumbnailaccessratio attributes.
nsITelemetry
jsval snapshotcapturedstacks([optional] in boolean clear); nsisupports getloadedmodules(); jsval snapshotkeyedhistograms(in uint32_t adataset, in boolean asubsession, in boolean aclear); void sethistogramrecordingenabled(in acstring id, in boolean enabled); void asyncfetchtelemetrydata(in nsifetchtelemetrydatacallback acallback); double mssinceprocessstart(); void scalaradd(in acstring aname, in jsval avalue); void scalarset(in acstring aname, in jsval avalue); void scalarsetmaximum(in acstring aname, in jsval avalue); jsval snapshotscalars(in uint32_t adataset, [optional] in boolean aclear); void keyedscalaradd(in acstring aname, in astring akey, in jsval avalue); void keyedscalarset(in acstrin...
nsIThreadPool
once there are more than this many idle worker threads, the idle threads start getting destroyed.
nsITreeView
code that is forced to march down the view looking at levels can optimize the march by starting at afterindex+1.
nsIURLParser
clen schemepos schemelen authoritypos authoritylen pathpos pathlen parseuserinfo() userinfo = <username>:<password> void parseuserinfo( in string userinfo, in long userinfolen, out unsigned long usernamepos, out long usernamelen, out unsigned long passwordpos, out long passwordlen ); parameters userinfo userinfolen usernamepos usernamelen passwordpos passwordlen notes starting in gecko 9.0 (firefox 9.0 / thunderbird 9.0 / seamonkey 2.6), this no longer treats the semicolon as a "parameter string" marker.
nsIUpdatePrompt
showupdatedownloaded() shows a message advising the user that an update has been downloaded, and that the user should restart the application in order to install it.
nsIUserInfo
toolkit/components/startup/public/nsiuserinfo.idlscriptable these are things the system may know about the current user.
nsIWebBrowser
the embedder may walk the entire dom starting from this value.
nsIWebBrowserFind
wrapfind boolean whether the search wraps around to the start (or end) of the document if no match was found between the current position and the end (or beginning).
nsIWebBrowserFindInFrames
attributes attribute type description currentsearchframe nsidomwindow frame at which to start the search.
nsIWebBrowserPersist
var privacycontext = sourcewindow.queryinterface(components.interfaces.nsiinterfacerequestor) .getinterface(components.interfaces.nsiwebnavigation) .queryinterface(components.interfaces.nsiloadcontext); //save file to target obj_persist.saveuri(obj_uri,null,null,null,null,obj_targetfile,privacycontext); // starting with firefox 36 saveuri takes 8 parameters when called.
nsIWebSocketChannel
if asyncopen() returns successfully, the protocol implementation promises to call at least onstart and onstop of the listener.
nsIWinTaskbar
1.0 66 introduced gecko 1.9.2 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) starting with windows 7, applications gain some control over their appearance in the taskbar.
nsIWindowMediator
note: starting in gecko 8.0, the returned value is an nsidomwindow; previously, it was an nsidomwindowinternal.
nsIXMLHttpRequestUpload
introduced gecko 1.9.1 inherits from: nsidomeventtarget last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) attributes attribute type description onabort nsidomeventlistener onerror nsidomeventlistener onload nsidomeventlistener onloadstart nsidomeventlistener onprogress nsidomeventlistener see also nsixmlhttprequest nsixmlhttprequesteventtarget xmlhttprequest using xmlhttprequest ...
nsIXPConnect
exceptions thrown missing exception missing description flagsystemfilenameprefix() preconfigure xpcnativewrapper automation so that when a scripted caller whose filename starts with filenameprefix accesses a wrapped native that is not flagged as "system", the wrapped native will be automatically wrapped with an xpcnativewrapper.
nsIXULTemplateBuilder
rootresult nsixultemplateresult readonly: the virtual result representing the starting reference point, determined by calling the query processor's translateref method with the root node's ref attribute as an argument.
nsIZipReader
starting in gecko 10.0 (firefox 10.0 / thunderbird 10.0 / seamonkey 2.7), the nsizipreader api supports a limited 8 bit code page usage.
nsIZipWriter
reate it, and because zip is a copy of the directory cu.reporterror('+' + relpath); //makes it relative to directory the parent dir (dir[0]) so it can succesfully populate files with same names but different folders in this parent dir, needed because recursviely going through all dirs var saveinzipas = relpath.substr(1); //need to get ride of the first '\' forward slash at start otherwise it puts every file added in a folder of its own.
nsMsgSearchAttrib
st nsmsgsearchattribvalue label = 48; /* mail only...can search by label */ const nsmsgsearchattribvalue hdrproperty = 49; // uses nsimsgsearchterm::hdrproperty const nsmsgsearchattribvalue folderflag = 50; // uses nsimsgsearchterm::status const nsmsgsearchattribvalue uint32hdrproperty = 51; // uses nsimsgsearchterm::hdrproperty // 52 is for showing customize - in ui headers start from 53 onwards up until 99.
nsMsgSearchTerm
at the start of this macro, which means the macro // needs to enumerate the non-string attributes.
XPCOM Interface Reference by grouping
ry nsiglobalhistory nsiglobalhistory2 nsiglobalhistory3 ssl nsibadcertlistener2 system action nsicancelable application application nsiapplicationupdateservice nsiappshell nsiappshellservice nsiappstartup xul nsixulappinfo nsixulruntime nsixultemplatebuilder nsixultemplatequeryprocessor nsixultemplateresult bookmark livemark nsilivemarkservice nsinavbookmarkobserver nsinavbookmarksservice ...
Setting HTTP request headers
this.myprogid, filespec, location, type); log("----------------------------> registerself"); var catmgr = components.classes["@mozilla.org/categorymanager;1"].getservice(components.interfaces.nsicategorymanager); catmgr.addcategoryentry("app-startup", this.myname, this.myprogid, true, true); }, getclassobject: function (compmgr, cid, iid) { log("----------------------------> getclassobject"); return this.myfactory; }, mycid: components.id("{9cf5f3df-2505-42dd-9094-c1631bd1be1c}"), myprogid: "@dougt/myhttplistener;1", myname: "simple http listener", myfactory: { queryinterface:...
Frequently Asked Questions
if you're looking here just to learn about nscomptrs, you'll get a better introduction in the getting started guide.
Reference Manual
if you've never use nscomptrs before, you might want to read the getting started guide first.
Using nsIDirectoryService
there are things in the startup process that need these locations at a very early point - even before registering components.
Using nsIPasswordManager
the example below should serve as a starting point: // the host name of the password we are looking for var querystring = 'http://www.example.com'; // ask the password manager for an enumerator: var e = passwordmanager.enumerator; // step through each password in the password manager until we find the one we want: while (e.hasmoreelements()) { try { // get an nsipassword object out of the password manager.
Xptcall Porting Status
<font color="black">partially working</font> netbsd/arm32 mike pumford <mpumford@black-star.demon.co.uk> mike writes: i have started porting to the platform based on the code for linux arm.
XPIDL Syntax
MozillaTechXPIDLSyntax
a `%{' that appears at the beginning of a line is the start of a raw code fragment, which extends until the end of a line that begins with `%}'.
XPIDL
note: starting in gecko 9.0, the older xpidl utility, which was previously used to generate c++ header files, typelib information, and so forth has been replaced with pyxpidl in the gecko sdk.
Xray vision
for example: the detail property of a customevent fired by content could be a javascript object or date as well as a string or a primitive the return value of evalinsandbox() and any properties attached to the sandbox object may be pure javascript objects also, the webidl specifications are starting to use javascript types such as date and promise: since webidl definition is the basis of dom xrays, not having xrays for these javascript types starts to seem arbitrary.
Account Provisioner
the account provisioner is the dialog that first comes up when starting thunderbird.
Autoconfiguration in Thunderbird
guessing if all other mechanisms failed, thunderbird tries to guess the configuration, by trying common server names like imap.<domain>, smtp.<domain>, mail.<domain> etc., and, when a mail server answers, checking whether it supports ssl, starttls and encrypted passwords (cram-md5).
Cached compose window FAQ
to test it start mozilla do new message.
MailNews Filters
i may have missed some places, but that's a start, anyway.
Mailbox
this may seem like a lot of infrastructure just to read messages from a flat file, but it allows us to do it asynchronously, and to have reading local messages fit into the same kind of mechanisms that reading nntp and imap messages do - running urls, getting onstart/stoprunningurl notifications when the url starts/stops, etc.
Adding items to the Folder Pane
a note about the initial rebuild when thunderbird first starts up, the folder pane does an initial rebuild to get the first data it should display.
Building a Thunderbird extension 2: extension file layout
to start with the tutorial, manually create the initial directory structure for the extension as it is depicted above in a folder called myfirstext@jen.zed.
Creating a Custom Column
getting started in this example we will be developing a small extension that will be adding a column that will display the "reply-to:" field of an email (if it exists, it if often not set).
FAQ
mozillazine's getting started tutorial might provide some useful general pointers regarding developing mozilla extensions.
Use SQLite
if you'd like to use an sqlite database in your extension you'll need to look over the storage docs for an api reference, however this code should get you started.
Tips and Tricks from the newsgroups
hunderbird message window (when messageuri, folderuri and gdbview are unknown) determine whether a message has been flagged as junk imap: getting message key of copied message by nsimsgcopyservice::copyfilemessage access the plain text content of the email body get information about attachment without selecting message repeat image display using css sprites scan for new messages at startup and manually scan a folder initiated by user force listeners to run consecutively to prevent pop messages from getting garbled during message retrieval ...
customDBHeaders Preference
getting started to build upon the reply-to column tutorial, i'll describe the process i went through in developing a custom column to display a 'superfluous' column within thunderbird's main view.
Using MAPI with Thunderbird's Windows 7 developer builds
(one way to create an elevated shell is to invoke the command prompt from the start menu, right click, and select run as administrator.) in the elevated shell, change to the objdir/mozilla/dist/bin directory and enter this command: regsvr32 mapiproxy_inuse.dll ...
Using the Mozilla source server
start debugging your program.
WebIDL bindings
if specified on an interface as a whole, this functions like [func] except that the binding code will automatically check whether the caller script has the system principal (is chrome or a worker started from a chrome page) instead of calling into the c++ implementation to determine whether to expose the interface object on the global.
Working with windows in chrome code
abusing the preferences service and not cleaning up after yourself can cause prefs.js to grow large and slow down application startup.
XPI
note: starting in gecko 2.0, xpi files are no longer unpacked when extensions are installed.
Working with ArrayBuffers
we start with the following: // pixelbuffer is a pointer to a rgba pixel buffer of 400x400 image.
Initialization and Destruction - Plugins
note that you cannot count on data being saved this way; the data may be lost if the browser restarts or purges memory.
Streams - Plugins
it is a good idea to check that the file exists in the directory at the start of this method.
URLs - Plugins
char* mydata = "\nhi fred, this is a message from my plug-in!"; uint32 mylength = strlen(mydata) + 1; err = npn_posturlnotify(instance, "mailto:fred@example.com", null, mylength, mydata, false); the example starts by defining the mail message, mydata, and its length, mylength.
Preferences System
reference information about them is available below: preferences system documentation: introduction: getting started | examples | troubleshooting reference: prefwindow | prefpane | preferences | preference | xul attributes use code for a typical preferences window may look like this: <prefwindow id="apppreferences" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <prefpane id="pane1" label="&pane1.title;"> <preferences> <preference id="pref1" name="pref.name"...
DOM Inspector - Firefox Developer Tools
documentation introduction to dom inspector a guided tutorial that will help you get started with dom inspector.
DOM Property Viewer - Firefox Developer Tools
the dom property viewer lets you inspect the properties of the dom as an expandable tree structure, starting from the window object of the current page or the selected iframe.
Breaking on exceptions - Firefox Developer Tools
starting in firefox 80, a disclosure triangle within the tooltip reveals a stack trace.
Examine, modify, and watch variables - Firefox Developer Tools
then start running your code.
Open the debugger - Firefox Developer Tools
there are three ways to open the debugger: select "debugger" from the web developer submenu in the firefox menu (or tools menu if you display the menu bar or are on mac os x) press ctrl + shift + z on windows and linux, or cmd + opt + z on macos (starting in firefox 71; prior to firefox 66, the letter in this shortcut was s).
Step through code - Firefox Developer Tools
if you want to turn this feature off, since firefox 71 you can do so by going to about:config in a new tab, setting the devtools.debugger.features.overlay pref to false, and restarting the browser.
Set event listener breakpoints - Firefox Developer Tools
starting with firefox 69, debugging an application that includes event handlers is simplified because the debugger now includes the ability to automatically break when the code hits an event handler.
Source map errors - Firefox Developer Tools
ressourcen-adresse: moz-extension://c7f0f003-4fcf-49fd-8ec0-c49361266581/background.js source-map-adresse: background.js.map the only workaround is to manually change the map url to a public one (http://localhost:1234/file.map.js) and start a local webserver at this port.
UI Tour - Firefox Developer Tools
right-clicking in the call stack pane opens a context menu with the following items: restart frame restarts execution at the beginning of the current frame.
Debugger.Environment - Firefox Developer Tools
find(name) return a reference to the innermost environment, starting with this environment, that bindsname.
Debugger.Source - Firefox Developer Tools
for scripts created by eval or the function constructor, this may be a synthesized filename, starting with a valid url and followed by information tracking how the code was introduced into the system; the entire string is not a valid url.
Deprecated tools - Firefox Developer Tools
starting firefox 72, you can import a javascript file content in the console input with ctrl + o (cmd + o on macos), as well as saving the console input content to a file using ctrl + s (cmd + s on macos).
Measure a portion of the page - Firefox Developer Tools
when you hold the mouse button down and then drag, you'll start to draw a rectangle, with its x, y, and diagonal dimensions displayed.
Basic operations - Firefox Developer Tools
comparing snapshots starting in firefox 45, you can diff two heap snapshots.
Dominators view - Firefox Developer Tools
starting in firefox 46, the memory tool includes a new view called the dominators view.
Inspecting web sockets - Firefox Developer Tools
control (available starting in firefox 76).
Network Monitor - Firefox Developer Tools
this means you can start debugging a page in, for example, the web console, then switch to the network monitor to see network activity without having to reload the page.
Open the Inspector - Firefox Developer Tools
the inspector will appear at the bottom of the browser window: you can also set the pane to appear at the left side of the browser window: to the right side of the browser window: or in a separate window: to start finding your way around the inspector, see the ui tour.
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.
Select an element - Firefox Developer Tools
click the element to select it: starting in firefox 52, if you shift + click the element, then it is selected but the picker stays active.
UI Tour - Firefox Developer Tools
computed view the computed view shows you the complete computed css for the selected element (the computed values are 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.
Paint Flashing Tool - Firefox Developer Tools
you should see that the margin-left version triggers a series of repaints as the element moves, while the transform version only causes repaints in the start and end positions.
Flame Chart - Firefox Developer Tools
// 1345 -> swap() // 252 -> selectionsort() // 190 -> swap() // 1 -> quicksort() // 103 -> partition() // 12 first, we'll just select the whole section in which the program was active: at the top, colored purple, is the sortall() call, running throughout the program from start to finish.
UI Tour - Firefox Developer Tools
the performance tool's ui consists of 4 main pieces: toolbar recordings pane recording overview details pane, which may contain any one of: waterfall call tree flame chart toolbar the toolbar contains buttons to: start and stop a recording import a recording you previously saved clear the recordings pane.
Performance - Firefox Developer Tools
getting started ui tour to find your way around the performance tool, here's a quick tour of the ui.
Responsive Design Mode - Firefox Developer Tools
while touch event simulation is enabled, mouse events are translated into touch events; this includes (starting in firefox 79) translating a mouse-drag event into a touch-drag event.
Shader Editor - Firefox Developer Tools
at first you'll just see a blank window with a button asking you to reload the page: to get started, load a page which creates a webgl context and loads a program into it.
Taking screenshots - Firefox Developer Tools
taking screenshots with the web console if you need to specify a different device-pixel-ratio, set a delay before taking the screenshot, or specify your own file name, starting in firefox 62 you can use the :screenshot helper function in the web console.
Validators - Firefox Developer Tools
provide a starting url and the tool will find and validate all pages in a website.
Console messages - Firefox Developer Tools
sha-1 is still still widely used in certificates, but it is starting to show its age.
Rich output - Firefox Developer Tools
click on the triangle, and the object will be expanded to show its contents: 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.
Web Console UI Tour - Firefox Developer Tools
command line the command line starts with double angle brackets (>>).
ANGLE_instanced_arrays.drawArraysInstancedANGLE() - Web APIs
first a glint specifying the starting index in the array of vector points.
Accelerometer.x - Web APIs
WebAPIAccelerometerx
let accelerometer = new accelerometer({frequency: 60}); accelerometer.addeventlistener('reading', e => { console.log("acceleration along the x-axis " + accelerometer.x); console.log("acceleration along the y-axis " + accelerometer.y); console.log("acceleration along the z-axis " + accelerometer.z); }); accelerometer.start(); specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
Accelerometer.y - Web APIs
WebAPIAccelerometery
let accelerometer = new accelerometer({frequency: 60}); accelerometer.addeventlistener('reading', e => { console.log("acceleration along the x-axis " + accelerometer.x); console.log("acceleration along the y-axis " + accelerometer.y); console.log("acceleration along the z-axis " + accelerometer.z); }); accelerometer.start(); specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
Accelerometer.z - Web APIs
WebAPIAccelerometerz
let accelerometer = new accelerometer({frequency: 60}); accelerometer.addeventlistener('reading', e => { console.log("acceleration along the x-axis " + accelerometer.x); console.log("acceleration along the y-axis " + accelerometer.y); console.log("acceleration along the z-axis " + accelerometer.z); }); accelerometer.start(); specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
Accelerometer - Web APIs
let acl = new accelerometer({frequency: 60}); acl.addeventlistener('reading', () => { console.log("acceleration along the x-axis " + acl.x); console.log("acceleration along the y-axis " + acl.y); console.log("acceleration along the z-axis " + acl.z); }); acl.start(); specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
AmbientLightSensor.illuminance - Web APIs
example if ( 'ambientlightsensor' in window ) { const sensor = new ambientlightsensor(); sensor.onreading = () => { console.log('current light level:', sensor.illuminance); }; sensor.onerror = (event) => { console.log(event.error.name, event.error.message); }; sensor.start(); } specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
AmbientLightSensor - Web APIs
example if ( 'ambientlightsensor' in window ) { const sensor = new ambientlightsensor(); sensor.onreading = () => { console.log('current light level:', sensor.illuminance); }; sensor.onerror = (event) => { console.log(event.error.name, event.error.message); }; sensor.start(); } specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
Animation.cancel() - Web APIs
WebAPIAnimationcancel
when an animation is cancelled, its starttime and currenttime are set to null.
Animation.currentTime - Web APIs
at the start of the game, her height is set between the two extremes by setting her animation's currenttime to half her keyframeeffect's duration: alicechange.currenttime = alicechange.effect.timing.duration / 2; a more generic means of seeking to the 50% mark of an animation would be: animation.currenttime = animation.effect.getcomputedtiming().delay + animation.effect.getcomputedtiming().activedurati...
Animation.finished - Web APIs
every time the animation leaves the finished play state (that is, when it starts playing again), a new promise is created for this property.
Animation.onfinish - Web APIs
you can force the animation into the "finished" state by setting its starttime to document.timeline.currenttime - (animation.currenttime * animation.playbackrate).
Animation.ready - Web APIs
WebAPIAnimationready
a new promise is created every time the animation enters the "pending" play state as well as when the animation is canceled, since in both of those scenarios, the animation is ready to be started again.
AnimationEvent.elapsedTime - Web APIs
for an animationstart event, elapsedtime is 0.0 unless there was a negative value for animation-delay, in which case the event will be fired with elapsedtime containing (-1 * delay).
AnimationEvent.pseudoElement - Web APIs
summary the animationevent.pseudoelement read-only property is a domstring, starting with '::', containing the name of the pseudo-element the animation runs on.
AudioBuffer.getChannelData() - Web APIs
// this is the audionode to use when we want to play an audiobuffer var source = audioctx.createbuffersource(); // set the buffer in the audiobuffersourcenode source.buffer = myarraybuffer; // connect the audiobuffersourcenode to the // destination so we can hear the sound source.connect(audioctx.destination); // start the source playing source.start(); } specification specification status comment web audio apithe definition of 'getchanneldata' in that specification.
AudioBuffer - Web APIs
// this is the audionode to use when we want to play an audiobuffer var source = audioctx.createbuffersource(); // set the buffer in the audiobuffersourcenode source.buffer = myarraybuffer; // connect the audiobuffersourcenode to the // destination so we can hear the sound source.connect(audioctx.destination); // start the source playing source.start(); specifications specification status comment web audio apithe definition of 'audiobuffer' in that specification.
AudioBufferSourceNode.detune - Web APIs
octx.samplerate); for (let channel = 0; channel < channelcount; channel++) { const nowbuffering = myarraybuffer.getchanneldata(channel); for (let i = 0; i < framecount; i++) { nowbuffering[i] = math.random() * 2 - 1; } } const source = audioctx.createbuffersource(); source.buffer = myarraybuffer; source.connect(audioctx.destination); source.detune.value = 100; // value in cents source.start(); specifications specification status comment web audio apithe definition of 'detune' in that specification.
AudioBufferSourceNode.playbackRate - Web APIs
ffer = 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.innerhtml = playbackcontrol.value; } specification...
AudioContext.close() - Web APIs
stopbtn.onclick = function() { audioctx.close().then(function() { startbtn.removeattribute('disabled'); susresbtn.setattribute('disabled', 'disabled'); stopbtn.setattribute('disabled', 'disabled'); }); } specifications specification status comment web audio apithe definition of 'close()' in that specification.
AudioNode.connect() - Web APIs
WebAPIAudioNodeconnect
this means the value of the lfo // will not produce any audio, but will change the value of the gain instead lfo.connect(gain.gain); // connect the oscillator that will produce audio to the gain oscillator.connect(gain); // connect the gain to the destination so we hear sound gain.connect(audioctx.destination); // start the oscillator that will produce audio oscillator.start(); // start the oscillator that will modify the gain value lfo.start(); audioparam notes it is possible to connect an audionode output to more than one audioparam, and more than one audionode output to a single audioparam, with multiple calls to connect().
AudioParam.cancelScheduledValues() - Web APIs
syntax var audioparam = audioparam.cancelscheduledvalues(starttime) parameters starttime a double representing the time (in seconds) after the audiocontext was first created after which all scheduled changes will be cancelled.
AudioProcessingEvent - Web APIs
ffer.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); } ...
AudioScheduledSourceNode: ended event - Web APIs
examples in this simple example, an event listener for the ended event is set up to enable a "start" button in the user interface when the node stops playing: node.addeventlistener('ended', () => { document.getelementbyid("startbutton").disabled = false; }) you can also set up the event handler using the audioscheduledsourcenode.onended property: node.onended = function() { document.getelementbyid("startbutton").disabled = false; } for an example of the ended event in use, see our audio...
AudioWorkletProcessor.process - Web APIs
for example, take the audiobuffersourcenode — the processor behind such a node should return true from the process method while the buffer is playing, and start returning false when the buffer playing has ended (there's no way to call play on the same audiobuffersourcenode again).
BaseAudioContext.createBuffer() - Web APIs
// this is the audionode to use when we want to play an audiobuffer var source = audioctx.createbuffersource(); // set the buffer in the audiobuffersourcenode source.buffer = myarraybuffer; // connect the audiobuffersourcenode to the // destination so we can hear the sound source.connect(audioctx.destination); // start the source playing source.start(); specifications specification status comment web audio apithe definition of 'createbuffer()' in that specification.
BaseAudioContext.createBufferSource() - Web APIs
// this is the audionode to use when we want to play an audiobuffer var source = audioctx.createbuffersource(); // set the buffer in the audiobuffersourcenode source.buffer = myarraybuffer; // connect the audiobuffersourcenode to the // destination so we can hear the sound source.connect(audioctx.destination); // start the source playing source.start(); } specifications specification status comment web audio apithe definition of 'createbuffersource()' in that specification.
BaseAudioContext.createOscillator() - Web APIs
// create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(3000, audioctx.currenttime); // value in hertz oscillator.connect(audioctx.destination); oscillator.start(); specifications specification status comment web audio apithe definition of 'createoscillator' in that specification.
BaseAudioContext.createScriptProcessor() - Web APIs
ffer.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 'createscriptprocessor' in that specification.
BaseAudioContext.currentTime - Web APIs
it starts at 0.
BaseAudioContext - Web APIs
it starts at 0.
BlobBuilder - Web APIs
this also resets the blobbuilder so that the next call to append() is starting a new, empty blob.
Bluetooth.requestDevice() - Web APIs
devices with name starting with "prefix".
BluetoothCharacteristicProperties - Web APIs
= await device.gatt.connect(); let service = await gatt.getprimaryservice('heart_rate'); let characteristic = await service.getcharacteristic('heart_rate_measurement'); if (characteristic.properties.notify) { characteristics.addeventlistener('characteristicvaluechanged', function(event) { console.log(`received heart rate measurement: ${event.target.value}`); } await characteristic.startnotifications(); } specifications specification status comment web bluetooththe definition of 'bluetoothcharacteristicproperties' in that specification.
Body.body - Web APIs
WebAPIBodybody
const image = document.getelementbyid('target'); // fetch the original image fetch('./tortoise.png') // retrieve its body as readablestream .then(response => response.body) .then(body => { const reader = body.getreader(); return new readablestream({ start(controller) { return pump(); function pump() { return reader.read().then(({ done, value }) => { // when no more data needs to be consumed, close the stream if (done) { controller.close(); return; } // enqueue the next data chunk into our target stream controller.enqueue(value); return pump();...
ByteLengthQueuingStrategy.ByteLengthQueuingStrategy() - Web APIs
examples const queuingstrategy = new bytelengthqueuingstrategy({ highwatermark: 1 }); const readablestream = new readablestream({ start(controller) { ...
ByteLengthQueuingStrategy.size() - Web APIs
examples const queuingstrategy = new bytelengthqueuingstrategy({ highwatermark: 1 }); const readablestream = new readablestream({ start(controller) { ...
ByteLengthQueuingStrategy - Web APIs
examples const queueingstrategy = new bytelengthqueuingstrategy({ highwatermark: 1 }); const readablestream = new readablestream({ start(controller) { ...
CSS.registerProperty() - Web APIs
syntaxerror the given name isn't a valid custom property name (starts with two dashes, e.g.
CSSValueList - Web APIs
the items in the cssvaluelist are accessible via an integral index, starting from 0.
Managing screen orientation - Web APIs
: border-box; box-sizing: border-box; } p { font : 1em sans-serif; margin : 0; padding: .5em; } ul { list-style: none; font : 1em monospace; margin : 0; padding: .5em; -moz-box-sizing: border-box; box-sizing: border-box; background: black; } li { display: inline-block; margin : 0; padding: 0.5em; background: white; } once we have some common styles we can start defining a special case for the orientation /* for portrait, we want the tool bar on top */ @media screen and (orientation: portrait) { #toolbar { width: 100%; } } /* for landscape, we want the tool bar stick on the left */ @media screen and (orientation: landscape) { #toolbar { position: fixed; width: 2.65em; height: 100%; } p { margin-left: 2em; } li + li...
CSS Painting API - Web APIs
.fillstyle = thecolor; ctx.strokestyle = thecolor; } else { ctx.fillstyle = 'none'; ctx.strokestyle = 'none'; } ctx.beginpath(); ctx.moveto( x, y ); ctx.lineto( blockwidth, y ); ctx.lineto( blockwidth + blockheight, blockheight ); ctx.lineto( x, blockheight ); ctx.lineto( x, y ); ctx.closepath(); ctx.fill(); ctx.stroke(); for (let i = 0; i < 4; i++) { let start = i * 2; ctx.beginpath(); ctx.moveto( blockwidth + (start * 10) + 10, y); ctx.lineto( blockwidth + (start * 10) + 20, y); ctx.lineto( blockwidth + (start * 10) + 20 + blockheight, blockheight); ctx.lineto( blockwidth + (start * 10) + 10 + blockheight, blockheight); ctx.lineto( blockwidth + (start * 10) + 10, y); ctx.closepath(); ctx.fill(); ctx.stroke(); } } }); w...
CanvasGradient.addColorStop() - Web APIs
0 represents the start of the gradient and 1 represents the end; an index_size_err is raised if the number is outside that range.
CanvasPattern.setTransform() - Web APIs
document.getelementbyid('svg1'); var matrix = svg1.createsvgmatrix(); var img = new image(); img.src = 'https://mdn.mozillademos.org/files/222/canvas_createpattern.png'; img.onload = function() { var pattern = ctx.createpattern(img, 'repeat'); pattern.settransform(matrix.rotate(-45).scale(1.5)); ctx.fillstyle = pattern; ctx.fillrect(0, 0, 400, 400); }; note that newer browser versions started to support dommatrix as an input to settransform(), so for example you could replace the svgmatrix in the above example with the following: const matrix = new dommatrix([1, .2, .8, 1, 0, 0]); edit the code below and see your changes update live in the canvas: playable code <canvas id="canvas" width="400" height="200" class="playable-canvas"></canvas> <svg id="svg1" style="display:none"></s...
CanvasRenderingContext2D.beginPath() - Web APIs
the canvasrenderingcontext2d.beginpath() method of the canvas 2d api starts a new path by emptying the list of sub-paths.
CanvasRenderingContext2D.closePath() - Web APIs
the canvasrenderingcontext2d.closepath() method of the canvas 2d api attempts to add a straight line from the current point to the start of the current sub-path.
CanvasRenderingContext2D.fillText() - Web APIs
with that in hand, we set the font to 50-pixel-tall "serif" (the user's default serif font), then call filltext() to draw the text "hello world," starting at the coordinates (50, 90).
CanvasRenderingContext2D.lineCap - Web APIs
each of these lines starts and ends exactly on these guides.
CanvasRenderingContext2D.lineTo() - Web APIs
const canvas = document.getelementbyid('canvas'); const ctx = canvas.getcontext('2d'); ctx.beginpath(); // start a new path ctx.moveto(30, 50); // move the pen to (30, 50) ctx.lineto(150, 100); // draw a line to (150, 100) ctx.stroke(); // render the path result drawing connected lines each call of lineto() (and similar methods) automatically adds to the current sub-path, which means that all the lines will all be stroked or filled together.
CanvasRenderingContext2D.rotate() - Web APIs
finally, translate() moves the matrix's origin back to its starting point.
CanvasRenderingContext2D.strokeText() - Web APIs
with that in hand, we set the font to 50-pixel-tall "serif" (the user's default serif font), then call stroketext() to draw the text "hello world," starting at the coordinates (50, 90).
A basic ray-caster - Web APIs
i know i could have started with a simpler example, but i'm sure the canvas tutorial will get to that, and i wanted to see if i could do this.
Advanced animations - Web APIs
move your mouse into the canvas to start the animation.
Hit regions and accessibility - Web APIs
<canvas id="button" tabindex="0" role="button" aria-pressed="false" aria-label="start game"></canvas> hit regions whether the mouse coordinates are within a particular area on the canvas, is a common problem to solve.
Transformations - Web APIs
saving and restoring state before we look at the transformation methods, let's look at two other methods which are indispensable once you start generating ever more complex drawings.
Using images - Web APIs
to do this, you can use the convenient image() constructor: var img = new image(); // create new img element img.src = 'myimage.png'; // set source path when this script gets executed, the image starts loading.
CloseEvent - Web APIs
1012 service restart the server is terminating the connection because it is restarting.
CompositionEvent.initCompositionEvent() - Web APIs
syntax compositioneventinstance.initcompositionevent(typearg, canbubblearg, cancelablearg, viewarg, dataarg, localearg) parameters typearg a domstring representing the type of composition event; this will be one of compositionstart, compositionupdate, or compositionend.
Console.group() - Web APIs
WebAPIConsolegroup
collapsed groups are fully supported starting in gecko 52.
Console.profile() - Web APIs
WebAPIConsoleprofile
starts recording a performance profile (for example, the firefox performance tool).
Console.timeEnd() - Web APIs
WebAPIConsoletimeEnd
stops a timer that was previously started by calling console.time().
Console.timeLog() - Web APIs
WebAPIConsoletimeLog
logs the current value of a timer that was previously started by calling console.time() to the console.
Console API - Web APIs
concepts and usage the console api started as a largely proprietary api, with different browsers implementing it, albeit it in inconsistent ways.
CustomEvent - Web APIs
some other browsers are starting to support it for web compatibility purposes.
DOMUserData - Web APIs
domuserdata is not persisted nor serialized and will not be present after the application has restarted or after a crash.
DataTransfer.getData() - Web APIs
html content <div id="div1" ondrop="drop(event)" ondragover="allowdrop(event)"> <span id="drag" draggable="true" ondragstart="drag(event)">drag me to the other box</span> </div> <div id="div2" ondrop="drop(event)" ondragover="allowdrop(event)"></div> css content #div1, #div2 { width:100px; height:50px; padding:10px; border:1px solid #aaaaaa; } javascript content function allowdrop(allowdropevent) { allowdropevent.target.style.color = 'blue'; allowdropevent.preventdefault(); } function dra...
DataTransfer - Web APIs
datatransfer.types read only an array of strings giving the formats that were set in the dragstart event.
DataTransferItem.webkitGetAsEntry() - Web APIs
now it's time to start building the list.
DedicatedWorkerGlobalScope - Web APIs
these events are of type messageevent and will be called when the worker receives a message from the document that started it (i.e.
DeprecationReportBody - Web APIs
examples in our deprecation_report.html example, we create a simple reporting observer to observe usage of deprecated features on our web page: let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { 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
t amet.</p> javascript function insertbreakatpoint(e) { let range; let textnode; let offset; if (document.caretpositionfrompoint) { range = document.caretpositionfrompoint(e.clientx, e.clienty); textnode = range.offsetnode; offset = range.offset; } else if (document.caretrangefrompoint) { range = document.caretrangefrompoint(e.clientx, e.clienty); textnode = range.startcontainer; 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].addeventlist...
Document.createRange() - Web APIs
example let range = document.createrange(); range.setstart(startnode, startoffset); range.setend(endnode, endoffset); notes once a range is created, you need to set its boundary points before you can make use of most of its methods.
Document.designMode - Web APIs
starting in chrome 43, the default is "off" and "inherit" is no longer supported.
Document.getElementsByTagNameNS() - Web APIs
example in the following example getelementsbytagnamens starts from a particular parent element, and searches topdown recursively through the dom from that parent element, looking for child elements matching the tag name parameter.
Document.height - Web APIs
WebAPIDocumentheight
note: starting in gecko 6.0, document.height is no longer supported.
Document.importNode() - Web APIs
starting with gecko 29.0 (firefox 29 / thunderbird 29 / seamonkey 2.26)), a shallow clone is defaulted instead of a deep clone.
Document: pointercancel event - Web APIs
the browser decides that the user started pointer input accidentally.
Document.popupNode - Web APIs
note: starting with gecko 2.0, authors are encouraged to use the menupopup property triggernode instead.
Document.querySelector() - Web APIs
note: the matching is done using depth-first pre-order traversal of the document's nodes starting with the first element in the document's markup and iterating through sequential nodes by order of the number of child nodes.
Document.requestStorageAccess() - Web APIs
when the promise gets resolved, the resolve handler will run as if a user gesture is being processed, whether the promise was fulfilled or rejected: in the former case, code can then start to call apis that require user activation and things can move forward.
Document: transitionrun event - Web APIs
examples this code adds a listener to the transitionrun event: document.addeventlistener('transitionrun', () => { console.log('transition is running but hasn't necessarily started transitioning yet'); }); the same, but using the ontransitionrun property instead of addeventlistener(): document.ontransitionrun = () => { console.log('transition started running'); }; see a live example of this event.
Document.visibilityState - Web APIs
the document may start in this state, but will never transition to it from another value.
Document.width - Web APIs
WebAPIDocumentwidth
note: starting in gecko 6.0, document.width is no longer supported.
Document.write() - Web APIs
WebAPIDocumentwrite
note: starting with version 55, chrome will not execute <script> elements injected via document.write() when specific conditions are met.
DocumentOrShadowRoot.caretPositionFromPoint() - Web APIs
/p> javascript content function insertbreakatpoint(e) { var range; var textnode; var offset; if (document.caretpositionfrompoint) { range = document.caretpositionfrompoint(e.clientx, e.clienty); textnode = range.offsetnode; offset = range.offset; } else if (document.caretrangefrompoint) { range = document.caretrangefrompoint(e.clientx, e.clienty); textnode = range.startcontainer; offset = range.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++) { paragra...
DocumentTimeline - Web APIs
this bit of code would start all the cats animating 500 milliseconds into their animations: const cats = document.queryselectorall('.sharedtimelinecat'); const sharedtimeline = new documenttimeline({ origintime: 500 }); for (const cat of cats) { const catkeyframes = new keyframeeffect(cat, keyframes, timing); const catanimation = new animation(catkeyframes, sharedtimeline); catanimation.play(); } specifications ...
DynamicsCompressorNode() - Web APIs
threshold: the decibel value above which the compression will start taking effect.
DynamicsCompressorNode.threshold - Web APIs
the threshold property of the dynamicscompressornode interface is a k-rate audioparam representing the decibel value above which the compression will start taking effect.
DynamicsCompressorNode - Web APIs
dynamicscompressornode.threshold read only is a k-rate audioparam representing the decibel value above which the compression will start taking effect.
EXT_disjoint_timer_query.getQueryEXT() - Web APIs
examples var ext = gl.getextension('ext_disjoint_timer_query'); var startquery = ext.createqueryext(); ext.querycounterext(startquery, ext.timestamp_ext); var currentquery = ext.getqueryext(ext.timestamp_ext, ext.current_query_ext); specifications specification status comment ext_disjoint_timer_querythe definition of 'ext_disjoint_timer_query' in that specification.
EXT_disjoint_timer_query.queryCounterEXT() - Web APIs
examples var ext = gl.getextension('ext_disjoint_timer_query'); var startquery = ext.createqueryext(); var endquery = ext.createqueryext(); ext.querycounterext(startquery, ext.timestamp_ext); // ...
EXT_disjoint_timer_query - Web APIs
ext.beginqueryext() the timer starts when all commands prior to beginqueryext have been fully executed.
EffectTiming.direction - Web APIs
"alternate-reverse" similar to "alternate", except the animation playback starts by going from the end of the animation sequence toward the beginning the first iteration, then goes forward during the second, and so forth.
Element: MSGestureHold event - Web APIs
bubbles unknown cancelable unknown interface msgestureevent event handler property unknown the uievent.detail property of an msgesturehold event has 3 possible values: msgesture_flag_begin this value indicates that the user started contacting the touch surface.
Element: MSManipulationStateChanged event - Web APIs
whenever you start or finish panning or zooming an element).
Element.classList - Web APIs
WebAPIElementclassList
examples const div = document.createelement('div'); div.classname = 'foo'; // our starting state: <div class="foo"></div> console.log(div.outerhtml); // use the classlist api to remove and add classes div.classlist.remove("foo"); div.classlist.add("anotherclass"); // <div class="anotherclass"></div> console.log(div.outerhtml); // if visible is set remove it, otherwise add it div.classlist.toggle("visible"); // add/remove visible, depending on test conditional, i less than 10 div...
Element: compositionend event - Web APIs
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 ui events working draft ...
Element: compositionupdate event - Web APIs
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 ui events working draft ...
Element.computedStyleMap() - Web APIs
examples we start with some simple html: a paragraph with a link, and a definition list to which we will add all the css property / value pairs.
Element.getAttributeNS() - Web APIs
starting with dom4, the specification now says to return null.
Element.getElementsByClassName() - Web APIs
the method getelementsbyclassname() on the document interface works essentially the same way, except it acts on the entire document, starting at the document root.
Element.getElementsByTagName() - Web APIs
element is the element from where the search starts.
Element.getElementsByTagNameNS() - Web APIs
element is the element from where the search should start.
Element.scrollLeft - Web APIs
if the element's direction is rtl (right-to-left), then scrollleft is 0 when the scrollbar is at its rightmost position (at the start of the scrolled content), and then increasingly negative as you scroll towards the end of the content.
Element: select event - Web APIs
examples selection logger <input value="try selecting some text in this element."> <p id="log"></p> function logselection(event) { const log = document.getelementbyid('log'); const selection = event.target.value.substring(event.target.selectionstart, event.target.selectionend); log.textcontent = `you selected: ${selection}`; } const input = document.queryselector('input'); input.addeventlistener('select', logselection); onselect equivalent you can also set up the event handler using the onselect property: input.onselect = logselection; specifications specification status ui eventsthe definition of 'select' ...
Event - Web APIs
WebAPIEvent
some other browsers are starting to support it for web compatibility purposes.
EventTarget.addEventListener() - Web APIs
to prevent this problem, some browsers (specifically, chrome and firefox) have changed the default value of the passive option to true for the touchstart and touchmove events on the document-level nodes window, document, and document.body.
Fetch API - Web APIs
WebAPIFetch API
aborting a fetch browsers have started to add experimental support for the abortcontroller and abortsignal interfaces (aka the abort api), which allow operations like fetch and xhr to be aborted if they have not already completed.
File - Web APIs
WebAPIFile
instance methods the file interface doesn't define any methods, but inherits methods from the blob interface: blob.prototype.slice([start[, end[, contenttype]]]) returns a new blob object containing the data in the specified range of bytes of the source blob.
FileError - Web APIs
WebAPIFileError
just start chrome with the --allow-file-access-from-files flag.
FileList - Web APIs
WebAPIFileList
starting with gecko 1.9.2, if the input element's multiple attribute is true, the filelist may contain multiple files.
FileReader: abort event - Web APIs
lector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistener('load', handleevent); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selected...
FileReader: load event - Web APIs
lector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistener('load', handleevent); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selected...
FileReader: loadend event - Web APIs
lector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistener('load', handleevent); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selected...
FileReader: progress event - Web APIs
lector('img.preview'); const eventlog = document.queryselector('.event-log-contents'); const reader = new filereader(); function handleevent(event) { eventlog.textcontent = eventlog.textcontent + `${event.type}: ${event.loaded} bytes transferred\n`; if (event.type === "load") { preview.src = reader.result; } } function addlisteners(reader) { reader.addeventlistener('loadstart', handleevent); reader.addeventlistener('load', handleevent); reader.addeventlistener('loadend', handleevent); reader.addeventlistener('progress', handleevent); reader.addeventlistener('error', handleevent); reader.addeventlistener('abort', handleevent); } function handleselected(e) { eventlog.textcontent = ''; const selectedfile = fileinput.files[0]; if (selected...
FileReader.readAsArrayBuffer() - Web APIs
the filereader interface's readasarraybuffer() method is used to start reading the contents of a specified blob or file.
FileReader.readAsBinaryString() - Web APIs
the readasbinarystring method is used to start reading the contents of the specified blob or file.
FileRequest.lockedFile - Web APIs
summary the lockedfile property represents the lockedfile object from which the request was started.
FileRequest - Web APIs
properties filerequest.lockedfile read only the lockedfile object from which the request was started.
FileSystemDirectoryEntry.getDirectory() - Web APIs
}, function(direntry) { direntry.getfile(lang + "-dict.json", {}, function(fileentry) { fileentry.file(function(dictfile)) { let reader = new filereader(); reader.addeventlistener("loadend", function() { dictionary = json.parse(reader.result); }); reader.readastext(dictfile); }); }); }); } the loaddictionaryforlanguage() function starts by using getdirectory() to obtain the filesystemdirectoryentry object representing a subfolder named "dictionaries" located inside the specified app data directory.
FileSystemDirectoryEntry.getFile() - Web APIs
}, function(direntry) { direntry.getfile(lang + "-dict.json", {}, function(fileentry) { fileentry.file(function(dictfile)) { let reader = new filereader(); reader.addeventlistener("loadend", function() { dictionary = json.parse(reader.result); }); reader.readastext(dictfile); }); }); }); } the loaddictionaryforlanguage() function starts by using getdirectory() to obtain the filesystemdirectoryentry object representing a subfolder named "dictionaries" located inside the specified app data directory.
FileSystemDirectoryReader.readEntries() - Web APIs
now it's time to start building the list.
FontFaceSet - Web APIs
events fontfaceset.onloading an eventlistener called whenever an event of type loading is fired, indicating a font-face set has started loading.
Guide to the Fullscreen API - Web APIs
function togglefullscreen() { if (!document.fullscreenelement) { document.documentelement.requestfullscreen(); } else { if (document.exitfullscreen) { document.exitfullscreen(); } } } this starts by looking at the value of the fullscreenelement attribute on the document (checking it prefixed with both moz, ms, or webkit).
Fullscreen API - Web APIs
function togglefullscreen() { if (!document.fullscreenelement) { document.documentelement.requestfullscreen(); } else { if (document.exitfullscreen) { document.exitfullscreen(); } } } this starts by looking at the value of the document's fullscreenelement attribute.
Gamepad.axes - Web APIs
WebAPIGamepadaxes
ebkitgetgamepads) { var gp = navigator.webkitgetgamepads()[0]; } else { var gp = navigator.getgamepads()[0]; } if(gp.axes[0] != 0) { b -= gp.axes[0]; } else if(gp.axes[1] != 0) { a += gp.axes[1]; } else if(gp.axes[2] != 0) { b += gp.axes[2]; } else if(gp.axes[3] != 0) { a -= gp.axes[3]; } ball.style.left = a*2 + "px"; ball.style.top = b*2 + "px"; var start = raf(gameloop); }; value an array of double values.
Gamepad.buttons - Web APIs
WebAPIGamepadbuttons
ons[0].value > 0 || gp.buttons[0].pressed == true) { b--; } else if(gp.buttons[1].value > 0 || gp.buttons[1].pressed == true) { a++; } else if(gp.buttons[2].value > 0 || gp.buttons[2].pressed == true) { b++; } else if(gp.buttons[3].value > 0 || gp.buttons[3].pressed == true) { a--; } } ball.style.left = a*2 + "px"; ball.style.top = b*2 + "px"; var start = raf(gameloop); }; value an array of gamepadbutton objects.
Gamepad.timestamp - Web APIs
WebAPIGamepadtimestamp
the value must be relative to the navigationstart attribute of the performancetiming interface.
GamepadButton - Web APIs
ons[0].value > 0 || gp.buttons[0].pressed == true) { b--; } else if(gp.buttons[1].value > 0 || gp.buttons[1].pressed == true) { a++; } else if(gp.buttons[2].value > 0 || gp.buttons[2].pressed == true) { b++; } else if(gp.buttons[3].value > 0 || gp.buttons[3].pressed == true) { a--; } } ball.style.left = a*2 + "px"; ball.style.top = b*2 + "px"; var start = raf(gameloop); }; specifications specification status comment gamepadthe definition of 'gamepadbutton' in that specification.
GlobalEventHandlers.onanimationcancel - Web APIs
all we do here is log information to the console, but you might find other use cases, such as starting a new animation or effect, or terminating some dependent operation.
GlobalEventHandlers.onloadend - Web APIs
examples html content <img src="myimage.jpg"> javascript content // 'loadstart' fires first, then 'load', then 'loadend' image.addeventlistener('load', function(e) { console.log('image loaded'); }); image.addeventlistener('loadstart', function(e) { console.log('image load started'); }); image.addeventlistener('loadend', function(e) { console.log('image load finished'); }); ...
GlobalEventHandlers.onplay - Web APIs
</video> <p>video courtesy of <a href="http://www.bigbuckbunny.org/" target="_blank">big buck bunny</a>.</p> <script> function alertplay() { alert("the video has started to play."); } </script> specification specification status comment html living standardthe definition of 'onplay' in that specification.
GlobalEventHandlers.onplaying - Web APIs
the playing event is fired when playback is ready to start after having been paused or delayed due to lack of media data.
GlobalEventHandlers.onselect - Web APIs
html <textarea>try selecting some text in this element.</textarea> <p id="log"></p> javascript function logselection(event) { const log = document.getelementbyid('log'); const selection = event.target.value.substring(event.target.selectionstart, event.target.selectionend); log.textcontent = `you selected: ${selection}`; } const textarea = document.queryselector('textarea'); textarea.onselect = logselection; result specification specification status comment html living standardthe definition of 'onselect' in that specification.
Gyroscope.x - Web APIs
WebAPIGyroscopex
let gyroscope = new gyroscope({frequency: 60}); gyroscope.addeventlistener('reading', e => { console.log("angular velocity along the x-axis " + gyroscope.x); console.log("angular velocity along the y-axis " + gyroscope.y); console.log("angular velocity along the z-axis " + gyroscope.z); }); gyroscope.start(); specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
Gyroscope.y - Web APIs
WebAPIGyroscopey
let gyroscope = new gyroscope({frequency: 60}); gyroscope.addeventlistener('reading', e => { console.log("angular velocety along the x-axis " + gyroscope.x); console.log("angular velocety along the y-axis " + gyroscope.y); console.log("angular velocety along the z-axis " + gyroscope.z); }); gyroscope.start(); specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
Gyroscope.z - Web APIs
WebAPIGyroscopez
let gyroscope = new gyroscope({frequency: 60}); gyroscope.addeventlistener('reading', e => { console.log("angular velocety along the x-axis " + gyroscope.x); console.log("angular velocety along the y-axis " + gyroscope.y); console.log("angular velocety along the z-axis " + gyroscope.z); }); gyroscope.start(); specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
Gyroscope - Web APIs
WebAPIGyroscope
let gyroscope = new gyroscope({frequency: 60}); gyroscope.addeventlistener('reading', e => { console.log("angular velocity along the x-axis " + gyroscope.x); console.log("angular velocity along the y-axis " + gyroscope.y); console.log("angular velocity along the z-axis " + gyroscope.z); }); gyroscope.start(); specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
msAudioCategory - Web APIs
yes communications for streaming communication audio such as the following: voip real time chat or other type of phone calls should not be used in non-real-time or non-communication scenarios, such as audio and/or video playback, as playback startup latency is affected.
HTMLAudioElement - Web APIs
50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="211" y="94" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">htmlaudioelement</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor audio() creates and returns a new htmlaudioelement object, optionally starting the process of loading an audio file into it if the file url is given.
HTMLBaseFontElement - Web APIs
relative value starts with a '+' or a '-'.
HTMLCanvasElement.toDataURL() - Web APIs
if the requested type is not image/png, but the returned value starts with data:image/png, then the requested type is not supported.
HTMLElement: animationcancel event - Web APIs
from { transform: translatex(100%) scalex(3); } to { transform: translatex(0) scalex(1); } } js const animation = document.queryselector('p.animation'); const animationeventlog = document.queryselector('.animation-example>.event-log'); const applyanimation = document.queryselector('.animation-example>button.activate'); let iterationcount = 0; animation.addeventlistener('animationstart', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation started' `; }); animation.addeventlistener('animationiteration', () => { iterationcount++; animationeventlog.textcontent = `${animationeventlog.textcontent}'animation iterations: ${iterationcount}' `; }); animation.addeventlistener('animationend', () => { animationeventlog.textcontent = `${animationeve...
HTMLElement: animationend event - Web APIs
{ from { margin-left: 100%; width: 300%; } to { margin-left: 0%; width: 100%; } } js const animation = document.queryselector('p.animation'); const animationeventlog = document.queryselector('.animation-example>.event-log'); const applyanimation = document.queryselector('.animation-example>button.activate'); let iterationcount = 0; animation.addeventlistener('animationstart', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation started' `; }); animation.addeventlistener('animationiteration', () => { iterationcount++; animationeventlog.textcontent = `${animationeventlog.textcontent}'animation iterations: ${iterationcount}' `; }); animation.addeventlistener('animationend', () => { animationeventlog.textcontent = `${animationeve...
HTMLElement: animationiteration event - Web APIs
from { transform: translatex(100%) scalex(3); } to { transform: translatex(0) scalex(1); } } js const animation = document.queryselector('p.animation'); const animationeventlog = document.queryselector('.animation-example>.event-log'); const applyanimation = document.queryselector('.animation-example>button.activate'); let iterationcount = 0; animation.addeventlistener('animationstart', () => { animationeventlog.textcontent = `${animationeventlog.textcontent}'animation started' `; }); animation.addeventlistener('animationiteration', () => { iterationcount++; animationeventlog.textcontent = `${animationeventlog.textcontent}'animation iterations: ${iterationcount}' `; }); animation.addeventlistener('animationend', () => { animationeventlog.textcontent = `${animationeve...
HTMLElement: pointercancel event - Web APIs
the browser decides that the user started pointer input accidentally.
HTMLImageElement.alt - Web APIs
body { margin: 0; padding: 0; } p { margin-block-start: 0; margin-block-end: 1em; margin-top: 0; margin-bottom: 1em; } .container { width: 100vh; height: 95vh; font: 16px arial,helvetica,sans-serif; } .left-margin { background-color: rgb(241, 240, 237, 255); width: 9em; height: 100%; float: left; margin-right: 5px; padding-right: 1em; display: flex; align-items: center; justify-content: center; } .left-margin img { ...
HTMLImageElement.border - Web APIs
the width, specifically, is controlled using the writing-mode aware border-block-start-width, border-block-end-width, border-inline-start-width, and border-inline-end-width properties.
HTMLImageElement.complete - Web APIs
*/ function fixredeyecommand() { if (lightboxelem.style.display === "block" && lightboximgelem.complete) { fixredeye(lightboximgelem); } else { /* can't start doing this until the image is fully loaded */ } } specifications specification status comment html living standardthe definition of 'htmlimageelement.complete' in that specification.
HTMLMediaElement.autoplay - Web APIs
do not rely on autoplay actually starting playback and instead use play event.
HTMLMediaElement: canplay event - Web APIs
using addeventlistener(): const video = document.queryselector('video'); video.addeventlistener('canplay', (event) => { console.log('video can start, but not sure it will play through.'); }); using the oncanplay event handler property: const video = document.queryselector('video'); video.oncanplay = (event) => { console.log('video can start, but not sure it will play through.'); }; specifications specification status html living standardthe definition of 'canplay media event' in that specification.
HTMLMediaElement.captureStream() - Web APIs
example 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.
HTMLMediaElement.load() - Web APIs
once media has been selected and loading is ready to begin, the loadstart event is delivered.
HTMLMediaElement.loop - Web APIs
the htmlmediaelement.loop property reflects the loop html attribute, which controls whether the media element should start over when it reaches the end.
HTMLMediaElement: playing event - Web APIs
the playing event is fired when playback is ready to start after having been paused or delayed due to lack of data.
HTMLMediaElement: progress event - Web APIs
event-log { grid-area: log; } .event-log>label { display: block; } javascript const loadvideo = document.queryselector('button'); const video = document.queryselector('video'); const eventlog = 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.set...
HTMLMediaElement.seekable - Web APIs
examples var video = document.queryselector("video"); var timerangesobject = video.seekable; var timeranges = []; //go through the object and output an array for (let count = 0; count < timerangesobject.length; count ++) { timeranges.push([timerangesobject.start(count), timerangesobject.end(count)]); } specifications specification status comment html living standardthe definition of 'htmlmediaelement' in that specification.
HTMLMediaElement: seeking event - Web APIs
the seeking event is fired when a seek operation starts, meaning the boolean seeking attribute has changed to true and the media is seeking a new position.
HTMLMedia​Element​.textTracks - Web APIs
examples we start with a <video> that has several <track> children <video controls poster="/images/sample.gif"> <source src="sample.mp4" type="video/mp4"> <source src="sample.ogv" type="video/ogv"> <track kind="captions" src="samplecaptions.vtt" srclang="en"> <track kind="descriptions" src="sampledescriptions.vtt" srclang="en"> <track kind="chapters" src="samplechapters.vtt" srclang="en"> <track kind...
HTMLOListElement - Web APIs
htmlolistelement.start is a long value reflecting the start and defining the value of the first number of the first element of the list.
HTMLScriptElement - Web APIs
these algorithms describe the core ideas, but they rely on the parsing rules for <script> start and end tags in html, in foreign content, and in xml; the rules for the document.write() method; the handling of scripting; and so on.
HTMLTrackElement - Web APIs
if you need to be able to perform any processing on the track after the <track> is set up, you should instead ensure that the track's mode is either hidden (if you don't want it to start out being presented to the user) or showing (to initially display the track).
HTMLVideoElement.videoHeight - Web APIs
about intrinsic width and height a user agent calculates the intrinsic width and height of the element's media by starting with the media's raw pixel width and height, then taking into account factors including: the media's aspect ratio.
HTMLVideoElement.videoWidth - Web APIs
about intrinsic width and height a user agent calculates the intrinsic width and height of the element's media by starting with the media's raw pixel width and height, then taking into account factors including: the media's aspect ratio.
File drag and drop - Web APIs
in this example, the drop target element uses the following styling: #drop_zone { border: 5px solid blue; width: 200px; height: 100px; } note that dragstart and dragend events are not fired when dragging a file into the browser from the os.
Recommended Drag Types - Web APIs
this allows the drop target to receive the actual node where the drag was started from.
IDBRequest.readyState - Web APIs
every request starts in the pending state.
IDBRequest - Web APIs
every request starts in the pending state.
IDBTransaction.commit() - Web APIs
commit() can be used to start the commit process without waiting for events from outstanding requests to be dispatched.
IDBTransaction.mode - Web APIs
this mode is for updating the version number of transactions that were started using idbdatabase.setversion().
ImageCapture - Web APIs
since imagecapture requires some place to capture an image from, the example below starts with a device's media device (in other words a camera).
Checking when a deadline is due - Web APIs
when the form's submit button is pressed, we run the adddata() function, which starts like this: function adddata(e) { e.preventdefault(); if(title.value == '' || hours.value == null || minutes.value == null || day.value == '' || month.value == '' || year.value == null) { note.innerhtml += '<li>data not submitted — form incomplete.</li>'; return; } in this segment, we check to see if the form fields have all been filled in.
InputEvent() - Web APIs
iscomposing: (optional) a boolean indicating that the event is part of a composition session, meaning it is after a compositionstart event but before a compositionend event.
InputEvent.isComposing - Web APIs
the inputevent.iscomposing read-only property returns a boolean value indicating if the event is fired after compositionstart and before compositionend.
InputEvent - Web APIs
inputevent.iscomposingread only returns a boolean value indicating if the event is fired after compositionstart and before compositionend.
enabled - Web APIs
example the following code uses the startsoftwareupdate method to unconditionally trigger a download from http://royalairways/royalpkg.xpi as long as software installation is enabled on the browser: if (installtrigger.enabled() ) { installtrigger.startsoftwareupdate ("http://royalair.com/rasoft.xpi"); } ...
InstallTrigger - Web APIs
startsoftwareupdate triggers the downloading and installation of the software at the specified url.
IntersectionObserver - Web APIs
if (entries[0].intersectionratio <= 0) return; loaditems(10); console.log('loaded new items'); }); // start observing intersectionobserver.observe(document.queryselector('.scrollerfooter')); specifications specification status comment intersection observerthe definition of 'intersectionobserver' in that specification.
KeyboardEvent.isComposing - Web APIs
after compositionstart and before compositionend.
KeyboardEvent.location - Web APIs
starting 18, native key events on android may have this value.
KeyboardEvent - Web APIs
keyboardevent.iscomposing read only returns a boolean that is true if the event is fired between after compositionstart and before compositionend.
KeyframeEffect.getKeyframes() - Web APIs
this is equivalent to specifying start and end states in percentages in css stylesheets using @keyframes.
KeyframeEffect.setKeyframes() - Web APIs
this is equivalent to specifying start and end states in percentages in css stylesheets using @keyframes.
LinearAccelerationSensor.x - Web APIs
let lasensor = new linearaccelerationsensor({frequency: 60}); lasensor.addeventlistener('reading', e => { console.log("linear acceleration along the x-axis " + lasensor.x); console.log("linear acceleration along the y-axis " + lasensor.y); console.log("linear acceleration along the z-axis " + lasensor.z); }); lasensor.start(); specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
LinearAccelerationSensor.y - Web APIs
let lasensor = new linearaccelerationsensor({frequency: 60}); lasensor.addeventlistener('reading', e => { console.log("linear acceleration along the x-axis " + lasensor.x); console.log("linear acceleration along the y-axis " + lasensor.y); console.log("linear acceleration along the z-axis " + lasensor.z); }); lasensor.start(); specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
LinearAccelerationSensor.z - Web APIs
let lasensor = new linearaccelerationsensor({frequency: 60}); lasensor.addeventlistener('reading', e => { console.log("linear acceleration along the x-axis " + lasensor.x); console.log("linear acceleration along the y-axis " + lasensor.y); console.log("linear acceleration along the z-axis " + lasensor.z); }); lasensor.start(); specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
LinearAccelerationSensor - Web APIs
let lasensor = new linearaccelerationsensor({frequency: 60}); lasensor.addeventlistener('reading', e => { console.log("linear acceleration along the x-axis " + lasensor.x); console.log("linear acceleration along the y-axis " + lasensor.y); console.log("linear acceleration along the z-axis " + lasensor.z); }); lasensor.start(); specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
LockedFile.location - Web APIs
its value indicates at which bytes within the file any write or read operation will start.
LockedFile.readAsArrayBuffer() - Web APIs
the reading operation starts at the position given by the lockedfile.location property.
LockedFile.readAsText() - Web APIs
the reading operation starts at the position given by the lockedfile.location property.
LockedFile.write() - Web APIs
WebAPILockedFilewrite
the write starts at the position set in lockedfile.location and moves that position by the number of written bytes.
LockedFile - Web APIs
lockedfile.write() allows to write some data in the file starting at the location offset.
Magnetometer.x - Web APIs
WebAPIMagnetometerx
let magsensor = new magnetometer({frequency: 60}); magsensor.addeventlistener('reading', e => { console.log("magnetic field along the x-axis " + magsensor.x); console.log("magnetic field along the y-axis " + magsensor.y); console.log("magnetic field along the z-axis " + magsensor.z); }); magsensor.start(); specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
Magnetometer.y - Web APIs
WebAPIMagnetometery
let magsensor = new magnetometer({frequency: 60}); magsensor.addeventlistener('reading', e => { console.log("magnetic field along the x-axis " + magsensor.x); console.log("magnetic field along the y-axis " + magsensor.y); console.log("magnetic field along the z-axis " + magsensor.z); }); magsensor.start(); specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
Magnetometer.z - Web APIs
WebAPIMagnetometerz
let magsensor = new magnetometer({frequency: 60}); magsensor.addeventlistener('reading', e => { console.log("magnetic field along the x-axis " + magsensor.x); console.log("magnetic field along the y-axis " + magsensor.y); console.log("magnetic field along the z-axis " + magsensor.z); }); magsensor.start(); specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
Magnetometer - Web APIs
let magsensor = new magnetometer({frequency: 60}); magsensor.addeventlistener('reading', e => { console.log("magnetic field along the x-axis " + magsensor.x); console.log("magnetic field along the y-axis " + magsensor.y); console.log("magnetic field along the z-axis " + magsensor.z); }); magsensor.start(); specifications specification status comment generic sensor api candidate recommendation defines sensors in general.
MediaDeviceInfo.groupId - Web APIs
the function starts by initializing the result array, devlist, to be an empty array.
MediaDeviceInfo.label - Web APIs
for security reasons, the label is always an empty string ("") if the user has not obtained permission to use at least one media device, either by starting a stream from the microphone or camera, or by persistent permissions being granted.
expiration - Web APIs
this value may change during a session lifetime, such as when an action triggers the start of a window.
MediaKeySession - Web APIs
this value may change during a session lifetime, such as when an action triggers the start of a window.
MediaQueryList - Web APIs
when the media query test starts or stops evaluating to true).
MediaRecorder: error event - Web APIs
examples using addeventlistener to listen for error events: async function record() { const stream = await navigator.mediadevices.getusermedia({audio: true}); const recorder = new mediarecorder(stream); recorder.addeventlistener('error', (event) => { console.error(`error recording stream: ${event.error.name}`) }); recorder.start(); } record(); the same, but using the onerror event handler property: async function record() { const stream = await navigator.mediadevices.getusermedia({audio: true}); const recorder = new mediarecorder(stream); recorder.onerror = (event) => { console.error(`error recording stream: ${event.error.name}`) }; recorder.start(); } record(); specifications s...
MediaRecorderErrorEvent.error - Web APIs
function recordstream(stream) { let recorder = null; let bufferlist = []; try { recorder = new mediarecorder(stream); } catch(err) { /* exception while trying to create the recorder; handle that */ } recorder.ondataavailable = function(event) { bufferlist.push(event.data); }; recorder.onerror = function(event) { let error = event.error; }; recorder.start(100); /* 100ms time slices per buffer */ return recorder; } specifications specification status comment mediastream recordingthe definition of 'mediarecordererrorevent.error' in that specification.
active - Web APIs
var promise = navigator.mediadevices.getusermedia({ audio: true, video: true }); promise.then(function(stream) { var startbtn = document.queryselector('#startbtn'); startbtn.disabled = stream.active; };) specifications specification status comment media capture and streamsthe definition of 'active' in that specification.
MediaTrackConstraints.latency - Web APIs
in audio processing, latency is the time between the start of processing (when sound occurs in the real world, or is generated by a hardware device) and the data being made available to the next step in the audio input or output process.
MediaTrackSettings - Web APIs
latency is the amount of time which elapses between the start of processing the audio and the data being available to the next stop in the audio utilization process.
MediaTrackSupportedConstraints.cursor - Web APIs
capturing is then started by calling getdisplaymedia() and attaching the returned stream to the video element referenced by the variable videoelem.
MediaTrackSupportedConstraints.displaySurface - Web APIs
capturing is then started by calling getdisplaymedia() and attaching the returned stream to the video element referenced by the variable videoelem.
MediaTrackSupportedConstraints.logicalSurface - Web APIs
capturing is then started by calling getdisplaymedia() and attaching the returned stream to the video element referenced by the variable videoelem.
Media Session API - Web APIs
*/ }); } some user agents disable autoplay for media elements on mobile devices and require a user gesture to start media.
Media Capture and Streams API (Media Stream) - Web APIs
events addtrack ended muted overconstrained removetrack started unmuted guides and tutorials the articles below provide additional guidance and how-to information that will help you learn to use the api, and how to perform specific tasks that you may wish to handle.
MessageEvent.ports - Web APIs
example onconnect = function(e) { var port = e.ports[0]; port.addeventlistener('message', function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); }); port.start(); // required when using addeventlistener.
MessagePort.close() - Web APIs
WebAPIMessagePortclose
channel.port1.addeventlistener('message', handlemessage, false); function handlemessage(e) { para.innerhtml = e.data; textinput.value = ''; } channel.port1.start(); you could stop messages being sent at any time using channel.port1.close(); specifications specification status comment html living standardthe definition of 'close()' in that specification.
MessagePort - Web APIs
start() starts the sending of messages queued on the port (only needed when using eventtarget.addeventlistener; it is implied when using messageport.onmessage.) close() disconnects the port, so it is no longer active.
MouseEvent.metaKey - Web APIs
on windows, for example, this key may open the start menu.
msFirstPaint - Web APIs
var otiming = window.performance.timing; var itimems = otiming.msfirstpaint - otiming.navigationstart; ...
msRealTime - Web APIs
msrealtime should not be used in non-real-time or non-communication scenarios, such as audio and/or video playback, as this can affects playback startup latency of audio and video playback.
MutationObserver.MutationObserver() - Web APIs
creating and starting the observer this code actually sets up the observation process.
MutationObserver - Web APIs
{ if (mutation.type === 'childlist') { console.log('a child node has been added or removed.'); } else if (mutation.type === 'attributes') { console.log('the ' + mutation.attributename + ' attribute was modified.'); } } }; // create an observer instance linked to the callback function const observer = new mutationobserver(callback); // start observing the target node for configured mutations observer.observe(targetnode, config); // later, you can stop observing observer.disconnect(); specifications specification status comment domthe definition of 'mutationobserver' in that specification.
MutationObserverInit.attributeFilter - Web APIs
mutation.target.username); break; } break; } }); } var userlistelement = document.queryselector("#userlist"); var observer = new mutationobserver(callback); observer.observe(userlistelement, { attributefilter: [ "status", "username" ], attributeoldvalue: true, subtree: true }); the callback() function—which will be passed into the observe() method when starting the observer, looks at each item in the list of mutationrecord objects.
MutationObserverInit.attributeOldValue - Web APIs
" changed to " + mutation.target[mutation.attributename] + " (was " + mutation.oldvalue + ")"); break; } }); } var targetnode = document.queryselector("#target"); var observer = new mutationobserver(callback); observer.observe(targetnode, { attributes: true, attributeoldvalue: true }); the callback() function—which will be passed into the observe() method when starting the observer, looks at each item in the list of mutationrecord objects.
MutationObserverInit.characterData - Web APIs
if true, the callback specified when observe() was used to start observing the node or subtree is called any time the contents of a text node are changed.
NDEFWriter.write() - Web APIs
WebAPINDEFWriterwrite
networkerror transfer failed after it already started (e.g., the tag was removed from the reader).
Navigator.msLaunchUri() - Web APIs
the mslaunchuri() method is a microsoft extension to the navigator interface, which starts a service or app, such as an email client, that handles a given protocol.
NavigatorID.userAgent - Web APIs
new browsers may start using the same ua, or part of it, as an older browser: you really have no guarantee that the browser agent is indeed the one advertised by this property.
Node.cloneNode() - Web APIs
WebAPINodecloneNode
starting with gecko 29.0 (firefox 29 / thunderbird 29 / seamonkey 2.26)), a shallow clone is defaulted instead of a deep clone.
NotifyAudioAvailableEvent - Web APIs
time a floating-point value indicating the time in seconds at which the first sample in the framebuffer occurs, relative to the start of the audio track.
OfflineAudioCompletionEvent - Web APIs
note: this interface is marked as deprecated; it is still supported for legacy reasons, but it will soon be superseded when the promise version of offlineaudiocontext.startrendering is supported in browsers, which will no longer need it.
OscillatorNode.detune - Web APIs
// create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(440, audioctx.currenttime); // value in hertz oscillator.detune.setvalueattime(100, audioctx.currenttime); // value in cents oscillator.start(); specifications specification status comment web audio apithe definition of 'detune' in that specification.
OscillatorNode.frequency - Web APIs
// create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(440, audioctx.currenttime); // value in hertz oscillator.start(); specifications specification status comment web audio apithe definition of 'frequency' in that specification.
OscillatorNode.onended - Web APIs
// create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.value = 440; // value in hertz oscillator.start(); // start the tone playing oscillator.stop(5); // the tone will stop again in 5 seconds.
OscillatorNode.stop() - Web APIs
// create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.connect(audioctx.destination); oscillator.start(); oscillator.stop(audioctx.currenttime + 2); // stop 2 seconds after the current time specifications specification status comment web audio apithe definition of 'stop' in that specification.
OscillatorNode.type - Web APIs
// create web audio api context var audioctx = new (window.audiocontext || window.webkitaudiocontext)(); // create oscillator node var oscillator = audioctx.createoscillator(); oscillator.type = 'square'; oscillator.frequency.setvalueattime(440, audioctx.currenttime); // value in hertz oscillator.start(); specifications specification status comment web audio apithe definition of 'type' in that specification.
PasswordCredential - Web APIs
starting with the form element.
Path2D() - Web APIs
WebAPIPath2DPath2D
the path will move to point (m10 10) and then move horizontally 80 points to the right (h 80), then 80 points down (v 80), then 80 points to the left (h -80), and then back to the start (z).
PaymentRequest.PaymentRequest() - Web APIs
starting with more recent browsers, this parameter is more generic than credit cards, it is a single domstring, and the meaning of the data parameter changes with the supportedmethods.
Performance.timeOrigin - Web APIs
the timeorigin read-only property of the performance interface returns the high resolution timestamp of the start time of the performance measurement.
PerformanceEntry.name - Web APIs
ome performance entries via the mark() method performance.mark("begin"); do_work(50000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } } function check_performanceentry(obj) { var properties = ["name", "entrytype", "starttime", "duration"]; var methods = ["tojson"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in obj; if (supported) log("..." + properties[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported ...
PerformanceEntry.toJSON() - Web APIs
ome performance entries via the mark() method performance.mark("begin"); do_work(50000); performance.mark("end"); // use getentries() to iterate through the each entry var p = performance.getentries(); for (var i=0; i < p.length; i++) { log("entry[" + i + "]"); check_performanceentry(p[i]); } } function check_performanceentry(obj) { var properties = ["name", "entrytype", "starttime", "duration"]; var methods = ["tojson"]; for (var i=0; i < properties.length; i++) { // check each property var supported = properties[i] in obj; if (supported) log("..." + properties[i] + " = " + obj[properties[i]]); else log("..." + properties[i] + " = not supported"); } for (var i=0; i < methods.length; i++) { // check each method var supported ...
PerformanceMark - Web APIs
performanceentry.starttime returns the domhighrestimestamp when performance.mark() was called.
PerformanceNavigationTiming.domComplete - Web APIs
on print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = ...
PerformanceNavigationTiming.domContentLoadedEventEnd - Web APIs
on print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.dominteractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount...
PerformanceNavigationTiming.domInteractive - Web APIs
on print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.dominteractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount...
PerformanceNavigationTiming.loadEventEnd - Web APIs
on print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.dominteractive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount...
PerformanceNavigationTiming.redirectCount - Web APIs
on print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = ...
PerformanceNavigationTiming.unloadEventEnd - Web APIs
on print_nav_timing_data() { // use getentriesbytype() to just get the "navigation" events var perfentries = performance.getentriesbytype("navigation"); for (var i=0; i < perfentries.length; i++) { console.log("= navigation entry[" + i + "]"); var p = perfentries[i]; // dom properties console.log("dom content loaded = " + (p.domcontentloadedeventend - p.domcontentloadedeventstart)); console.log("dom complete = " + p.domcomplete); console.log("dom interactive = " + p.interactive); // document load and unload time console.log("document load = " + (p.loadeventend - p.loadeventstart)); console.log("document unload = " + (p.unloadeventend - p.unloadeventstart)); // other properties console.log("type = " + p.type); console.log("redirectcount = ...
PerformanceObserver.takeRecords() - Web APIs
example var observer = new performanceobserver(function(list, obj) { var entries = list.getentries(); for (var i=0; i < entries.length; i++) { // process "mark" and "frame" events } }); observer.observe({entrytypes: ["mark", "frame"]}); var records = observer.takerecords(); console.log(records[0].name); console.log(records[0].starttime); console.log(records[0].duration); specifications specification status comment performance timeline level 2the definition of 'takerecords()' in that specification.
PerformanceTiming.domLoading - Web APIs
the legacy performancetiming.domloading read-only property returns an unsigned long long representing the moment, in miliseconds since the unix epoch, when the parser started its work, that is when its document.readystate changes to 'loading' and the corresponding readystatechange event is thrown.
PerformanceTiming.domainLookupEnd - Web APIs
if a persistent connection is used, or the information is stored in a cache or a local resource, the value will be the same as performancetiming.fetchstart.
Using the Performance API - Web APIs
function calculate_time() { var starttime; var endtime; starttime = performance.now(); do_task(); endtime = performance.now(); return (endtime - starttime); } serializing the performance object json serialization of the performance object is done via the tojson() method.
Performance Timeline - Web APIs
starttime a high resolution timestamp representing the starting time for the performance entry.
ProgressEvent.initProgressEvent() - Web APIs
the following values are allowed: value meaning loadstart the operation has started.
PromiseRejectionEvent.promise - Web APIs
window.onunhandledrejection = function(event) { if (event.reason.code && event.reason.code == "module not ready") { window.requestidlecallback(function(deadline) { loadmodule(event.reason.modulename) .then(performstartup); }); event.preventdefault(); } } specifications specification status comment html living standardthe definition of 'promiserejectionevent.promise' in that specification.
PushSubscription - Web APIs
pushsubscription.unsubscribe() starts the asynchronous process of unsubscribing from the push service, returning a promise that resolves to a boolean when the current subscription is successfully unregistered.
Push API - Web APIs
WebAPIPush API
the service worker will be started as necessary to handle incoming push messages, which are delivered to the serviceworkerglobalscope.onpush event handler.
RTCConfiguration.bundlePolicy - Web APIs
max-bundle the ice agent starts by creating a single rtcdtlstransport to handle all of the connection's media.
RTCConfiguration.iceServers - Web APIs
however, the new list of servers is used for any future renegotiation, such as while handling an ice restart.
RTCConfiguration - Web APIs
you may find in some cases that connections can be established more quickly by allowing the ice agent to start fetching ice candidates before you start trying to connect, so that they're already available for inspection when rtcpeerconnection.setlocaldescription() is called.
RTCDTMFSender.ontonechange - Web APIs
syntax rtcdtmfsender.ontonechange = tonechangehandlerfunction; value a function which is called when a tonechange event is sent to the rtcdtmfsender, indicating that a dtmf tone has either started playing, or if all tones have finished playing.
RTCDTMFSender.toneBuffer - Web APIs
in this example, we would send "*" to request access to the vm system, then, after a pause, send a "1" to start playback of voicemail messages, then after a pause, dial "5555" as a pin number to open the messages.
RTCDTMFSender: tonechange event - Web APIs
bubbles no cancelable no interface rtcdtmftonechangeevent event handler property ontonechange to determine what tone started playing, or if a tone stopped playing, check the value of the event's tone property.
RTCDTMFToneChangeEvent - Web APIs
the rtcdtmftonechangeevent interface represents events sent to indicate that dtmf tones have started or finished playing.
RTCDataChannel: error event - Web APIs
tpcausecodes = [ "no sctp error", "invalid stream identifier", "missing mandatory parameter", "stale cookie error", "sender is out of resource (i.e., memory)", "unable to resolve address", "unrecognized sctp chunk type received", "invalid mandatory parameter", "unrecognized parameters", "no user data (sctp data chunk has no data)", "cookie received while shutting down", "restart of an association with new addresses", "user-initiated abort", "protocol violation" ]; dc.addeventlistener("error", ev => { const err = ev.error; console.error("webrtc error: ", err.message); // handle specific error detail types switch(err.errordetail) { case "sdp-syntax-error": console.error(" sdp syntax error in line ", err.sdplinenumber); break; case "id...
RTCDataChannel.onmessage - Web APIs
example this code snippet creates a peer connection, adds a data channel to it, and starts creating new <p> (paragraph) elements each time a message arrives, with the message's contents displayed inside it.
RTCDataChannel.readyState - Web APIs
this is the state of a new rtcdatachannel after being created by rtcpeerconnection.createdatachannel() (on the peer which started the connection process).
RTCDtlsTransport.state - Web APIs
its value is one of the following: new the initial state when dtls has not started negotiating yet.
RTCIceServer - Web APIs
avoid specifying an unnecessarily large number of urls in the urls property; the startup time for your connection will go up substantially.
RTCIceTransport - Web APIs
this occurs during negotiation or renegotiation, including after an ice restart, which reuses the existing rtcicetransport objects.
RTCInboundRtpStreamStats.averageRtcpInterval - Web APIs
since this value is also used to determine the number of seconds after a stream starts to flow before the first rtcp packet should be sent, the result is that if many users try to start using the service at the same time, the server won't be flooded with rtcp packets coming in all at once.
RTCOfferOptions - Web APIs
icerestart optional a boolean which, when set to true, tells createoffer() to generate and use new values for the identifying properties of the sdp it creates, resulting in a request that triggers renegotiation of the ice connection.
RTCOutboundRtpStreamStats.averageRtcpInterval - Web APIs
since this value is also used to determine the number of seconds after a stream starts to flow before the first rtcp packet should be sent, the result is that if many users try to start using the service at the same time, the server won't be flooded with rtcp packets coming in all at once.
RTCPeerConnection() - Web APIs
you may find in some cases that connections can be established more quickly by allowing the ice agent to start fetching ice candidates before you start trying to connect, so that they're already available for inspection when rtcpeerconnection.setlocaldescription() is called.
RTCPeerConnection.addTrack() - Web APIs
see starting negotiation in signaling and video calling for details.
RTCPeerConnection.createDataChannel() - Web APIs
if the new data channel is the first one added to the connection, renegotiation is started by delivering a negotiationneeded event.
RTCPeerConnection: icegatheringstatechange event - Web APIs
when ice firststarts to gather connection candidates, the value changes from new to gathering to indicate that the process of collecting candidate configurations for the connection has begun.
RTCPeerConnection: icecandidate event - Web APIs
if you need to perform any special actions when there are no further candidates expected, you're much better off watching the ice gathering state by watching for icegatheringstatechange events: pc.addeventlistener("icegatheringstatechange", ev => { switch(pc.icegatheringstate) { case "new": /* gathering is either just starting or has been reset */ break; case "gathering": /* gathering has begun or is ongoing */ break; case "complete": /* gathering has ended */ break; } }); as you can see in this example, the icegatheringstatechange event lets you know when the value of the rtcpeerconnection property icegatheringstate has been updated.
RTCPeerConnection.oniceconnectionstatechange - Web APIs
example the example below watches the state of the ice agent for a failure or unexpected closure and takes appropriate action, such as presenting an error message or attempting to restart the ice agent.
RTCRtpReceiver.getCapabilities() static function - Web APIs
it's simply a means of determining what might be usable before starting to try to access media.
RTCRtpSender.getCapabilities() static function - Web APIs
it's simply a means of determining what might be usable before starting to try to access media.
RTCSessionDescription - Web APIs
example signalingchannel.onmessage = function (evt) { if (!pc) start(false); var message = json.parse(evt.data); if (message.sdp) pc.setremotedescription(new rtcsessiondescription(message), function () { // if we received an offer, we need to answer if (pc.remotedescription.type == "offer") pc.createanswer(localdesccreated, logerror); }, logerror); else pc.addicecandidate(new rtcicecandid...
RTCStatsReport - Web APIs
candidate pairs other than the currently active pair for the transport are deleted when the rtcpeerconnection changes its rtcpeerconnection.icegatheringstate to new during an ice restart.
RTCStatsType - Web APIs
candidate pairs other than the currently active pair for the transport are deleted when the rtcpeerconnection changes its rtcpeerconnection.icegatheringstate to new during an ice restart.
Range.collapse() - Web APIs
WebAPIRangecollapse
syntax range.collapse(tostart); parameters tostart optional a boolean value: true collapses the range to its start, false to its end.
Range.createContextualFragment() - Web APIs
the range.createcontextualfragment() method returns a documentfragment by invoking the html fragment parsing algorithm or the xml fragment parsing algorithm with the start of the range (the parent of the selected node) as the context node.
Range.endContainer - Web APIs
syntax endrangenode = range.endcontainer; example var range = document.createrange(); range.setstart(startnode,startoffset); range.setend(endnode,endoffset); endrangenode = range.endcontainer; specifications specification status comment domthe definition of 'range.endcontainer' in that specification.
Range.selectNode() - Web APIs
WebAPIRangeselectNode
the parent node of the start and end of the range will be the same as the parent of the referencenode.
Range.surroundContents() - Web APIs
the range.surroundcontents() method moves content of the range into a new node, placing the new node at the start of the specified range.
Range.toString() - Web APIs
WebAPIRangetoString
look at the output below.</p> <p id="log"></p> javascript const range = document.createrange(); range.setstartbefore(document.getelementsbytagname('b').item(0), 0); range.setendafter(document.getelementsbytagname('b').item(1), 0); document.getelementbyid('log').textcontent = range.tostring(); result specifications specification status comment domthe definition of 'range.tostring()' in that specification.
ReadableStream.pipeThrough() - Web APIs
in addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled.
ReadableStream.pipeTo() - Web APIs
in addition, if the destination writable stream starts out closed or closing, the source readable stream will no longer be canceled.
ReadableStream - Web APIs
fetch("https://www.example.org/").then((response) => { const reader = response.body.getreader(); const stream = new readablestream({ start(controller) { // the following function handles each data chunk function push() { // "done" is a boolean and value a "uint8array" reader.read().then(({ done, value }) => { // is there no more data to read?
ReadableStreamDefaultReader - Web APIs
fetch("https://www.example.org/").then((response) => { const reader = response.body.getreader(); const stream = new readablestream({ start(controller) { // the following function handles each data chunk function push() { // "done" is a boolean and value a "uint8array" return reader.read().then(({ done, value }) => { // is there no more data to read?
Report - Web APIs
WebAPIReport
examples in our deprecation_report.html example, we create a simple reporting observer to observe usage of deprecated features on our web page: let options = { types: ['deprecation'], buffered: true } let observer = new reportingobserver(function(reports, observer) { 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
syntax new reportingobserver(callback[, options]); parameters callback a callback function that runs when the observer starts to collect reports (i.e.
ReportingObserver.disconnect() - Web APIs
the disconnect() method of the reportingobserver interface stops a reporting observer that had previously started observing from collecting reports.
ReportingObserver.observe() - Web APIs
the observe() method of the reportingobserver interface instructs a reporting observer to start collecting reports in its report queue.
ResizeObserver.observe() - Web APIs
the observe() method of the resizeobserver interface starts observing the specified element or svgelement.
Resize Observer API - Web APIs
interfaces resizeobserver provides the ability to register new observers and to start and stop observing elements.
SVGAnimationElement: beginEvent event - Web APIs
it will be raised each time the element begins the active duration (i.e., when it restarts, but not when it repeats).
SVGAnimationElement - Web APIs
svganimationelement.getstarttime() returns a float representing the begin time, in seconds, for this animation element's current interval, if it exists, regardless of whether the interval has begun yet.
SVGLength - Web APIs
WebAPISVGLength
nknown = 0 svg_lengthtype_number = 1 svg_lengthtype_percentage = 2 svg_lengthtype_ems = 3 svg_lengthtype_exs = 4 svg_lengthtype_px = 5 svg_lengthtype_cm = 6 svg_lengthtype_mm = 7 svg_lengthtype_in = 8 svg_lengthtype_pt = 9 svg_lengthtype_pc = 10 normative document svg 1.1 (2nd edition) example <svg height="200" onload="start();" version="1.1" width="200" xmlns="http://www.w3.org/2000/svg"> <script type="text/javascript"><![cdata[ function start() { var rect = document.getelementbyid("myrect"); var val = rect.x.baseval; // read x in pixel and cm units console.log("value: " + val.value + ", valueinspecifiedunits: " + val.unittype + ": " + val.valueinspecifiedunits + ", valueasstring:...
SVGLengthList - Web APIs
note: starting in gecko 5.0,the svglengthlist dom interface is now indexable and can be accessed like arrays interface overview also implement none methods void clear() svglength initialize(in svglength newitem) svglength getitem(in unsigned long index) svglength insertitembefore(in svglength newitem, in unsigned long index) svglength replaceitem(in svglength newitem, in unsigned long index) svglength removeitem(in unsigned long index) svglength appenditem(in svglength newitem) properties ...
SVGNumberList - Web APIs
note: starting in gecko 5.0,the svgnumberlist dom interface is now indexable and can be accessed like arrays.
SVGSVGElement - Web APIs
svgsvgelement.getcurrenttime() returns the current time in seconds relative to the start time for the current svg document fragment.
SVGTextPathElement - Web APIs
svgtextpathelement.startoffset read only an svganimatedlength corresponding to the x component of the startoffset attribute of the given element.
SVGTransformList - Web APIs
note: starting in gecko 9.0,the svgtransformlist dom interface is now indexable and can be accessed like arrays interface overview also implement none methods void clear() svgtransform initialize(in svgtransform newitem) svgtransform getitem(in unsigned long index) svgtransform insertitembefore(in svgtransform newitem, in unsigned long index) svgtransform replaceitem(in svgtransform newitem, in unsigned long index) svgtransform removeitem(in unsigned long index) svgtransform appenditem(in ...
Screen Capture API - Web APIs
to start capturing video from the screen, you call getdisplaymedia() on the instance of media navigator.mediadevices: capturestream = await navigator.mediadevices.getdisplaymedia(displaymediaoptions); the promise returned by getdisplaymedia() resolves to a mediastream which streams the captured media.
ScriptProcessorNode.bufferSize - Web APIs
< 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' in that specification.
ScriptProcessorNode.onaudioprocess - Web APIs
ffer.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 'onaudioprocess' in that specification.
ScriptProcessorNode - Web APIs
< 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 'scriptprocessornode' in that specification.
Selection.isCollapsed - Web APIs
no text is selected when the selection's start and end points are at the same position in the content.
Selection.modify() - Web APIs
WebAPISelectionmodify
note: starting in gecko 5.0, the "word" granularity no longer includes the following space, regardless of the default platform behavior.
Sensor - Web APIs
WebAPISensor
methods sensor.start() activates one of the sensors based on sensor.
ServiceWorkerContainer - Web APIs
serviceworkercontainer.startmessages() explicitly starts the flow of messages being dispatched from a service worker to pages under its control (e.g.
ServiceWorkerRegistration.showNotification() - Web APIs
for example, this could be in the past when a notification is used for a message that couldn’t immediately be delivered because the device was offline, or in the future for a meeting that is about to start.
SharedWorker.port - Web APIs
WebAPISharedWorkerport
multiple scripts can then access the worker through a messageport object accessed using the sharedworker.port property — the port is started using its start() method: var myworker = new sharedworker('worker.js'); myworker.port.start(); for a full example, see our basic shared worker example (run shared worker.) specifications specification status comment html living standardthe definition of 'abstractworker.onerror' in that specification.
SharedWorkerGlobalScope: connect event - Web APIs
self.onconnect = function(e) { var port = e.ports[0]; port.onmessage = function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); } port.start(); } for a complete running example, see our basic shared worker example (run shared worker.) addeventlistener equivalent you could also set up an event handler using the addeventlistener() method: self.addeventlistener('connect', function(e) { var port = e.ports[0]; port.onmessage = function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerres...
SharedWorkerGlobalScope.onconnect - Web APIs
onconnect = function(e) { var port = e.ports[0]; port.onmessage = function(e) { var workerresult = 'result: ' + (e.data[0] * e.data[1]); port.postmessage(workerresult); } port.start(); } for a complete running example, see our basic shared worker example (run shared worker.) note: the data property of the event object used to be null in firefox.
SourceBuffer.abort() - Web APIs
saying that, current implementations can be useful in certain situations, when you want to stop the current append (or whatever) operation occuring on a sourcebuffer, and then immediately start performing operations on it again.
SourceBuffer.appendWindowEnd - Web APIs
exception explanation invalidaccesserror an attempt was made to set the value to less than or equal to sourcebuffer.appendwindowstart, or nan.
SpeechRecognition.abort() - Web APIs
al | 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 definition of 'abort()' in that spe...
SpeechRecognition.stop() - Web APIs
al | 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 definition of 'stop()' in that spec...
SpeechSynthesisEvent.elapsedTime - Web APIs
the elapsedtime read-only property of the speechsynthesisutterance interface returns the elapsed time in seconds after the speechsynthesisutterance.text started being spoken that the event was triggered at.
SpeechSynthesisEvent - Web APIs
speechsynthesisevent.elapsedtime read only returns the elapsed time in milliseconds after the speechsynthesisutterance.text started being spoken that the event was triggered at.
StylePropertyMapReadOnly.get() - Web APIs
let's start by creating a link inside a paragraph in our html, and adding a definition list which we will populate with javascript: <p> <a href="https://example.com">link</a> </p> <dl id="regurgitation"></dl> we add a bit of css, including a custom property and an inhertable property: p { font-weight: bold; } a { --colour: red; color: var(--colour); } we use the element's computedstylemap() to return a st...
SubtleCrypto.digest() - Web APIs
stmessage(message) { const msguint8 = new textencoder().encode(message); // encode as (utf-8) uint8array const hashbuffer = await crypto.subtle.digest('sha-256', msguint8); // hash the message const hasharray = array.from(new uint8array(hashbuffer)); // convert buffer to byte array const hashhex = hasharray.map(b => b.tostring(16).padstart(2, '0')).join(''); // convert bytes to hex string return hashhex; } const digesthex = await digestmessage(text); console.log(digesthex); specifications specification status comment web cryptography apithe definition of 'subtlecrypto.digest()' in that specification.
TextRange - Web APIs
WebAPITextRange
textrange.movestart() moves the start of the range by a specified number of units.
TextTrack.mode - Web APIs
WebAPITextTrackmode
the user can then navigate to the desired chapter, which begins at the cue's start position and ends at the cue's end position.
TimeRanges.end() - Web APIs
WebAPITimeRangesend
example given a video element with the id "myvideo": var v = document.getelementbyid("myvideo"); var buf = v.buffered; var numranges = buf.length; if (buf.length == 1) { // only one range if (buf.start(0) == 0 && buf.end(0) == v.duration) { // the one range starts at the beginning and ends at // the end of the video, so the whole thing is loaded } } this example looks at the time ranges and looks to see if the entire video has been loaded.
TimeRanges.length - Web APIs
WebAPITimeRangeslength
syntax length = timeranges.length; example given a video element with the id "myvideo": var v = document.getelementbyid("myvideo"); var buf = v.buffered; var numranges = buf.length; if (buf.length == 1) { // only one range if (buf.start(0) == 0 && buf.end(0) == v.duration) { // the one range starts at the beginning and ends at // the end of the video, so the whole thing is loaded } } this example looks at the time ranges and looks to see if the entire video has been loaded.
Touch() - Web APIs
WebAPITouchTouch
"target", required, of type eventtarget, the item at which the touch point started when it was first placed on the surface.
Touch - Web APIs
WebAPITouch
touch.target read only returns the element on which the touch point started when it was first placed on the surface, even if the touch point has since moved outside the interactive area of that element or even been removed from the document.
TouchEvent() - Web APIs
"targettouches", optional and defaulting to [], of type touch[], that is a list of objects for every point of contact that is touching the surface and started on the element that is the target of the current event.
TouchEvent.changedTouches - Web APIs
the changedtouches read-only property is a touchlist whose touch points (touch objects) varies depending on the event type, as follows: for the touchstart event, it is a list of the touch points that became active with the current event.
TouchList.item() - Web APIs
WebAPITouchListitem
target = document.getelementbyid("target"); target.addeventlistener('touchstart', function(ev) { // if this touchstart event started on element target, // set touch to the first item in the targettouches list; // otherwise set touch to the first item in the touches list var touch; if (ev.targettouches.length >= 1) touch = ev.targettouches.item(0); else touch = ev.touches.item(0); }, false); specifications specification status commen...
TouchList.length - Web APIs
WebAPITouchListlength
target = document.getelementbyid("target"); target.addeventlistener('touchstart', function(ev) { // if this touchstart event started on element target, // set touch to the first item in the targettouches list; // otherwise set touch to the first item in the touches list var touch; if (ev.targettouches.length >= 1) touch = ev.targettouches.item(0); else touch = ev.touches.item(0); }, false); specifications specification status comment...
TransitionEvent.pseudoElement - Web APIs
the transitionevent.pseudoelement read-only property is a domstring, starting with '::', containing the name of the pseudo-element the animation runs on.
URLSearchParams.set() - Web APIs
examples let's start with a simple example: let url = new url('https://example.com?foo=1&bar=2'); let params = new urlsearchparams(url.search.slice(1)); //add a third parameter.
USBDevice.open() - Web APIs
WebAPIUSBDeviceopen
the open() method of the usbdevice interface returns a promise that resolves when a device session has started.
USBDevice.opened - Web APIs
WebAPIUSBDeviceopened
the opened read only property of the usbdevice interface indicates whether a session has been started with a paired usb device.
Using the User Timing API - Web APIs
creating a performance measure a measure is created by calling performance.measure(measurename, startmarkname, endmarkname) where measurename is the measure's name and startmarkname and endmarkname are the start and end names, respectively, of the marks the measure will be placed between (in the performance timeline).
VTTRegion - Web APIs
WebAPIVTTRegion
region.viewportanchorx = 25; // have the region start at 25% from the left.
VideoPlaybackQuality - Web APIs
creationtime read only a domhighrestimestamp containing the time in miliseconds between the start of the navigation and the creation of the object.
WebGL2RenderingContext.beginTransformFeedback() - Web APIs
the webgl2renderingcontext.begintransformfeedback() method of the webgl 2 api starts a transform feedback operation.
WebGL2RenderingContext.bindBufferRange() - Web APIs
offset a glintptr specifying the starting offset.
WebGL2RenderingContext.copyBufferSubData() - Web APIs
readoffset writeoffset a glintptr specifying the byte offset from which to start reading from or writing to the buffer.
WebGL2RenderingContext.drawArraysInstanced() - Web APIs
first a glint specifying the starting index in the array of vector points.
WebGLRenderingContext.bindAttribLocation() - Web APIs
this name cannot start with "webgl_" or "_webgl_", as these are reserved for use by webgl.
WebGLRenderingContext.bufferData() - Web APIs
srcoffset a gluint specifying the element index offset where to start reading the buffer.
WebGLRenderingContext.drawArrays() - Web APIs
first a glint specifying the starting index in the array of vector points.
WebGLRenderingContext.generateMipmap() - Web APIs
it starts with the resolution of the texture image and halves the resolution until a 1x1 dimension texture image is created.
WebGLRenderingContext.getUniformLocation() - Web APIs
the name can't have any whitespace in it, and you can't use this function to get the location of any uniforms starting with the reserved string "gl_", since those are internal to the webgl layer.
WebGLRenderingContext.isContextLost() - Web APIs
the user updates their graphics driver on an operating system that allows graphics drivers to be updated without restarting the system.
Basic scissoring - Web APIs
only when the webgl state has been satisfactorily tweaked, we execute the drawing command (in this case, clear()) that starts the processing of fragments down the graphics pipeline.
Animating objects with WebGL - Web APIs
making the square rotate let's start by making the square rotate.
Creating 3D objects using WebGL - Web APIs
this code starts by defining a color for each face, then uses a loop to assemble an array of all the colors for each of the vertices.
Using shaders to apply color in WebGL - Web APIs
1.0, 1.0, 1.0, // white 1.0, 0.0, 0.0, 1.0, // red 0.0, 1.0, 0.0, 1.0, // green 0.0, 0.0, 1.0, 1.0, // blue ]; const colorbuffer = gl.createbuffer(); gl.bindbuffer(gl.array_buffer, colorbuffer); gl.bufferdata(gl.array_buffer, new float32array(colors), gl.static_draw); return { position: positionbuffer, color: colorbuffer, }; } this code starts by creating a javascript array containing four 4-value vectors, one for each vertex color.
WebRTC Statistics API - Web APIs
mapping of statistic category names to the dictionaries they implement statistic category name (rtcstatstype) description dictionaries implemented candidate-pair statistics describing the change from one rtcicetransport to another, such as during an ice restart.
WebXR application life cycle - Web APIs
this serves as preparation for the next few articles in these webxr guides, which cover starting up and shutting down a webxr session, geometry, simulating cameras, spatial tracking, and more.
WebXR permissions and security - Web APIs
once that check is passed, the request to enter immersive-vr mode is allowed if all of the following are true: the requestsession() call was issued by code executing within the handler for a user event, or the from the startup code for a user-launched web application.
Keyframe Formats - Web APIs
this is equivalent to specifying start and end states in percentages in css stylesheets using @keyframes.
Web Speech API - Web APIs
speech synthesis speechsynthesis the controller interface for the speech service; this can be used to retrieve information about the synthesis voices available on the device, start and pause speech, and other commands besides.
Using the Web Storage API - Web APIs
testing whether your storage has been populated to start with, in main.js, we test whether the storage object has already been populated (i.e., the page was previously accessed): if(!localstorage.getitem('bgcolor')) { populatestorage(); } else { setstyles(); } the storage.getitem() method is used to get a data item from storage; in this case, we are testing to see whether the bgcolor item exists; if not, we run populatestorage() to add the existi...
Web Storage API - Web APIs
note: from firefox 45 onwards, when the browser crashes/restarts, the amount of data saved per origin is limited to 10mb.
Window: afterprint event - Web APIs
the afterprint event is fired after the associated document has started printing or the print preview has been closed.
Window.devicePixelRatio - Web APIs
then the updatepixelratio() function is called once to display the starting value, after which the media query is created using matchmedia() and addeventlistener() is called to set up updatepixelratio() as a handler for the change event.
window.dump() - Web APIs
WebAPIWindowdump
the message passed to dump() is sent to the system console (native console) if the firefox process was started with the -console option.
Window.getSelection() - Web APIs
htmlinputelement.setselectionrange() or the selectionstart and selectionend properties could be used to work around this.
Window.mozPaintCount - Web APIs
the window.mozpaintcount value is a long long, and starts at zero when the document is first created, incrementing by one each time the document is painted.
Privileged features - Web APIs
note also that starting in gecko 2.0, you can use window.showmodaldialog() without universalbrowserwrite privileges.
Window.open() - Web APIs
WebAPIWindowopen
the actual fetching of the url is deferred and starts after the current script block finishes executing.
window.postMessage() - Web APIs
s from your origin) cross-origin-opener-policy: same-origin cross-origin-embedder-policy: require-corp to check if cross origin isolation has been successful, you can test against the crossoriginisolated property available to window and worker contexts: if (crossoriginisolated) { // post sharedarraybuffer } else { // do something else } see also planned changes to shared memory which is starting to roll out to browsers (firefox 79, for example).
Window.speechSynthesis - Web APIs
inside the inputform.onsubmit handler, we stop the form submitting with preventdefault(), create a new speechsynthesisutterance instance containing the text from the text <input>, set the utterance's voice to the voice selected in the <select> element, and start the utterance speaking via the speechsynthesis.speak() method.
Window: transitionrun event - Web APIs
examples this code adds a listener to the transitionrun event: window.addeventlistener('transitionrun', () => { console.log('transition is running but hasn't necessarily started transitioning yet'); }); the same, but using the ontransitionrun property instead of addeventlistener(): window.ontransitionrun = () => { console.log('transition started running'); }; see a live example of this event.
WindowEventHandlers.onafterprint - Web APIs
the beforeprint and afterprint events allow pages to change their content before printing starts (perhaps to remove a banner, for example) and then revert those changes after printing has completed.
WindowEventHandlers.onbeforeprint - Web APIs
the beforeprint and afterprint events allow pages to change their content before printing starts (perhaps to remove a banner, for example) and then revert those changes after printing has completed.
WindowOrWorkerGlobalScope - Web APIs
windoworworkerglobalscope.fetch() starts the process of fetching a resource from the network.
Worker() - Web APIs
WebAPIWorkerWorker
exceptions a securityerror is raised if the document is not allowed to start workers, e.g.
WorkerGlobalScope.dump() - Web APIs
example to write an output from your worker to your computer's terminal, you first have to run an instance of firefox started from your command line/terminal.
WorkerGlobalScope - Web APIs
windoworworkerglobalscope.fetch() starts the process of fetching a resource from the network.
WritableStream.WritableStream() - Web APIs
underlyingsink can contain the following: start(controller) optional this is a method, called immediately when the object is constructed.
WritableStreamDefaultController.error() - Web APIs
examples const writablestream = new writablestream({ start(controller) { // do stuff with controller // error stream if necessary controller.error('my error is broken'); }, write(chunk, controller) { ...
WritableStreamDefaultController - Web APIs
examples const writablestream = new writablestream({ start(controller) { // do stuff with controller // error stream if necessary controller.error('my stream is broken'); }, write(chunk, controller) { ...
WritableStreamDefaultWriter.closed - Web APIs
examples const writablestream = new writablestream({ start(controller) { }, write(chunk, controller) { ...
XMLHttpRequest.upload - Web APIs
the following events can be triggered on an upload object and used to monitor the upload: event event listener description loadstart onloadstart the upload has begun.
XMLHttpRequestEventTarget - Web APIs
xmlhttprequesteventtarget.onloadstart contains the function that gets called when the http request first begins loading data and the loadstart event is received by this object.
XRBoundedReferenceSpace - Web APIs
this is typically used when the xr system is capable of tracking the user's physical movement within a limited distance of their starting position.
XRInputSourceArray.forEach() - Web APIs
the xrinputsourcearray method foreach() executes the specified callback once for each input source in the array, starting at index 0 and progressing until the end of the list.
XRInputSourceArray.length - Web APIs
the first takes the user to an amazon.com search for vr controllers, and the second calls a quitgame() function to start shutting the game program down.
XRInputSourceArray.values() - Web APIs
return value a javascript iterator that can be used to walk through the list of xrinputsource objects in the array, starting with the first entry (at index 0) and proceeding straight through the list.
XRRigidTransform() - Web APIs
examples in this example, the beginning of the animation of a scene is shown, starting with a request for a reference space of a given type, then shifting the coordinate system based on a transform before requesting the first animation frame.
XRRigidTransform.position - Web APIs
example to create a reference space which can be used to place an object at eye level (assuming eye level is 1.5 meters): function onsessionstarted(xrsession) { xrsession.addeventlistener("end", onsessionended); gl = initgraphics(xrsession); let gllayer = new xrwebgllayer(xrsession, gl); xrsession.updaterenderstate({ baselayer: gllayer }); if (immersivesession) { xrsession.requestreferencespace("bounded-floor").then((refspace) => { refspacecreated(refspace); }).catch(() => { session.requestreferencespace("l...
XRRigidTransform - Web APIs
xrsession.requestreferencespace(refspacetype) .then((refspace) => { xrreferencespace = refspace; xrreferencespace = xrreferencespace.getoffsetreferencespace( new xrrigidtransform(viewerstartposition, cubeorientation)); animationframerequestid = xrsession.requestanimationframe(drawframe); specifications specification status comment webxr device apithe definition of 'xrrigidtransform' in that specification.
XRSession.onselect - Web APIs
the select event is sent after tracking of the primary action begins, as announced by the selectstart event, and immediately before the tracking of the primary action ends, which is announced by the selectend event.
XRSession.onselectend - Web APIs
note: not to be confused with xrsession.onselectstart and xrsession.onselect.
XRSession.onsqueeze - Web APIs
xrsession.onsqueeze = event => { if (event.inputsource.handedness == user.handedness) { let targetraypose = event.frame.getpose(event.inputsource.targetrayspace, myrefspace); if (user.heldobject && targetraypose) { dropobjectusingray(user.heldobject, targetraypose.transform.matrix): } } }; see the examples in the onsqueezestart and onsqueezeend event handlers for the reset of the event handling related to this approach.
XRSession.onsqueezeend - Web APIs
syntax xrsession.onsqueezeend = squeezeendhandlerfunction; value a function to be invoked whenever the xrsession receives a squeezestart event, indicating the ending of a primary squeeze action.
XRSession: select event - Web APIs
bubbles yes cancelable no interface xrinputsourceevent event handler property onselect for details on how the selectstart, select, and selectend events work, and how you should react to them, see primary actions in inputs and input sources.
XRSession.updateRenderState() - Web APIs
function onxrsessionstarted(xrsession) { let glcanvas = document.createelement("canvas"); let gl = glcanvas.getcontext("webgl", { xrcompatible: true }); loadwebglresources(); xrsession.updaterenderstate({ baselayer: new xrwebgllayer(xrsession, gl) }); } specifications specification status comment webxr device apithe definition of 'xrsession.updaterenderstate()' in that specificatio...
XRWebGLLayer.getNativeFramebufferScaleFactor() static method - Web APIs
ss of any performance concerns: function requestnativescalewebgllayer(gl, xrsession) { return gl.makexrcompatible().then(() => { let scalefactor = xrwebgllayer.getnativeframebufferscalefactor(xrsession); let gllayer = new xrwebgllayer(xrsession, gl, { framebufferscalefactor: scalefactor }); xrsession.updaterenderstate({ baselayer: gllayer }); }); }; this starts by calling the webgl rendering context function makexrcompatible().
XSLT Basic Example - Web APIs
an xslt stylesheet starts with the xsl:stylesheet element, which contains all the templates used to create the final output.
msCapsLockWarningOff - Web APIs
starting with internet explorer 10, input type=password fields will automatically display a warning if the caps lock is on.
msWriteProfilerMark - Web APIs
syntax window.mswriteprofilermark("start-render"); parameters bstrprofilermarkname[in] an event name.
ARIA Test Cases - Accessibility
markup used: role = (one of the following): "application", "article", "banner", "complementary", "contentinfo", "directory", "document", "log", "main", "note", "navigation", "region", "search", "status" notes: screen readers may wish to provide some landmark-specific conveniences such as automatically starting at "main" when reading the page after page load, or providing a special key to get to the search bar, etc.
ARIA: alert role - Accessibility
screen readers will instantly start reading out the updated content when the role is added.
ARIA: article role - Accessibility
associated wai-aria roles, states, and properties aria-posinset in the context of a feed, indicates the position of this particular article within that feed, based on a count starting at 1.
ARIA: feed role - Accessibility
providing reading mode keys for moving the reading cursor and dom focus past the end and before the start of the feed.
ARIA: checkbox role - Accessibility
this attribute has one of three possible values: true 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.
Accessibility: What users can do to browse more safely - Accessibility
examples include: transitionrun transitionstart transitionend transitioncancel edge 75 and above (desktop, in windows 10) according to eric bailey, in his april 30, 2019 article revisiting prefers-reduced-motion, the reduced motion media query, "while microsoft edge does not have support for prefers-reduced-motion, it will become chrome under the hood soon." safari 10.1 and above (desktop) do not enable auto-play (does not work for gifs...
Accessibility Information for Web Authors - Accessibility
other organizations such as schools are starting to follow these guidelines as well.
Keyboard-navigable JavaScript widgets - Accessibility
in the dotted border case you will need to make sure those elements have an invisible 1px border to start with, so that the element doesn't grow when the border style is applied (borders take up space, and ie doesn't implement css outlines).
Accessibility
this article starts off the module with a good look at what accessibility actually is — this includes what groups of people we need to consider and why, what tools different people use to interact with the web, and how we can make accessibility part of our web development workflow.
-moz-image-rect - CSS: Cascading Style Sheets
function rotate() { var prevstyle = window.getcomputedstyle(document.getelementbyid("box4"), null).getpropertyvalue("background-image"); // now that we've saved the last one, start rotating for (var i=1; i<=4; i++) { var curid = "box" + i; // shift the background images var curstyle = window.getcomputedstyle(document.getelementbyid(curid), null).getpropertyvalue("background-image"); document.getelementbyid(curid).style.backgroundimage = prevstyle; prevstyle = curstyle; } } this uses window.getcomputedstyle() to fetch the style of each element, sh...
:-moz-first-node - CSS: Cascading Style Sheets
note: any whitespace at the start of an element is ignored for the determination of :-moz-first-node.
:-moz-loading - CSS: Cascading Style Sheets
the :-moz-loading css pseudo-class is a mozilla extension that matches elements that can't be displayed because they have not started loading, such as images that haven't started to arrive yet.
:-moz-ui-invalid - CSS: Cascading Style Sheets
the result is that if the control was valid when the user started interacting with it, the validity styling is changed only when the user shifts focus to another control.
:-moz-ui-valid - CSS: Cascading Style Sheets
the result is that if the control was valid when the user started interacting with it, the validity styling is changed only when the user shifts focus to another control.
::-moz-focus-inner - CSS: Cascading Style Sheets
examples html <input type="submit" value="input"/> <button type="submit">button</button> css button::-moz-focus-inner, input[type="color"]::-moz-focus-inner, input[type="reset"]::-moz-focus-inner, input[type="button"]::-moz-focus-inner, input[type="submit"]::-moz-focus-inner { padding-block-start: 0px; padding-inline-end: 2px; padding-block-end: 0px; padding-inline-start: 2px; border: 1px dotted red; } result specifications not part of any standard.
:active - CSS: Cascading Style Sheets
WebCSS:active
when using a mouse, "activation" typically starts when the user presses down the primary mouse button.
:indeterminate - CSS: Cascading Style Sheets
html <div> <input type="checkbox" id="checkbox"> <label for="checkbox">this label starts out lime.</label> </div> <div> <input type="radio" id="radio"> <label for="radio">this label starts out lime.</label> </div> css input:indeterminate + label { background: lime; } javascript var inputs = document.getelementsbytagname("input"); for (var i = 0; i < inputs.length; i++) { inputs[i].indeterminate = true; } progress bar html <progress> css progress { margin: 4p...
negative - CSS: Cascading Style Sheets
lor-stop-length>?<linear-color-hint> = <length-percentage><length-percentage> = <length> | <percentage><angular-color-stop> = <color> && <color-stop-angle>?<angular-color-hint> = <angle-percentage>where <color-stop-length> = <length-percentage>{1,2}<color-stop-angle> = <angle-percentage>{1,2}<angle-percentage> = <angle> | <percentage> examples rendering negative counters html <ul class="list" start="-3"> <li>one</li> <li>two</li> <li>three</li> <li>four</li> <li>five</li> </ul> css @counter-style neg { system: numeric; symbols: "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"; negative: "(-" ")"; } .list { list-style: neg; } result specifications specification status comment css counter styles level 3the definition of 'system' in that specificati...
pad - CSS: Cascading Style Sheets
a common usage of the pad descriptor is when you need your list to start numbering from 01 and go through 02, 03 and so on, instead of just 1, 2, 3...
system - CSS: Cascading Style Sheets
once the end of the list of symbols is reached, it will loop back to the beginning and start over.
@counter-style - CSS: Cascading Style Sheets
for example if you want the counters to start at 01 and go through 02, 03, 04 etc, then the pad descriptor is to be used.
Attribute selectors - CSS: Cascading Style Sheets
le" anywhere in the url */ a[href*="example"] { background-color: silver; } /* links with "insensitive" anywhere in the url, regardless of capitalization */ a[href*="insensitive" i] { color: cyan; } /* links with "case" anywhere in the url, with matching capitalization */ a[href*="case" s] { color: pink; } /* links that end in ".org" */ a[href$=".org"] { color: red; } /* links that start with "https" and end in ".org" */ a[href^="https"][href$=".org"] { color: green; } html <ul> <li><a href="#internal">internal link</a></li> <li><a href="http://example.com">example link</a></li> <li><a href="#insensitive">insensitive internal link</a></li> <li><a href="http://example.org">example org link</a></li> <li><a href="https://example.org">example https org link</a></li> </...
Detecting CSS animation support - CSS: Cascading Style Sheets
f( elem.style.animationname !== undefined ) { animation = true; } if( animation === false ) { for( var i = 0; i < domprefixes.length; i++ ) { if( elem.style[ domprefixes[i] + 'animationname' ] !== undefined ) { pfx = domprefixes[ i ]; animationstring = pfx + 'animation'; keyframeprefix = '-' + pfx.tolowercase() + '-'; animation = true; break; } } } for starters we define a few variables.
Using URL values for the cursor property - CSS: Cascading Style Sheets
note: starting with gecko 2.0, gecko also supports the svg image format for cursors.
Spanning and Balancing Columns - CSS: Cascading Style Sheets
when a spanner is introduced, it breaks the flow of columns and columns restart after the spanner, effectively creating a new set of column boxes.
Using multi-column layouts - CSS: Cascading Style Sheets
however, in some situations it is also useful to set the maximum height of the columns explicitly, and then lay out content starting at the first column and creating as many columns as necessary, possibly overflowing to the right.
CSS Flow Layout - CSS: Cascading Style Sheets
in english therefore, inline elements display one after the other, starting on the left, and block elements start at the top and move down the page.
Variable fonts guide - CSS: Cascading Style Sheets
this article will give you all you need to know to get you started using variable fonts.
CSS Fonts - CSS: Cascading Style Sheets
WebCSSCSS Fonts
this article will give you all you need to know to get you started using variable fonts.
CSS Grid Layout - CSS: Cascading Style Sheets
{ grid-column: 2 / 4; grid-row: 1 / 3; } .three { grid-column: 1; grid-row: 2 / 5; } .four { grid-column: 3; grid-row: 3; } .five { grid-column: 2; grid-row: 4; } .six { grid-column: 3; grid-row: 4; } reference css properties grid-template-columns grid-template-rows grid-template-areas grid-template grid-auto-columns grid-auto-rows grid-auto-flow grid grid-row-start grid-column-start grid-row-end grid-column-end grid-row grid-column grid-area row-gap column-gap gap css functions repeat() minmax() fit-content() css data types <flex> glossary entries grid grid lines grid tracks grid cell grid area gutters grid axis grid row grid column guides basic concepts of grid layout relationship of grid layout to other layo...
Stacking context example 1 - CSS: Cascading Style Sheets
« css « understanding css z-index stacking context example 1 let's start with a basic example.
CSS Scroll Snap - CSS: Cascading Style Sheets
reference css properties on containers scroll-snap-type scroll-snap-stop scroll-padding scroll-padding-top scroll-padding-right scroll-padding-bottom scroll-padding-left scroll-padding-inline scroll-padding-inline-start scroll-padding-inline-end scroll-padding-block scroll-padding-block-start scroll-padding-block-end css properties on children scroll-snap-align scroll-margin scroll-margin-top scroll-margin-right scroll-margin-bottom scroll-margin-left scroll-margin-inline scroll-margin-inline-start scroll-margin-inline-end scroll-margin-block scroll-margin-block-start scroll-margin-block-end ...
Basic Shapes - CSS: Cascading Style Sheets
in the example below change the reference box from margin-box to border-box, padding-box or content-box to see how the reference box used as the starting point before offsets are calculated changes.
Overview of CSS Shapes - CSS: Cascading Style Sheets
we can start by looking at a very simple case.
CSS Shapes - CSS: Cascading Style Sheets
-image-threshold shape-margin shape-outside data types <basic-shape> guides overview of css shapes shapes from box values basic shapes shapes from images edit shape paths in css — firefox developer tools external resources a list of css shapes resources css shapes 101 creating non-rectangular layouts with css shapes how to use css shapes in your web design how to get started with css shapes what i learned in one weekend with css shapes css vs.
Using CSS transforms - CSS: Cascading Style Sheets
you have to start by configuring the 3d space by giving it a perspective, then you have to configure how your 2d elements will behave in that space.
Breadcrumb Navigation - CSS: Cascading Style Sheets
breadcrumb navigation helps the user to understand their location in the website by providing a breadcrumb trail back to the start page.
List group with badges - CSS: Cascading Style Sheets
if instead, you want the badge to align to the top of the content, change this to align-items: flex-start.
Sticky footers - CSS: Cascading Style Sheets
the flexbox example starts out in the same way, but we use display:flex rather than display:grid on the .wrapper; we also set flex-direction to column.
CSS Layout cookbook - CSS: Cascading Style Sheets
in addition to providing code you can use as a starting point in your projects, these recipes highlight the different ways layout specifications can be used, and the choices you can make as a developer.
Testing media queries programmatically - CSS: Cascading Style Sheets
this makes our listener perform adjustments based on the current device orientation; otherwise, our code might assume the device is in portrait mode at startup, even if it's actually in landscape mode.
Syntax - CSS: Cascading Style Sheets
WebCSSSyntax
at-rules that start with an at sign, '@' (u+0040 commercial at), followed by an identifier and then continuing up to the end of the statement, that is up to the next semi-colon (;) outside of a block, or the end of the next block.
Cubic Bezier Generator - CSS: Cascading Style Sheets
tput'); output.value = "p1!"; dragsm = 1; } var x2 = cx(document.getelementbyid('x2').value); var y2 = cy(document.getelementbyid('y2').value); if ((x2 + radius >= x) && (x2 - radius <= x) && (y2 + radius >= y) && (y2 - radius <= y)) { var output = document.getelementbyid('output'); output.value = "p2!"; dragsm = 2; } // if we are starting a drag if (dragsm != 0) { canvas.onmousemove = mousemove; } } function mouseup(e) { var output = document.getelementbyid('output'); output.value = "mouse up!"; dragsm = 0; canvas.onmousemove = null; } function mousemove(e) { if (dragsm != 0) { var canvas = document.getelementbyid('bezier'); var x = e.pagex - canvas.offsetleft; var...
CSS Tutorials - CSS: Cascading Style Sheets
WebCSSTutorials
beginner-level css tutorials getting started this guide is aimed at complete beginners: you haven't written one single line of css?
Using CSS custom properties (variables) - CSS: Cascading Style Sheets
as mentioned earlier, you use the custom property value by specifying your custom property name inside the var() function, in place of a regular property value: element { background-color: var(--main-bg-color); } first steps with custom properties let's start with this simple css that applies the same color to elements of different classes: .one { color: white; background-color: brown; margin: 10px; width: 50px; height: 50px; display: inline-block; } .two { color: white; background-color: black; margin: 10px; width: 150px; height: 70px; display: inline-block; } .three { color: white; background-color: brown; margin: 10...
animation-play-state - CSS: Cascading Style Sheets
resuming a paused animation will start the animation from where it left off at the time it was paused, rather than starting over from the beginning of the animation sequence.
background-attachment - CSS: Cascading Style Sheets
</p> css p { background-image: url("https://mdn.mozillademos.org/files/12057/starsolid.gif"), url("https://mdn.mozillademos.org/files/12059/startransparent.gif"); background-attachment: fixed, scroll; background-repeat: no-repeat, repeat-y; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'background-attachment' in that specification.
background-image - CSS: Cascading Style Sheets
</p> <p>and no more.</p> </div> css p { font-size: 1.5em; color: #fe7f88; background-image: none; background-color: transparent; } div { background-image: url("https://mdn.mozillademos.org/files/6457/mdn_logo_only_color.png"); } .catsandstars { background-image: url("https://mdn.mozillademos.org/files/11991/startransparent.gif"), url("https://mdn.mozillademos.org/files/7693/catfront.png"); background-color: transparent; } result specifications specification status comment css backgrounds and borders module level 3the definition of 'background-image' in that specification.
background-origin - CSS: Cascading Style Sheets
the background-origin css property sets the background's origin: from the border start, inside the border, or inside the padding.
background-position-x - CSS: Cascading Style Sheets
formal definition initial valueleftapplies toall elementsinheritednopercentagesrefer to width of background positioning area minus height of background imagecomputed valuea list, each item consisting of: an offset given as a combination of an absolute length and a percentage, plus an origin keywordanimation typediscrete formal syntax [ center | [ [ left | right | x-start | x-end ]?
background-position-y - CSS: Cascading Style Sheets
formal definition initial valuetopapplies toall elementsinheritednopercentagesrefer to height of background positioning area minus height of background imagecomputed valuea list, each item consisting of: an offset given as a combination of an absolute length and a percentage, plus an origin keywordanimation typediscrete formal syntax [ center | [ [ top | bottom | y-start | y-end ]?
border-block-color - CSS: Cascading Style Sheets
border-block-color: yellow; border-block-color: #f5f6f7; the border color in the other dimension can be set with border-inline-color which sets border-inline-start-color, and border-inline-end-color.
border-block-end-color - CSS: Cascading Style Sheets
syntax border-block-end-color: yellow; border-block-end-color: #f5f6f7; related properties are border-block-start-color, border-inline-start-color, and border-inline-end-color, which define the other border colors of the element.
border-block-end-style - CSS: Cascading Style Sheets
syntax /* <'border-style'> values */ border-block-end-style: dashed; border-block-end-style: dotted; border-block-end-style: groove; related properties are border-block-start-style, border-inline-start-style, and border-inline-end-style, which define the other border styles of the element.
border-block-end-width - CSS: Cascading Style Sheets
syntax /* <'border-width'> values */ border-block-end-width: 5px; border-block-end-width: thick; related properties are border-block-start-width, border-inline-start-width, and border-inline-end-width, which define the other border widths of the element.
border-block-end - CSS: Cascading Style Sheets
related properties are border-block-start, border-inline-start, and border-inline-end, which define the other borders of the element.
border-block-style - CSS: Cascading Style Sheets
/* <'border-style'> values */ border-block-style: dashed; border-block-style: dotted; border-block-style: groove; the border style in the other dimension can be set with border-inline-style, which sets border-inline-start-style, and border-inline-end-style.
border-block-width - CSS: Cascading Style Sheets
/* <'border-width'> values */ border-block-width: 5px; border-block-width: thick; the border width in the other dimension can be set with border-inline-width, which sets border-inline-start-width, and border-inline-end-width.
border-color - CSS: Cascading Style Sheets
each side can be set individually using border-top-color, border-right-color, border-bottom-color, and border-left-color; or using the writing mode-aware border-block-start-color, border-block-end-color, border-inline-start-color, and border-inline-end-color.
border-image-slice - CSS: Cascading Style Sheets
the sampled image size is scaled to fit inside the border, which means that if the width is bigger than the slice, the image can start to look somewhat pixellated (unless of course you use an svg image).
border-inline-color - CSS: Cascading Style Sheets
border-inline-color: yellow; border-inline-color: #f5f6f7; the border color in the other dimension can be set with border-block-color which sets border-block-start-color, and border-block-end-color.
border-inline-end-color - CSS: Cascading Style Sheets
syntax border-inline-end-color: rebeccapurple; border-inline-end-color: #663399; related properties are border-block-start-color, border-block-end-color, and border-inline-start-color, which define the other border colors of the element.
border-inline-end-style - CSS: Cascading Style Sheets
syntax /* <'border-style'> values */ border-inline-end-style: dashed; border-inline-end-style: dotted; border-inline-end-style: groove; related properties are border-block-start-style, border-block-end-style, and border-inline-start-style, which define the other border styles of the element.
border-inline-end-width - CSS: Cascading Style Sheets
syntax /* <'border-width'> values */ border-inline-end-width: 2px; border-inline-end-width: thick; related properties are border-block-start-width, border-block-end-width, and border-inline-start-width, which define the other border widths of the element.
border-inline-end - CSS: Cascading Style Sheets
related properties are border-block-start, border-block-end, and border-inline-start, which define the other borders of the element.
border-inline-style - CSS: Cascading Style Sheets
/* <'border-style'> values */ border-inline-style: dashed; border-inline-style: dotted; border-inline-style: groove; the border style in the other dimension can be set with border-block-style, which sets border-block-start-style, and border-block-end-style.
border-inline-width - CSS: Cascading Style Sheets
/* <'border-width'> values */ border-inline-width: 5px 10px; border-inline-width: 5px; border-inline-width: thick; the border width in the other dimension can be set with border-block-width, which sets border-block-start-width, and border-block-end-width.
border-inline - CSS: Cascading Style Sheets
the borders in the other dimension can be set with border-block, which sets border-block-start, and border-block-end.
border - CSS: Cascading Style Sheets
WebCSSborder
alternatively, you can target one border at a time with the physical (e.g., border-top ) and logical (e.g., border-block-start) border properties.
box-ordinal-group - CSS: Cascading Style Sheets
when the computed box-direction is normal, a box will display its elements starting from the lowest numbered ordinal group and ensure that those elements appear to the left (for horizontal boxes) or at the top (for vertical boxes) of the container.
caption-side - CSS: Cascading Style Sheets
formal definition initial valuetopapplies totable-caption elementsinheritedyescomputed valueas specifiedanimation typediscrete formal syntax top | bottom | block-start | block-end | inline-start | inline-end examples setting captions above and below html <table class="top"> <caption>caption above the table</caption> <tr> <td>some data</td> <td>some more data</td> </tr> </table> <br> <table class="bottom"> <caption>caption below the table</caption> <tr> <td>some data</td> <td>some more data</td> </tr> </table> css .top captio...
counter-set - CSS: Cascading Style Sheets
if there isn't currently a counter of the given name on the element, the element will create a new counter of the given name with a starting value of 0 (though it may then immediately set or increment that value to something different).
counter() - CSS: Cascading Style Sheets
WebCSScounter
the name cannot start with two dashes and can't be none, unset, initial, or inherit.
counters() - CSS: Cascading Style Sheets
WebCSScounters
the name cannot start with two dashes and can't be none, unset, initial, or inherit.
cursor - CSS: Cascading Style Sheets
WebCSScursor
for example, the se-resize cursor is used when the movement starts from the south-east corner of the box.
flex-flow - CSS: Cascading Style Sheets
WebCSSflex-flow
of the properties of the shorthand:flex-direction: rowflex-wrap: nowrapapplies toflex containersinheritednocomputed valueas each of the properties of the shorthand:flex-direction: as specifiedflex-wrap: as specifiedanimation typediscrete formal syntax <'flex-direction'> | <'flex-wrap'> examples setting column-reverse and wrap element { /* main-axis is the block direction with reversed main-start and main-end.
font-family - CSS: Cascading Style Sheets
this means that punctuation characters and digits at the start of each token must be escaped in unquoted font family names.
grid-auto-flow - CSS: Cascading Style Sheets
> <option value="row">row</option> </select> <input id="dense" type="checkbox" onchange="changegridautoflow()"> <label for="dense">dense</label> css #grid { height: 200px; width: 200px; display: grid; grid-gap: 10px; grid-template: repeat(4, 1fr) / repeat(2, 1fr); grid-auto-flow: column; /* or 'row', 'row dense', 'column dense' */ } #item1 { background-color: lime; grid-row-start: 3; } #item2 { background-color: yellow; } #item3 { background-color: blue; } #item4 { grid-column-start: 2; background-color: red; } #item5 { background-color: aqua; } function changegridautoflow() { var grid = document.getelementbyid("grid"); var direction = document.getelementbyid("direction"); var dense = document.getelementbyid("dense"); var gridautoflow = direction.va...
grid-template-areas - CSS: Cascading Style Sheets
those areas are not associated with any particular grid item, but can be referenced from the grid-placement properties grid-row-start, grid-row-end, grid-column-start, grid-column-end, and their shorthands grid-row, grid-column, and grid-area.
<image> - CSS: Cascading Style Sheets
WebCSSimage
t.jpg) /* a <url>, as long as test.jpg is an actual image */ linear-gradient(blue, red) /* a <gradient> */ element(#realid) /* a part of the webpage, referenced with the element() function, if "realid" is an existing id on the page */ image(ltr 'arrow.png#xywh=0,0,16,16', red) /* a section 16x16 section of <url>, starting from the top, left of the original image as long as arrow.png is a supported image, otherwise a solid red swatch.
inset-inline-end - CSS: Cascading Style Sheets
/* <length> values */ inset-inline-end: 3px; inset-inline-end: 2.4em; /* <percentage>s of the width or height of the containing block */ inset-inline-end: 10%; /* keyword value */ inset-inline-end: auto; /* global values */ inset-inline-end: inherit; inset-inline-end: initial; inset-inline-end: unset; the shorthand for inset-inline-start and inset-inline-end is inset-inline.
<length> - CSS: Cascading Style Sheets
WebCSSlength
background-color: #999; box-shadow: inset 3px 3px 5px rgba(255,255,255,0.5), inset -3px -3px 5px rgba(0,0,0,0.5); background-color: orange; display: flex; align-items: center; margin-top: 10px; } .result code { position: absolute; margin-left: 20px; } .results { margin-top: 10px; } .input-container { position: absolute; display: flex; justify-content: flex-start; align-items: center; height: 50px; } label { margin: 0 10px 0 20px; } javascript const inputdiv = document.queryselector('.inner'); const inputelem = document.queryselector('input'); const resultsdiv = document.queryselector('.results'); inputelem.addeventlistener('change', () => { inputdiv.style.width = inputelem.value; const result = document.createelement('div'); result.class...
margin-block-end - CSS: Cascading Style Sheets
it relates to margin-block-start, margin-inline-start, and margin-inline-end, which define the other margins of the element.
margin-inline-end - CSS: Cascading Style Sheets
yntax /* <length> values */ margin-inline-end: 10px; /* an absolute length */ margin-inline-end: 1em; /* relative to the text size */ margin-inline-end: 5%; /* relative to the nearest block container's width */ /* keyword values */ margin-inline-end: auto; /* global values */ margin-inline-end: inherit; margin-inline-end: initial; margin-inline-end: unset; it relates to margin-block-start, margin-block-end, and margin-inline-start, which define the other margins of the element.
mask-border-outset - CSS: Cascading Style Sheets
when it eventually starts to be supported, it will serve to move the mask away from the inner edge of the element's border box — you can use it to make the mask start from part way across the border, rather than the inside of it.
mask-border-repeat - CSS: Cascading Style Sheets
when it eventually starts to be supported, it will serve to define how the border mask slice will repeat around the border — i.e.
mask-border-slice - CSS: Cascading Style Sheets
when it eventually starts to be supported, it will serve to define the size of the slices taken from the source image, and used to create the border mask.
mask-border-source - CSS: Cascading Style Sheets
when it eventually starts to be supported, it will serve to define the source of the border mask.
mask-border-width - CSS: Cascading Style Sheets
when it eventually starts to be supported, it will serve to define the width of the border mask — setting this to a different value to mask-border-slice will cause the slices to be scaled to fit the border mask.
object-fit - CSS: Cascading Style Sheets
ass="scale-down" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> <img class="scale-down narrow" src="https://udn.realityripple.com/samples/ae/248a9938d9.png" alt="mdn logo"> </section> css h2 { font-family: courier new, monospace; font-size: 1em; margin: 1em 0 0.3em; } div { display: flex; flex-direction: column; flex-wrap: wrap; align-items: flex-start; height: 940px; } img { width: 150px; height: 100px; border: 1px solid #000; } .narrow { width: 100px; height: 150px; margin-top: 10px; } .fill { object-fit: fill; } .contain { object-fit: contain; } .cover { object-fit: cover; } .none { object-fit: none; } .scale-down { object-fit: scale-down; } result specifications specification status commen...
padding-block-end - CSS: Cascading Style Sheets
it relates to padding-block-start, padding-inline-start, and padding-inline-end, which define the other paddings of the element.
padding-inline-end - CSS: Cascading Style Sheets
it relates to padding-block-start, padding-block-end, and padding-inline-start, which define the other paddings of the element.
paint-order - CSS: Cascading Style Sheets
marker-start) and <marker> element.
radial-gradient() - CSS: Cascading Style Sheets
syntax /* a gradient at the center of its container, starting red, changing to blue, and finishing green */ radial-gradient(circle at center, red 0, blue, green 100%) values <position> the position of the gradient, interpreted in the same way as background-position or transform-origin.
scroll-margin-block - CSS: Cascading Style Sheets
constituent properties this property is a shorthand for the following css properties: scroll-margin-block-end scroll-margin-block-start syntax /* <length> values */ scroll-margin-block: 10px; scroll-margin-block: 1em .5em ; /* global values */ scroll-margin-block: inherit; scroll-margin-block: initial; scroll-margin-block: unset; values <length> an outset from the corresponding edge of the scroll container.
scroll-padding-block - CSS: Cascading Style Sheets
constituent properties this property is a shorthand for the following css properties: scroll-padding-block-end scroll-padding-block-start syntax /* keyword values */ scroll-padding-block: auto; /* <length> values */ scroll-padding-block: 10px; scroll-padding-block: 1em .5em; scroll-padding-block: 10%; /* global values */ scroll-padding-block: inherit; scroll-padding-block: initial; scroll-padding-block: unset; values <length-percentage> an inwards offset from the corresponding edge of the scrollport, as a valid length or...
scroll-padding-inline - CSS: Cascading Style Sheets
constituent properties this property is a shorthand for the following css properties: scroll-padding-inline-end scroll-padding-inline-start syntax /* keyword values */ scroll-padding-inline: auto; /* <length> values */ scroll-padding-inline: 10px; scroll-padding-inline: 1em .5em; scroll-padding-inline: 10%; /* global values */ scroll-padding-inline: inherit; scroll-padding-inline: initial; scroll-padding-inline: unset; values <length-percentage> an inwards offset from the corresponding edge of the scrollport, as a valid le...
scroll-snap-coordinate - CSS: Cascading Style Sheets
<position> specifies the offset of the snap coordinates from the start edge of the element’s border box.
scroll-snap-destination - CSS: Cascading Style Sheets
/* <position> value */ scroll-snap-destination: 400px 600px; /* global values */ scroll-snap-destination: inherit; scroll-snap-destination: initial; scroll-snap-destination: unset; syntax values <position> specifies the offset of the snap destination from the start edge of the scroll container’s visual viewport.
scroll-snap-points-x - CSS: Cascading Style Sheets
repeat(<length-percentage>) defines an interval at which snap points are defined, starting from the container's relevant start edge.
scroll-snap-points-y - CSS: Cascading Style Sheets
repeat(<length-percentage>) defines an interval at which snap points are defined, starting from the container's relevant start edge.
symbols() - CSS: Cascading Style Sheets
WebCSSsymbols
[ <string> | <image> ]+ ); <symbols-type> can be one of the following: cyclic: the system cycles through the given values in the order of their definition, and returns to the start when it reaches the end.
text-decoration-skip - CSS: Cascading Style Sheets
edges the start and end of the text decoration is inset slightly (e.g., by half of the line thickness) from the content edge of the decorating box.
transition - CSS: Cascading Style Sheets
ef="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>, <number <a href="/docs/css/value_definition_syntax#brackets" title="brackets: enclose several entities, combinators, and multipliers to transform them as a single component">[0,1]>, <number>)<step-timing-function> = step-start | step-end | steps(<integer>[, <step-position>]?)where <step-position> = jump-start | jump-end | jump-none | jump-both | start | end examples there are several more examples of css transitions included in the using css transitions article.
user-select - CSS: Cascading Style Sheets
contain enables selection to start within the element; however, the selection will be contained by the bounds of that element.
var() - CSS: Cascading Style Sheets
WebCSSvar
values <custom-property-name> a custom property’s name represented by an identifier that starts with two dashes.
Adding captions and subtitles to HTML5 video - Developer guides
html5 and video captions before diving into how to add captions to the video player, there are a number of things that we will first mention, which you should be aware of before we start.
Video player styling basics - Developer guides
preliminary modifications from the original example this section summarises the modifications that were made to the original video player example to make the styling task easier, before the bulk of the work was started.
Web Audio playbackRate explained - Developer guides
playbackrate basics let's starting by looking at a brief example of playbackrate usage: var myaudio = document.createelement('audio'); myaudio.setattribute('src','audiofile.mp3'); myaudio.playbackrate = 0.5; here we create an <audio> element, and set its src to a file of our choice.
Creating a cross-browser video player - Developer guides
html markup to start off with, let's take a look at the html that makes up the player.
Audio and video manipulation - Developer guides
example var panner = context.createpanner(); panner.coneoutergain = 0.2; panner.coneouterangle = 120; panner.coneinnerangle = 0; panner.connect(context.destination); source.connect(panner); source.start(0); // position the listener at the origin.
Creating and triggering events - Developer guides
wesome = new customevent('awesome', { bubbles: true, detail: { text: () => textarea.value } }); // the form element listens for the custom "awesome" event and then consoles the output of the passed text() method form.addeventlistener('awesome', e => console.log(e.detail.text())); // as the user types, the textarea inside the form dispatches/triggers the event to fire, and uses itself as the starting point textarea.addeventlistener('input', e => e.target.dispatchevent(eventawesome)); creating and dispatching events dynamically elements can listen for events that haven't been created yet: <form> <textarea></textarea> </form> const form = document.queryselector('form'); const textarea = document.queryselector('textarea'); form.addeventlistener('awesome', e => console.log(e.detail.te...
Overview of events and handlers - Developer guides
the pattern starts with an agreement over a kind of event and: the name string used for the event, the type of the data structure used to represent the key properties of that event, and the javascript object which will 'emit' that event.
Graphics on the Web - Developer guides
3d graphics webgl a guide to getting started with webgl, the 3d graphics api for the web.
Rich-Text Editing in Mozilla - Developer guides
starting in firefox 3, mozilla also supports internet explorer's contenteditable attribute which allows any element to become editable or non-editable (the latter for when preventing change to fixed elements in an editable environment).
HTML5 Parser - Developer guides
WebGuideHTMLHTML5HTML5 Parser
attributes starting with xmlns have absolutely no effect on what namespace elements or attributes end up in, so you don’t need to use attributes starting with xmlns.
Introduction to HTML5 - Developer guides
now, it is very simple: <meta charset="utf-8"> place this right after your <head>, as some browsers restart the parsing of an html document if the declared character set is different from what they had anticipated.
Separate sites for mobile and desktop - Developer guides
for starters, you are now maintaining two different pages for every page on your site that you would like to expose to mobile users.
Writing forward-compatible websites - Developer guides
it might start doing something you don't expect in the future ...
Developer guides
this article is intended as a starting point for exploring the various delivery mechanisms of web-based media and compatibility with popular browsers.
HTML attribute: accept - HTML: Hypertext Markup Language
each unique file type specifier may take one of the following forms: a valid case-insensitive filename extension, starting with a period (".") character.
HTML attribute: pattern - HTML: Hypertext Markup Language
the pattern's regular expression, when matched against the value, must have its start anchored to the start of the string and its end anchored to the end of the string, which is slightly different from javascript regular expressions: in the case of pattern attribute, we are matching against the entire value, not just any subset, as if a ^(?: were implied at the start of the pattern and )$ at the end.
HTML attribute: readonly - HTML: Hypertext Markup Language
the attribute is not supported or relevant to <select> or input types that are already not mutable, such as checkbox and radio or cannot, by definition, start with a value, such as the file input type.
Allowing cross-origin use of images and canvas - HTML: Hypertext Markup Language
starting the download the code that starts the download (say, when the user clicks a "download" button), looks like this: function startdownload() { let imageurl = "https://cdn.glitch.com/4c9ebeb9-8b9a-4adc-ad0a-238d9ae00bb5%2fmdn_logo-only_color.svg?1535749917189"; downloadedimg = new image; downloadedimg.crossorigin = "anonymous"; downloadedimg.addeventlistener("load", imagereceived, false...
DASH Adaptive Streaming for HTML 5 Video - HTML: Hypertext Markup Language
to start with you'll only need the ffpmeg program from ffmpeg.org, with libvpx and libvorbis support for webm video and audio, at least version 2.5 (probably; this was tested ith 3.2.5).
<abbr>: The Abbreviation element - HTML: Hypertext Markup Language
WebHTMLElementabbr
content categories flow content, phrasing content, palpable content permitted content phrasing content tag omission none, both the starting and ending tag are mandatory.
<address>: The Contact Address element - HTML: Hypertext Markup Language
WebHTMLElementaddress
tag omission none, both the starting and ending tag are mandatory.
<applet>: The Embed Java Applet element - HTML: Hypertext Markup Language
WebHTMLElementapplet
tag omission none, both the starting and ending tag are mandatory.
<area> - HTML: Hypertext Markup Language
WebHTMLElementarea
tag omission must have a start tag and must not have an end tag.
<article>: The Article Contents element - HTML: Hypertext Markup Language
WebHTMLElementarticle
tag omission none, both the starting and ending tag are mandatory.
<aside>: The Aside element - HTML: Hypertext Markup Language
WebHTMLElementaside
tag omission none, both the starting and ending tag are mandatory.
<b>: The Bring Attention To element - HTML: Hypertext Markup Language
WebHTMLElementb
tag omission none, both the starting and ending tag are mandatory.
<basefont> - HTML: Hypertext Markup Language
WebHTMLElementbasefont
starting with html 4, html does not convey styling information anymore (outside the <style> element or the style attribute of each element).
<bdi>: The Bidirectional Isolate element - HTML: Hypertext Markup Language
WebHTMLElementbdi
tag omission none, both the starting and ending tag are mandatory.
<blockquote>: The Block Quotation element - HTML: Hypertext Markup Language
tag omission none, both the starting and ending tag are mandatory.
<button>: The Button element - HTML: Hypertext Markup Language
WebHTMLElementbutton
permitted content phrasing content but there must be no interactive content tag omission none, both the starting and ending tag are mandatory.
<cite>: The Citation element - HTML: Hypertext Markup Language
WebHTMLElementcite
tag omission none, both the starting and ending tag are mandatory.
<code>: The Inline Code element - HTML: Hypertext Markup Language
WebHTMLElementcode
tag omission none, both the starting and ending tag are mandatory.
<colgroup> - HTML: Hypertext Markup Language
WebHTMLElementcolgroup
if the attribute is not present: zero or more <col> element tag omission the start tag may be omitted, if it has a <col> element as its first child and if it is not preceded by a <colgroup> whose end tag has been omitted.
<content>: The Shadow DOM Content Placeholder element (obsolete) - HTML: Hypertext Markup Language
WebHTMLElementcontent
tag omission none, both the starting and ending tag are mandatory.
<data> - HTML: Hypertext Markup Language
WebHTMLElementdata
tag omission none, both the starting and ending tag are mandatory.
<datalist>: The HTML Data List element - HTML: Hypertext Markup Language
WebHTMLElementdatalist
tag omission none, both the starting and ending tag are mandatory.
<dd>: The Description Details element - HTML: Hypertext Markup Language
WebHTMLElementdd
tag omission the start tag is required.
<dfn>: The Definition element - HTML: Hypertext Markup Language
WebHTMLElementdfn
tag omission none, both the starting and ending tag are mandatory.
<dialog>: The Dialog element - HTML: Hypertext Markup Language
WebHTMLElementdialog
content categories flow content, sectioning root permitted content flow content tag omission none, both the starting and ending tag are mandatory.
<div>: The Content Division element - HTML: Hypertext Markup Language
WebHTMLElementdiv
tag omission none, both the starting and ending tag are mandatory.
<dl>: The Description List element - HTML: Hypertext Markup Language
WebHTMLElementdl
tag omission none, both the starting and ending tag are mandatory.
<dt>: The Description Term element - HTML: Hypertext Markup Language
WebHTMLElementdt
tag omission must have a start tag.
<element>: The Custom Element element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementelement
tag omission none, both the starting and ending tag are mandatory.
<em>: The Emphasis element - HTML: Hypertext Markup Language
WebHTMLElementem
tag omission none, both the starting and ending tag are mandatory.
<embed>: The Embed External Content element - HTML: Hypertext Markup Language
WebHTMLElementembed
tag omission must have a start tag, and must not have an end tag.
<figcaption>: The Figure Caption element - HTML: Hypertext Markup Language
tag omission none, both the starting and ending tag are mandatory.
<figure>: The Figure with Optional Caption element - HTML: Hypertext Markup Language
WebHTMLElementfigure
tag omission none, both the starting and ending tag are mandatory.
<font> - HTML: Hypertext Markup Language
WebHTMLElementfont
starting with html 4, html does not convey styling information anymore (outside the <style> element or the style attribute of each element).
<footer> - HTML: Hypertext Markup Language
WebHTMLElementfooter
tag omission none, both the starting and ending tag are mandatory.
<form> - HTML: Hypertext Markup Language
WebHTMLElementform
content categories flow content, palpable content permitted content flow content, but not containing <form> elements tag omission none, both the starting and ending tag are mandatory.
<head>: The Document Metadata (Header) element - HTML: Hypertext Markup Language
WebHTMLElementhead
tag omission the start tag may be omitted if the first thing inside the <head> element is an element.
<header> - HTML: Hypertext Markup Language
WebHTMLElementheader
tag omission none, both the starting and ending tag are mandatory.
<hgroup> - HTML: Hypertext Markup Language
WebHTMLElementhgroup
tag omission none, both the starting and ending tag are mandatory.
<hr>: The Thematic Break (Horizontal Rule) element - HTML: Hypertext Markup Language
WebHTMLElementhr
tag omission it must have start tag, but must not have an end tag.
<html>: The HTML Document / Root element - HTML: Hypertext Markup Language
WebHTMLElementhtml
tag omission the start tag may be omitted if the first thing inside the <html> element is not a comment.
<i>: The Idiomatic Text element - HTML: Hypertext Markup Language
WebHTMLElementi
tag omission none, both the starting and ending tag are mandatory.
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
WebHTMLElementiframe
tag omission none, both the starting and ending tag are mandatory.
<input type="checkbox"> - HTML: Hypertext Markup Language
WebHTMLElementinputcheckbox
so in this case the indeterminate state is used to state that collecting the ingredients has started, but the recipe is not yet complete.
<input type="file"> - HTML: Hypertext Markup Language
WebHTMLElementinputfile
each unique file type specifier may take one of the following forms: a valid case-insensitive filename extension, starting with a period (".") character.
<input type="hidden"> - HTML: Hypertext Markup Language
WebHTMLElementinputhidden
they get started by pressing the edit button.
<input type="image"> - HTML: Hypertext Markup Language
WebHTMLElementinputimage
permitted values are: get a url is constructed by starting with the url given by the formaction or action attribute, appending a question mark ("?") character, then appending the form's data, encoded as described by formenctype or the form's enctype attribute.
<input type="radio"> - HTML: Hypertext Markup Language
WebHTMLElementinputradio
the css involved is a bit more significant: html { font-family: sans-serif; } div:first-of-type { display: flex; align-items: flex-start; margin-bottom: 5px; } label { margin-right: 15px; line-height: 32px; } input { -webkit-appearance: none; -moz-appearance: none; appearance: none; border-radius: 50%; width: 16px; height: 16px; border: 2px solid #999; transition: 0.2s all linear; margin-right: 5px; position: relative; top: 4px; } input:checked { border: 6px solid black; } button, legend { co...
<input type="submit"> - HTML: Hypertext Markup Language
WebHTMLElementinputsubmit
permitted values are: get a url is constructed by starting with the url given by the formaction or action attribute, appending a question mark ("?") character, then appending the form's data, encoded as described by formenctype or the form's enctype attribute.
<input type="tel"> - HTML: Hypertext Markup Language
WebHTMLElementinputtel
value a domstring representing a telephone number, or empty events change and input supported common attributes autocomplete, list, maxlength, minlength, pattern, placeholder, readonly, and size idl attributes list, selectionstart, selectionend, selectiondirection, and value methods select(), setrangetext(), setselectionrange() value the <input> element's value attribute contains a domstring that either represents a telephone number or is an empty string ("").
<isindex> - HTML: Hypertext Markup Language
WebHTMLElementisindex
on november 1992, indexes as links rather than documents started by dan connolly who is pushing the idea that indexes are more links than documents.
<kbd>: The Keyboard Input element - HTML: Hypertext Markup Language
WebHTMLElementkbd
tag omission none, both the starting and ending tag are mandatory.
<keygen> - HTML: Hypertext Markup Language
WebHTMLElementkeygen
tag omission must have a start tag and must not have an end tag.
<label> - HTML: Hypertext Markup Language
WebHTMLElementlabel
tag omission none, both the starting and ending tag are mandatory.
<legend> - HTML: Hypertext Markup Language
WebHTMLElementlegend
tag omission none, both the starting and ending tag are mandatory.
<listing> - HTML: Hypertext Markup Language
WebHTMLElementlisting
summary the html listing element (<listing>) renders text between the start and end tags without interpreting the html in between and using a monospaced font.
<main> - HTML: Hypertext Markup Language
WebHTMLElementmain
tag omission none; both the starting and ending tags are mandatory.
<map> - HTML: Hypertext Markup Language
WebHTMLElementmap
tag omission none, both the starting and ending tag are mandatory.
<menu> - HTML: Hypertext Markup Language
WebHTMLElementmenu
tag omission none, both the starting and ending tag are mandatory.
<menuitem> - HTML: Hypertext Markup Language
WebHTMLElementmenuitem
tag omission must have a start tag and must not have an end tag.
<meta>: The Document-level Metadata element - HTML: Hypertext Markup Language
WebHTMLElementmeta
tag omission as it is a void element, the start tag must be present and the end tag must not be present.
<meter>: The HTML Meter element - HTML: Hypertext Markup Language
WebHTMLElementmeter
tag omission none, both the starting and ending tag are mandatory.
<nav>: The Navigation Section element - HTML: Hypertext Markup Language
WebHTMLElementnav
tag omission none, both the starting and ending tag are mandatory.
<noscript> - HTML: Hypertext Markup Language
WebHTMLElementnoscript
tag omission none, both the starting and ending tag are mandatory.
<object> - HTML: Hypertext Markup Language
WebHTMLElementobject
tag omission none, both the starting and ending tag are mandatory.
<optgroup> - HTML: Hypertext Markup Language
WebHTMLElementoptgroup
tag omission the start tag is mandatory.
<option>: The HTML Option element - HTML: Hypertext Markup Language
WebHTMLElementoption
tag omission the start tag is mandatory.
<output>: The Output element - HTML: Hypertext Markup Language
WebHTMLElementoutput
tag omission none, both the starting and ending tag are mandatory.
<p>: The Paragraph element - HTML: Hypertext Markup Language
WebHTMLElementp
tag omission the start tag is required.
<param>: The Object Parameter element - HTML: Hypertext Markup Language
WebHTMLElementparam
tag omission as it is a void element, the start tag must be present and the end tag must not be present.
<picture>: The Picture element - HTML: Hypertext Markup Language
WebHTMLElementpicture
tag omission none, both the starting and ending tag are mandatory.
<plaintext>: The Plain Text element (Deprecated) - HTML: Hypertext Markup Language
the html plaintext element (<plaintext>) renders everything following the start tag as raw text, ignoring any following html.
<pre>: The Preformatted Text element - HTML: Hypertext Markup Language
WebHTMLElementpre
tag omission none, both the starting and ending tag are mandatory.
<progress>: The Progress Indicator element - HTML: Hypertext Markup Language
WebHTMLElementprogress
tag omission none, both the starting and ending tag are mandatory.
<q>: The Inline Quotation element - HTML: Hypertext Markup Language
WebHTMLElementq
tag omission none, both the starting and ending tag are mandatory.
<ruby> - HTML: Hypertext Markup Language
WebHTMLElementruby
tag omission none, both the starting and ending tag are mandatory.
<samp>: The Sample Output element - HTML: Hypertext Markup Language
WebHTMLElementsamp
tag omission none, both the starting and ending tag are mandatory.
<script>: The Script element - HTML: Hypertext Markup Language
WebHTMLElementscript
tag omission none, both the starting and ending tag are mandatory.
<section>: The Generic Section element - HTML: Hypertext Markup Language
WebHTMLElementsection
tag omission none, both the starting and ending tag are mandatory.
<select>: The HTML Select element - HTML: Hypertext Markup Language
WebHTMLElementselect
tag omission none, both the starting and ending tag are mandatory.
<shadow>: The obsolete Shadow Root element - HTML: Hypertext Markup Language
WebHTMLElementshadow
content categories transparent content permitted content flow content tag omission none, both the starting and ending tag are mandatory.
<slot> - HTML: Hypertext Markup Language
WebHTMLElementslot
content categories flow content, phrasing content permitted content transparent events slotchange tag omission none, both the starting and ending tag are mandatory.
<small>: the side comment element - HTML: Hypertext Markup Language
WebHTMLElementsmall
content categories flow content, phrasing content permitted content phrasing content tag omission none, must have both a start tag and an end tag.
<source>: The Media or Image Source element - HTML: Hypertext Markup Language
WebHTMLElementsource
tag omission it must have a start tag, but must not have an end tag.
<span> - HTML: Hypertext Markup Language
WebHTMLElementspan
tag omission none, both the starting and ending tag are mandatory.
<strong>: The Strong Importance element - HTML: Hypertext Markup Language
WebHTMLElementstrong
tag omission none, must have both a start tag and an end tag.
<sub>: The Subscript element - HTML: Hypertext Markup Language
WebHTMLElementsub
tag omission none, both the starting and ending tag are mandatory.
<summary>: The Disclosure Summary element - HTML: Hypertext Markup Language
WebHTMLElementsummary
permitted content phrasing content or one element of heading content tag omission none, both the start tag and the end tag are mandatory.
<sup>: The Superscript element - HTML: Hypertext Markup Language
WebHTMLElementsup
tag omission none, both the starting and ending tag are mandatory.
<table>: The Table element - HTML: Hypertext Markup Language
WebHTMLElementtable
flow content permitted content in this order: an optional <caption> element, zero or more <colgroup> elements, an optional <thead> element, either one of the following: zero or more <tbody> elements one or more <tr> elements an optional <tfoot> element tag omission none, both the starting and ending tag are mandatory.
<td>: The Table Data Cell element - HTML: Hypertext Markup Language
WebHTMLElementtd
tag omission the start tag is mandatory.
<tfoot>: The Table Foot element - HTML: Hypertext Markup Language
WebHTMLElementtfoot
tag omission the start tag is mandatory.
<th> - HTML: Hypertext Markup Language
WebHTMLElementth
tag omission the start tag is mandatory.
<thead>: The Table Head element - HTML: Hypertext Markup Language
WebHTMLElementthead
tag omission the start tag is mandatory.
<tr>: The Table Row element - HTML: Hypertext Markup Language
WebHTMLElementtr
technical summary content categories none permitted content zero or more <td> and/or <th> elements; script-supporting elements (<script> and <template>) are also allowed tag omission start tag is mandatory.
<track>: The Embed Text Track element - HTML: Hypertext Markup Language
WebHTMLElementtrack
tag omission as it is a void element, the start tag must be present and the end tag must not be present.
<u>: The Unarticulated Annotation (Underline) element - HTML: Hypertext Markup Language
WebHTMLElementu
tag omission none, both the starting and ending tag are mandatory.
<ul>: The Unordered List element - HTML: Hypertext Markup Language
WebHTMLElementul
tag omission none, both the starting and ending tag are mandatory.
<var>: The Variable element - HTML: Hypertext Markup Language
WebHTMLElementvar
tag omission none, both the starting and ending tag are mandatory.
<wbr> - HTML: Hypertext Markup Language
WebHTMLElementwbr
permitted content empty tag omission it is an empty element; it must have a start tag, but must not have an end tag.
<xmp> - HTML: Hypertext Markup Language
WebHTMLElementxmp
summary the html example element (<xmp>) renders text between the start and end tags without interpreting the html in between and using a monospaced font.
data-* - HTML: Hypertext Markup Language
the * may be replaced by any name following the production rule of xml names with the following restrictions: the name must not start with xml, whatever case is used for these letters; the name must not contain any semicolon (u+003a); the name must not contain capital letters.
draggable - HTML: Hypertext Markup Language
for other elements, the event ondragstart must be set for drag and drop to work, as shown in this comprehensive example.
id - HTML: Hypertext Markup Language
though this restriction has been lifted in html5, an id should start with a letter for compatibility.
Global attributes - HTML: Hypertext Markup Language
the event handler attributes: onabort, onautocomplete, onautocompleteerror, onblur, oncancel, oncanplay, oncanplaythrough, onchange, onclick, onclose, oncontextmenu, 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, onplay, onplaying, onprogress, onratechange, onreset, onresize, onscroll, onseeked, onseeking, onselect, onshow, ons...
Inline elements - HTML: Hypertext Markup Language
an inline element does not start on a new line and only takes up as much width as necessary.
Preloading content with rel="preload" - HTML: Hypertext Markup Language
the preload value of the <link> element's rel attribute lets you declare fetch requests in the html's <head>, specifying resources that your page will need very soon, which you want to start loading early in the page lifecycle, before browsers' main rendering machinery kicks in.
Quirks Mode and Standards Mode - HTML: Hypertext Markup Language
when the web standards were made at w3c, browsers could not just start using them, as doing so would break most existing sites on the web.
Basics of HTTP - HTTP
content negotiation http introduces a set of headers, starting with accept as a way for a browser to announce the format, language, or encoding it prefers.
Compression in HTTP - HTTP
te and transfer-encoding are mostly used to send a response by chunks, allowing to start transmitting a resource without knowing its length.
Content negotiation - HTTP
the http/1.1 standard defines list of the standard headers that start server-driven negotiation (accept, accept-charset, accept-encoding, accept-language).
Using HTTP cookies - HTTP
WebHTTPCookies
the browser defines when the "current session" ends, and some browsers use session restoring when restarting, which can cause session cookies to last indefinitely long.
Using Feature Policy - HTTP
for new content, you can start developing with a policy that disables all the features.
Accept-Ranges - HTTP
in presence of an accept-ranges header, the browser may try to resume an interrupted download, rather than to start it from the start again.
Access-Control-Max-Age - HTTP
chromium (starting in v76) caps at 2 hours (7200 seconds).
CSP: report-uri - HTTP
content-security-policy: default-src https:; report-uri /csp-violation-report-endpoint/ /csp-violation-report-endpoint/ could for example run a php something like the following that logs the json detailing the violation and, if the violation is the first one added to the log file, sends an email to an administrator: <?php // start configure $log_file = dirname(__file__) .
CSP: sandbox - HTTP
allow-presentation allows embedders to have control over whether an iframe can start a presentation session.
Large-Allocation - HTTP
the large-allocation tells the browser that the web content in the to-be-loaded page is going to want to perform a large contiguous memory allocation and the browser can react to this header by starting a dedicated process for the to-be-loaded document, for example.
X-Content-Type-Options - HTTP
starting with firefox 72, the opting out of mime sniffing is also applied to top-level documents if a content-type is provided.
CONNECT - HTTP
WebHTTPMethodsCONNECT
the http connect method starts two-way communications with the requested resource.
Proxy servers and tunneling - HTTP
it starts two-way communications with the requested resource and can be used to open a tunnel.
103 Early Hints - HTTP
WebHTTPStatus103
the http 103 early hints information response status code is primarily intended to be used with the link header to allow the user agent to start preloading resources while the server is still preparing a response.
202 Accepted - HTTP
WebHTTPStatus202
the hypertext transfer protocol (http) 202 accepted response status code indicates that the request has been accepted for processing, but the processing has not been completed; in fact, processing may not have started yet.
HTTP response status codes - HTTP
WebHTTPStatus
103 early hints this status code is primarily intended to be used with the link header, letting the user agent start preloading resources while the server prepares a response.
JavaScript data types and data structures - JavaScript
starting with ecmascript 2015, you are also able to check if a number is in the double-precision floating-point number range using number.issafeinteger() as well as number.max_safe_integer and number.min_safe_integer.
Details of the object model - JavaScript
calling the workerbee constructor ensures that an engineer object starts out with the properties specified in all constructor functions that are called.
Meta programming - JavaScript
« previousnext » starting with ecmascript 2015, javascript gains support for the proxy and reflect objects allowing you to intercept and define custom behavior for fundamental language operations (e.g.
Regular expression syntax cheatsheet - JavaScript
this character has a different meaning when it appears at the start of a group.
About the JavaScript reference - JavaScript
where to find javascript information javascript documentation of core language features (pure ecmascript, for the most part) includes the following: the javascript guide the javascript reference if you are new to javascript, start with the guide.
Deprecated and obsolete features - JavaScript
lastindex the index at which to start the next match.
Warning: 08/09 is not a legal ECMA-262 octal constant - JavaScript
decimal literals can start with a zero (0) followed by another decimal digit, but if all digits after the leading 0 are smaller than 8, the number is interpreted as an octal number.
SyntaxError: invalid regular expression flag "x" - JavaScript
to match newlines (added in ecmascript 2018) u unicode; treat pattern as a sequence of unicode code points y perform a "sticky" search that matches starting at the current position in the target string.
SyntaxError: missing formal parameter - JavaScript
in javascript, identifiers can contain only alphanumeric characters (or "$" or "_"), and may not start with a digit.
Arrow function expressions - JavaScript
correction: start note: the previous statement seems false.
Method definitions - JavaScript
starting with ecmascript 2015, a shorter syntax for method definitions on objects initializers is introduced.
getter - JavaScript
expression starting with ecmascript 2015, you can also use expressions for a computed property name to bind to the given function.
setter - JavaScript
expression starting with ecmascript 2015, you can also use expressions for a computed property name to bind to the given function.
Array.prototype.find() - JavaScript
'bananas', quantity: 0}, {name: 'cherries', quantity: 5} ]; const result = inventory.find( ({ name }) => name === 'cherries' ); console.log(result) // { name: 'cherries', quantity: 5 } find a prime number in an array the following example finds an element in the array that is a prime number (or returns undefined if there is no prime number): function isprime(element, index, array) { let start = 2; while (start <= math.sqrt(element)) { if (element % start++ < 1) { return false; } } return element > 1; } console.log([4, 6, 8, 12].find(isprime)); // undefined, not found console.log([4, 5, 8, 12].find(isprime)); // 5 the following examples show that nonexistent and deleted elements are visited, and that the value passed to the callback is their value when visited: ...
Array.from() - JavaScript
clojure, php etc) const range = (start, stop, step) => array.from({ length: (stop - start) / step + 1}, (_, i) => start + (i * step)); // generate numbers range 0..4 range(0, 4, 1); // [0, 1, 2, 3, 4] // generate numbers range 1..10 with step of 2 range(1, 10, 2); // [1, 3, 5, 7, 9] // generate the alphabet using array.from making use of it being ordered as a sequence range('a'.charcodeat(0), 'z'.charcodeat(0), 1).map(x => string.f...
Array.prototype.includes() - JavaScript
the first element to be searched is found at fromindex for positive values of fromindex, or at arr.length + fromindex for negative values of fromindex (using the absolute value of fromindex as the number of elements from the end of the array at which to start the search).
Array.prototype.indexOf() - JavaScript
fromindex optional the index to start the search at.
Array.prototype.push() - JavaScript
the push method relies on a length property to determine where to start inserting the given values.
Array.prototype.toString() - JavaScript
ecmascript 5 semantics starting in javascript 1.8.5 (firefox 4), and consistent with ecmascript 5th edition semantics, the tostring() method is generic and can be used with any object.
ArrayBuffer() constructor - JavaScript
compatibility notes starting with ecmascript 2015, arraybuffer constructors require to be constructed with a new operator.
Atomics - JavaScript
atomic operations make sure that predictable values are written and read, that operations are finished before the next operation starts and that operations are not interrupted.
DataView() constructor - JavaScript
if unspecified, the buffer view starts with the first byte.
DataView.prototype.byteLength - JavaScript
the bytelength accessor property represents the length (in bytes) of this view from the start of its arraybuffer or sharedarraybuffer.
DataView.prototype.byteOffset - JavaScript
the byteoffset accessor property represents the offset (in bytes) of this view from the start of its arraybuffer or sharedarraybuffer.
Date.prototype.getTime() - JavaScript
var end, start; start = new date(); for (var i = 0; i < 1000; i++) { math.sqrt(i); } end = new date(); console.log('operation took ' + (end.gettime() - start.gettime()) + ' msec'); specifications specification ecmascript (ecma-262)the definition of 'date.prototype.gettime' in that specification.
Date.prototype.setMonth() - JavaScript
syntax dateobj.setmonth(monthvalue[, dayvalue]) versions prior to javascript 1.3 dateobj.setmonth(monthvalue) parameters monthvalue a zero-based integer representing the month of the year offset from the start of the year.
Function.prototype.apply() - JavaScript
starting with ecmascript 5 these arguments can be a generic array-like object instead of an array.
Function.prototype.bind() - JavaScript
these arguments (if any) follow the provided this value and are then inserted at the start of the arguments passed to the target function, followed by whatever arguments are passed bound function at the time it is called.
Intl.DateTimeFormat.prototype.formatRange() - JavaScript
syntax intl.datetimeformat.prototype.formatrange(startdate, enddate) examples basic formatrange usage this method receives two dates and formats the date range in the most concise way based on the locale and options provided when instantiating intl.datetimeformat.
Intl.Locale.prototype.language - JavaScript
examples setting the language in the locale identifer string argument in order to be a valid unicode locale identifier, a string must start with the language subtag.
Object.prototype.toString() - JavaScript
the following code illustrates this: const o = new object(); o.tostring(); // returns [object object] note: starting in javascript 1.8.5, tostring() called on null returns [object null], and undefined returns [object undefined], as defined in the 5th edition of ecmascript and subsequent errata.
Reflect.has() - JavaScript
examples using reflect.has() reflect.has({x: 0}, 'x') // true reflect.has({x: 0}, 'y') // false // returns true for properties in the prototype chain reflect.has({x: 0}, 'tostring') // proxy with .has() handler method obj = new proxy({}, { has(t, k) { return k.startswith('door') } }); reflect.has(obj, 'doorbell') // true reflect.has(obj, 'dormitory') // false reflect.has returns true for any inherited properties, like the in operator: const a = {foo: 123} const b = {__proto__: a} const c = {__proto__: b} // the prototype chain is: c -> b -> a reflect.has(c, 'foo') // true specifications specification ecmascript (ecma-262)the defini...
RegExp.leftContext ($`) - JavaScript
you can not use the shorthand alias with the dot property accessor (regexp.$`), because the parser expects a starting template string in that case and a syntaxerror is thrown.
RegExp.prototype.multiline - JavaScript
for example, if "m" is used, "^" and "$" change from matching at only the start or end of the entire string to the start or end of any line within the string.
RegExp.rightContext ($') - JavaScript
you can not use the shorthand alias with the dot property accessor (regexp.$'), because the parser expects a starting string in that case and a syntaxerror is thrown.
RegExp.prototype.sticky - JavaScript
g var str = '#foo#'; var regex = /foo/y; regex.lastindex = 1; regex.test(str); // true regex.lastindex = 5; regex.test(str); // false (lastindex is taken into account with sticky flag) regex.lastindex; // 0 (reset after match failure) anchored sticky flag for several versions, firefox's spidermonkey engine had a bug with regard to the ^ assertion and the sticky flag which allowed expressions starting with the ^ assertion and using the sticky flag to match when they shouldn't.
RegExp.prototype.test() - JavaScript
(regexp.prototype.exec() also advances the lastindex property.) further calls to test(str) will resume searching str starting from lastindex.
RegExp.prototype.toString() - JavaScript
examples using tostring() the following example displays the string value of a regexp object: var myexp = new regexp('a+b+c'); console.log(myexp.tostring()); // logs '/a+b+c/' var foo = new regexp('bar', 'g'); console.log(foo.tostring()); // logs '/bar/g' empty regular expressions and escaping starting with ecmascript 5, an empty regular expression returns the string "/(?:)/" and line terminators such as "\n" are escaped: new regexp().tostring(); // "/(?:)/" new regexp('\n').tostring() === '/\n/'; // true, prior to es5 new regexp('\n').tostring() === '/\\n/'; // true, starting with es5 specifications specification ecmascript (ecma-262)the definition of 'regexp.prototy...
Planned changes to shared memory - JavaScript
starting with firefox 79, the features described in this document are enabled by default.
String.prototype.codePointAt() - JavaScript
number(position) : 0; if (index != index) { // better `isnan` index = 0; } // account for out-of-bounds indices: if (index < 0 || index >= size) { return undefined; } // get the first code unit var first = string.charcodeat(index); var second; if ( // check if it’s the start of a surrogate pair first >= 0xd800 && first <= 0xdbff && // high surrogate size > index + 1 // there is a next code unit ) { second = string.charcodeat(index + 1); if (second >= 0xdc00 && second <= 0xdfff) { // low surrogate // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae return (first - 0xd800) * 0x400 + second -...
String.prototype.includes() - JavaScript
however, you can easily polyfill this method: if (!string.prototype.includes) { string.prototype.includes = function(search, start) { 'use strict'; if (search instanceof regexp) { throw typeerror('first argument must not be a regexp'); } if (start === undefined) { start = 0; } return this.indexof(search, start) !== -1; }; } examples using includes() const str = 'to be, or not to be, that is the question.' console.log(str.includes('to be')) // true console.log(str.includes('question'))...
TypedArray.prototype.byteOffset - JavaScript
the byteoffset accessor property represents the offset (in bytes) of a typed array from the start of its arraybuffer.
TypedArray.prototype.find() - JavaScript
function isprime(element, index, array) { var start = 2; while (start <= math.sqrt(element)) { if (element % start++ < 1) { return false; } } return element > 1; } var uint8 = new uint8array([4, 5, 8, 12]); console.log(uint8.find(isprime)); // 5 specifications specification ecmascript (ecma-262)the definition of '%typedarray%.prototype.find' in that specification.
TypedArray.prototype.findIndex() - JavaScript
function isprime(element, index, array) { var start = 2; while (start <= math.sqrt(element)) { if (element % start++ < 1) { return false; } } return element > 1; } var uint8 = new uint8array([4, 6, 8, 12]); var uint16 = new uint16array([4, 6, 7, 12]); console.log(uint8.findindex(isprime)); // -1, not found console.log(uint16.findindex(isprime)); // 2 specifications specification ecmascript (ecma-262)the ...
TypedArray.prototype.indexOf() - JavaScript
fromindex the index to start the search at.
TypedArray.prototype.set() - JavaScript
if this value is omitted, 0 is assumed (that is, the source array will overwrite values in the target array starting at index 0).
Uint16Array() constructor - JavaScript
starting with ecmascript 2015, uint16array constructors require to be constructed with a new operator.
WeakRef() constructor - JavaScript
class counter { constructor(element) { // remember a weak reference to a dom element this.ref = new weakref(element); this.start(); } } specifications specification weakrefsthe definition of 'weakref constructor' in that specification.
WebAssembly.LinkError() constructor - JavaScript
the webassembly.linkerror() constructor creates a new webassembly linkerror object, which indicates an error during module instantiation (besides traps from the start function).
WebAssembly.LinkError - JavaScript
the webassembly.linkerror object indicates an error during module instantiation (besides traps from the start function).
WebAssembly - JavaScript
webassembly.instance() is a stateful, executable instance of a webassembly.module webassembly.linkerror() indicates an error during module instantiation (besides traps from the start function).
encodeURIComponent() - JavaScript
without encodeuricomponent() the ampersand could be interpretted on the server as the start of a new field and jeopardize the integrity of the data.
Object initializer - JavaScript
computed property names starting with ecmascript 2015, the object initializer syntax also supports computed property names.
Spread syntax (...) - JavaScript
1, 2]; const arr2 = [3, 4, 5]; // append all items from arr2 onto arr1 arr1 = arr1.concat(arr2); with spread syntax this becomes: let arr1 = [0, 1, 2]; let arr2 = [3, 4, 5]; arr1 = [...arr1, ...arr2]; // arr1 is now [0, 1, 2, 3, 4, 5] // note: not to use const otherwise, it will give typeerror (invalid assignment) array.prototype.unshift() is often used to insert an array of values at the start of an existing array.
Function expression - JavaScript
syntax the expression is not allowed at the start of a statement.
this - JavaScript
this feature wasn't implemented in some browsers when they first started to support strict mode.
typeof - JavaScript
block scoped variables are in a "temporal dead zone" from the start of the block until the initialization is processed, during which, it will throw an error if accessed.
yield - JavaScript
between the generator's code path, its yield operators, and the ability to specify a new starting value by passing it to generator.prototype.next(), generators offer enormous power and control.
block - JavaScript
in strict mode, starting with es2015, functions inside blocks are scoped to that block.
continue - JavaScript
var i = 0; var j = 8; checkiandj: while (i < 4) { console.log('i: ' + i); i += 1; checkj: while (j > 4) { console.log('j: ' + j); j -= 1; if ((j % 2) == 0) continue checkj; console.log(j + ' is odd.'); } console.log('i = ' + i); console.log('j = ' + j); } output: i: 0 // start checkj j: 8 7 is odd.
do...while - JavaScript
var result = ''; var i = 0; do { i += 1; result += i + ' '; } while (i > 0 && i < 5); // despite i == 0 this will still loop as it starts off without the test console.log(result); specifications specification ecmascript (ecma-262)the definition of 'do-while statement' in that specification.
for - JavaScript
examples using for the following for statement starts by declaring the variable i and initializing it to 0.
function* - JavaScript
next().value); // 10 console.log(gen.next().value); // 11 console.log(gen.next().value); // 12 console.log(gen.next().value); // 13 console.log(gen.next().value); // 20 passing arguments into generators function* loggenerator() { console.log(0); console.log(1, yield); console.log(2, yield); console.log(3, yield); } var gen = loggenerator(); // the first call of next executes from the start of the function // until the first yield statement gen.next(); // 0 gen.next('pretzel'); // 1 pretzel gen.next('california'); // 2 california gen.next('mayonnaise'); // 3 mayonnaise return statement in a generator function* yieldandreturn() { yield "y"; return "r"; yield "unreachable"; } var gen = yieldandreturn() console.log(gen.next()); // { value: "y", done: false } co...
label - JavaScript
foo: { console.log('face'); break foo; console.log('this will not be executed'); } console.log('swap'); // this will log: // "face" // "swap" labeled function declarations starting with ecmascript 2015, labeled function declarations are now standardized for non-strict code in the web compatibility annex of the specification.
return - JavaScript
starting with firefox 40, a warning is shown in the console if unreachable code is found after a return statement.
Template literals (Template strings) - JavaScript
let str = string.raw`hi\n${2+3}!`; // "hi\n5!" str.length; // 6 array.from(str).join(','); // "h,i,\,n,5,!" tagged templates and escape sequences es2016 behavior as of ecmascript 2016, tagged templates conform to the rules of the following escape sequences: unicode escapes started by "\u", for example \u00a9 unicode code point escapes indicated by "\u{}", for example \u{2f804} hexadecimal escapes started by "\x", for example \xa9 octal literal escapes started by "\0o" and followed by one or more digits, for example \0o251 this means that a tagged template like the following is problematic, because, per ecmascript grammar, a parser looks for valid unicode escape sequ...
Trailing commas - JavaScript
var arr = [1, 2, 3,,,]; arr.length; // 5 objects starting with ecmascript 5, trailing commas in object literals are legal as well: var object = { foo: "bar", baz: "qwerty", age: 42, }; trailing commas in functions ecmascript 2017 allows trailing commas in function parameter lists.
JavaScript
get started tutorials learn how to program in javascript with guides and tutorials.
Web app manifests
click each one for more information about it: background_colorcategoriesdescriptiondirdisplayiarc_rating_idiconslangnameorientationprefer_related_applicationsrelated_applicationsscopescreenshotsserviceworkershort_nameshortcutsstart_urltheme_color example manifest { "name": "hackerweb", "short_name": "hackerweb", "start_url": ".", "display": "standalone", "background_color": "#fff", "description": "a simply readable hacker news app.", "icons": [{ "src": "images/touch/homescreen48.png", "sizes": "48x48", "type": "image/png" }, { "src": "images/touch/homescreen72.png", "sizes": "72x72", ...
<mspace> - MathML
WebMathMLElementmspace
starting with mathml 3, it is preferred to use <mo> to control linebreaking.
<mtable> - MathML
WebMathMLElementmtable
starting with gecko 8.0 (firefox 8.0 / thunderbird 8.0 / seamonkey 2.5) the interpretation of negative values has been corrected (bug 601436).
Digital audio concepts - Web media technologies
the audio bandwidth can't be reduced nearly as much as for a speech-only codec, but it is still a helpful start.
Media container formats (file types) - Web media technologies
in addition, the quicktime framework has been deprecated on the mac for some time, and is no longer available at all starting in macos 10.15 catalina.
The "codecs" parameter in common media types - Web media technologies
the syntax for the value of codecs varies by codec; however, it always starts with the codec's four-character identifier, a period separator (.), followed by the object type indication (oti) value for the specific data format.
Using audio and video in HTML - Web media technologies
we don't have a particularly good guide to using these objects offscreen at this time, although audio and video manipulation may be a good start.
Web media technologies
if you're not sure which api you should use, this is the place to start.
Recommended Web Performance Timings: How long is too long? - Web Performance
as noted in the description of the critical rendering path, when received, browsers immediately start processing the html, rendering the content as it is received rather than waiting for additional assets to load.
Performance budgets - Web Performance
how fast can users start reading), which will inform file specific budgets (e.g.
Privacy, permissions, and information security
these start at the web server, include the very communication layer used over the network, and then extend through the web browser's security offerings before reaching your web app code and the efforts it takes to secure itself and the data the user entrusts to it.
PWA developer guide - Progressive web apps (PWAs)
<<<--- web app basics introduction and getting started with pwa development some description installing and uninstalling web apps an introductory guide to how a web app can be installed on the user's device...
Introduction to progressive web apps - Progressive web apps (PWAs)
early stage emerging startups like couponmoto have also started using progressive web apps to drive more consumer engagement, showing that they can help small as well as big companies to (re-)engage users more effectively.
Progressive loading - Progressive web apps (PWAs)
if you're past that point, then you can start thinking about optimizing the image loading using javascript.
Making PWAs work offline with Service workers - Progressive web apps (PWAs)
registering the service worker we'll start by looking at the code that registers a new service worker, in the app.js file: note : we're using the es6 arrow functions syntax in the service worker implementation if('serviceworker' in navigator) { navigator.serviceworker.register('./pwa-examples/js13kpwa/sw.js'); }; if the service worker api is supported in the browser, it is registered against the site using the serviceworkercontaine...
Responsive Navigation Patterns - Progressive web apps (PWAs)
these patterns are a great place to start.
by - SVG: Scalable Vector Graphics
WebSVGAttributeby
the starting value for the attribute is either indicated by specifying it as value for the attribute given in the attributename or the from attribute.
data-* - SVG: Scalable Vector Graphics
WebSVGAttributedata-*
the * can be replaced by any characters allowed in xml's rules for names, with the following restrictions: can't start with xml.
direction - SVG: Scalable Vector Graphics
it defines the start and end points of a line of text as used by the text-anchor and inline-size properties.
end - SVG: Scalable Vector Graphics
WebSVGAttributeend
those are: focus, blur, focusin, focusout, activate, auxclick, click, dblclick, mousedown, mouseenter, mouseleave, mousemove, mouseout, mouseover, mouseup, wheel, beforeinput, input, keydown, keyup, compositionstart, compositionupdate, compositionend, load, unload, abort, error, select, resize, scroll, beginevent, endevent, and repeatevent .
fill-rule - SVG: Scalable Vector Graphics
starting with a count of zero, add one each time a path segment crosses the ray from left to right and subtract one each time a path segment crosses the ray from right to left.
id - SVG: Scalable Vector Graphics
WebSVGAttributeid
a stand-alone svg document uses xml 1.0 syntax, which specifies that valid ids only include designated characters (letters, digits, and a few punctuation marks), and do not start with a digit, a full stop (.) character, or a hyphen-minus (-) character.
marker-end - SVG: Scalable Vector Graphics
in this case, if the value of marker-start and marker-end are both not none, then two markers will be rendered on that final vertex.
markerUnits - SVG: Scalable Vector Graphics
lt value strokewidth animatable yes userspaceonuse this value specifies that the markerwidth and markerunits attributes and the contents of the <marker> element represent values in the current user coordinate system in place for the graphic object referencing the marker (i.e., the user coordinate system for the element referencing the <marker> element via a marker, marker-start, marker-mid, or marker-end property).
pathLength - SVG: Scalable Vector Graphics
stroke-dasharray, for example, will assume the start of the path being 0 and the end point the value defined in the pathlength attribute.
pointer-events - SVG: Scalable Vector Graphics
<rect x="10" y="0" height="10" width="10" fill="black" /> <circle cx="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>,...
r - SVG: Scalable Vector Graphics
WebSVGAttributer
value <length> | <percentage> default value 0 animatable yes note: starting with svg2, r is a geometry property meaning this attribute can also be used as a css property for circles.
seed - SVG: Scalable Vector Graphics
WebSVGAttributeseed
the seed attribute represents the starting number for the pseudo random number generator of the <feturbulence> filter primitive.
stroke-dashoffset - SVG: Scalable Vector Graphics
ipse>, <path>, <line>, <polygon>, <polyline>, <rect>, <text>, <textpath>, <tref>, and <tspan> html,body,svg { height:100% } <svg viewbox="-3 0 33 10" xmlns="http://www.w3.org/2000/svg"> <!-- no dash array --> <line x1="0" y1="1" x2="30" y2="1" stroke="black" /> <!-- no dash offset --> <line x1="0" y1="3" x2="30" y2="3" stroke="black" stroke-dasharray="3 1" /> <!-- the start of the dash array computation is pulled by 3 user units --> <line x1="0" y1="5" x2="30" y2="5" stroke="black" stroke-dasharray="3 1" stroke-dashoffset="3" /> <!-- the start of the dash array computation is pushed by 3 user units --> <line x1="0" y1="7" x2="30" y2="7" stroke="black" stroke-dasharray="3 1" stroke-dashoffset="-3" /> <!-- the st...
target - SVG: Scalable Vector Graphics
WebSVGAttributetarget
the name must be a valid xml name [xml11], and should not start with an underscore (u+005f low line character), to meet the requirements of a valid browsing context name from html.
x2 - SVG: Scalable Vector Graphics
WebSVGAttributex2
0 20 10" xmlns="http://www.w3.org/2000/svg"> <!-- by default the gradient vector end at the right bounding limit of the shape it is applied to --> <lineargradient x2="100%" id="g0"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="1" y="1" width="8" height="8" fill="url(#g0)" /> <!-- here the gradient vector start at 20% of the left bounding limit of the shape it is applied to --> <lineargradient x2="20%" id="g1"> <stop offset="0" stop-color="black" /> <stop offset="100%" stop-color="red" /> </lineargradient> <rect x="11" y="1" width="8" height="8" fill="url(#g1)" /> </svg> specifications specification status comment scalable vector graphics (svg) 2the...
xlink:title - SVG: Scalable Vector Graphics
it may be used, for example, to make titles available to applications used by visually impaired users, or to create a table of links, or to present help text that appears when a user lets a mouse pointer hover over a starting resource.
<animate> - SVG: Scalable Vector Graphics
WebSVGElementanimate
html,body,svg { height:100%; margin:0; padding:0; } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <rect width="10" height="10"> <animate attributename="rx" values="0;5;0" dur="10s" repeatcount="indefinite" /> </rect> </svg> attributes animation attributes animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill animation value attributes calcmode, values, keytimes, keysplines, from, to, by other animation attributes most notably: attributename, additive, accumulate animation event attributes most notably: onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, docum...
<animateMotion> - SVG: Scalable Vector Graphics
value type: <number>|auto|auto-reverse; default value: 0; animatable: no note: for <animatemotion> the default value for the calcmode attribute is paced animation attributes animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill animation value attributes calcmode, values, keytimes, keysplines, from, to, by other animation attributes most notably: attributename, additive, accumulate animation event attributes most notably: onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, docum...
<circle> - SVG: Scalable Vector Graphics
WebSVGElementcircle
value type: <number> ; default value: none; animatable: yes note: starting with svg2, cx, cy, and r are geometry properties, meaning those attributes can also be used as css properties for that element.
<ellipse> - SVG: Scalable Vector Graphics
WebSVGElementellipse
value type: <number> ; default value: none; animatable: yes note: starting with svg2 cx, cy, rx and ry are geometry properties, meaning those attributes can also be used as css properties for that element.
<feColorMatrix> - SVG: Scalable Vector Graphics
it is recommended to start manipulating the matrix from here.
<foreignObject> - SVG: Scalable Vector Graphics
value type: <length>|<percentage> ; default value: 0; animatable: yes note: starting with svg2, x, y, width, and height are geometry properties, meaning those attributes can also be used as css properties for that element.
<mpath> - SVG: Scalable Vector Graphics
WebSVGElementmpath
example svg <svg width="100%" height="100%" viewbox="0 0 500 300" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" > <rect x="1" y="1" width="498" height="298" fill="none" stroke="blue" stroke-width="2" /> <!-- draw the outline of the motion path in blue, along with three small circles at the start, middle and end.
<rect> - SVG: Scalable Vector Graphics
WebSVGElementrect
value type: <number> ; default value: none; animatable: yes note: starting with svg2, x, y, width, height, rx and ry are geometry properties, meaning those attributes can also be used as css properties for that element.
<script> - SVG: Scalable Vector Graphics
WebSVGElementscript
ses the href attribute instead of src and it doesn't support ecmascript modules so far (see browser compatibility below for details) html,body,svg { height:100% } <svg viewbox="0 0 10 10" xmlns="http://www.w3.org/2000/svg"> <script> // <![cdata[ window.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 ...
<set> - SVG: Scalable Vector Graphics
WebSVGElementset
value type: <anything>; default value: none; animatable: no animation attributes animation timing attributes begin, dur, end, min, max, restart, repeatcount, repeatdur, fill other animation attributes most notably: attributename animation event attributes most notably: onbegin, onend, onrepeat global attributes core attributes most notably: id styling attributes class, style event attributes global event attributes, document element event attributes usage notes categoriesanimation elementpermitted contentany number of th...
<svg> - SVG: Scalable Vector Graphics
WebSVGElementsvg
value type: <length>|<percentage> ; default value: 0; animatable: yes note: starting with svg2, x, y, width, and height are geometry properties, meaning these attributes can also be used as css properties.
<textPath> - SVG: Scalable Vector Graphics
WebSVGElementtextPath
value type: auto|exact ; default value: exact; animatable: yes startoffset how far the beginning of the text should be offset from the beginning of the path.
<use> - SVG: Scalable Vector Graphics
WebSVGElementuse
note: starting with svg2, x, y, width, and height are geometry properties, meaning those attributes can also be used as css properties for that element.
Example - SVG: Scalable Vector Graphics
var dims = dimensions(); var width = dims[0], height = dims[1]; // choose a random coordinate to start at.
Namespaces crash course - SVG: Scalable Vector Graphics
if you don't already have one, make one up starting with the following code: <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> </svg> even if you don't use all those namespaces in a particular document, there's no harm in including the namespace declarations.
SVG animation with SMIL - SVG: Scalable Vector Graphics
in this case, we're establishing a path consisting of a moveto command to establish the starting point for the animation, then the horizontal-line command to move the circle 300 pixels to the right, followed by the z command, which closes the path, establishing a loop back to the beginning.
Basic Transformations - SVG: Scalable Vector Graphics
« previousnext » now we're ready to start distorting our beautiful images.
Fills and Strokes - SVG: Scalable Vector Graphics
there are additional stroke and fill properties available, including fill-rule, which specifies how to color in shapes that overlap themselves; stroke-miterlimit, which determines if a stroke should draw miters; and stroke-dashoffset, which specifies where to start a dasharray on a line.
SVG fonts - SVG: Scalable Vector Graphics
glyph --></glyph> <glyph unicode="@"><!-- outline of @ glyph --></glyph> <!-- more glyphs --> </font> we start with the <font> element.
SVG Tutorial - SVG: Scalable Vector Graphics
WebSVGTutorial
introducing svg from scratch introduction getting started positions basic shapes paths fills and strokes gradients patterns texts basic transformations clipping and masking other content in svg filter effects svg fonts svg image tag tools for svg svg and css the following topics are more advanced and hence should get their own tutorials.
SVG: Scalable Vector Graphics
WebSVG
getting started this tutorial will help get you started using svg.
How to fix a website with blocked mixed content - Web security
starting with firefox 23, firefox blocks active mixed content by default.
Mixed content - Web security
starting in firefox 23, mixed active content is blocked by default (and mixed display content can be blocked by setting a preference).
Features restricted to secure contexts - Web security
api chrome edge safari firefox application cache restricted to secure contexts planned in chrome 70 deprecation planning started in february 2018 public interest on deprecation webkit bug 182442 restricted to secure contexts in firefox 62 geolocation restricted to secure contexts in 50 restricted to secure contexts in 10 restricted to secure contexts in 55 device orientaion / device motion deprecation warning deprecation warnings since 60.
How to turn off form autocompletion - Web security
this enables the browser to offer autocompletion (that is, suggest possible completions for fields that the user has started typing in) or autofill (that is, pre-populate certain fields upon load).
Using custom elements - Web Components
} } the preceding code snippet contains the constructor() definition for the class, which always starts by calling super() so that the correct prototype chain is established.
Using shadow DOM - Web Components
ur standing upright like a human, with small arms, and a large head with lots of sharp teeth."> <p>here we will add a link to the <a href="https://www.mozilla.org/">mozilla homepage</a></p> </section> </body> </html> this fragment produces the following dom structure: shadow dom allows hidden dom trees to be attached to elements in the regular dom tree — this shadow dom tree starts with a shadow root, underneath which can be attached to any elements you want, in the same way as the normal dom.
XML introduction - XML: Extensible Markup Language
<?xml-stylesheet type="text/xsl" href="transform.xsl"?> recommendations this article is obviously only a very brief introduction to what xml is, with a few small examples and references to get you started.
xml:base - XML: Extensible Markup Language
WebXMLxml:base
> .link { stroke: #999; stroke-opacity: .6; } marker#arrow { fill: black; } </style> </head> <body> <svg width="100%" height="100%" xml:base=""> <defs> <marker id="arrow" viewbox="0 -5 10 10" refx="0" refy="0" markerwidth="20" markerheight="20" orient="auto"> <path d="m0,-5l10,0l0,5"></path> </marker> </defs> <line x1="100" y1="100" x2="333" y2="333" marker-start="url(#arrow)" class="link"></line> </svg> </body> </html> imagine a svg with font references.
Functions - XPath
boolean() ceiling() choose() concat() contains() count() current() xslt-specific document() xslt-specific element-available() false() floor() format-number() xslt-specific function-available() generate-id() xslt-specific id() (partially supported) key() xslt-specific lang() last() local-name() name() namespace-uri() normalize-space() not() number() position() round() starts-with() string() string-length() substring() substring-after() substring-before() sum() system-property() xslt-specific translate() true() unparsed-entity-url() xslt-specific (not supported) ...
Index - XPath
WebXPathIndex
44 starts-with xslt, xslt_reference the starts-with checks whether the first string starts with the second string and returns true or false.
The Netscape XSLT/XPath Reference - XSLT: Extensible Stylesheet Language Transformations
) (supported) format-number() (supported) function-available() (supported) generate-id() (supported) id() (partially supported) key() (supported) lang() (supported) last() (supported) local-name() (supported) name() (supported) namespace-uri() (supported) normalize-space() (supported) not() (supported) number() (supported) position() (supported) round() (supported) starts-with() (supported) string() (supported) string-length() (supported) substring() (supported) substring-after() (supported) substring-before() (supported) sum() (supported) system-property() (supported) translate() (supported) true() (supported) unparsed-entity-url() (not supported) ...
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
pported) floor() (supported) format-number() (supported) function-available() (supported) generate-id() (supported) id() (partially supported) key() (supported) lang() (supported) last() (supported) local-name() (supported) name() (supported) namespace-uri() (supported) normalize-space() (supported) not() (supported) number() (supported) position() (supported) round() (supported) starts-with() (supported) string() (supported) string-length() (supported) substring() (supported) substring-after() (supported) substring-before() (supported) sum() (supported) system-property() (supported) translate() (supported) true() (supported) unparsed-entity-url() (not supported) for further reading books online the world wide web consortium portals articles tutor...
Using the Mozilla JavaScript interface to XSL Transformations - XSLT: Extensible Stylesheet Language Transformations
creating an xsltprocessor to start, you need to create an xsltprocessor object: var processor = new xsltprocessor(); specifying the stylesheet before you can use it, you must import a stylesheet with the xsltprocessor.importstylesheet() method.
Loading and running WebAssembly code - WebAssembly
running your webassembly code once you've got your webassembly instance available in your javascript, you can then start using features of it that have been exported via the webassembly.instance.exports property.
Converting WebAssembly text format to wasm - WebAssembly
to start with, make a copy of the above listing inside a text file; call it simple.wat.
WebAssembly
guides webassembly concepts get started by reading the high-level concepts behind webassembly — what it is, why it is so useful, how it fits into the web platform (and beyond), and how to use it.