Search completed in 1.84 seconds.
1619 results for "message":
Your results are loading. Please wait...
MessageEvent.MessageEvent() - Web APIs
the messageevent() constructor creates a new messageevent object instance.
... syntax var messageevent = new messageevent(type, init); parameters type the type of messageevent that will be created.
... this can be one of xxx init optional a dictionary object that can contain the following properties: data: the data you want contained in the messageevent.
...And 5 more matches
MessagePort.postMessage() - Web APIs
the postmessage() method of the messageport interface sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.
... syntax port.postmessage(message, transferlist); returns void.
... parameters message the message you want to send through the channel.
...And 5 more matches
MessagePort.onmessage - Web APIs
the onmessage event handler of the messageport interface is an eventlistener, called whenever an messageevent of type message is fired on the port — that is, when the port receives a message.
... syntax channel.onmessage = function() { ...
... }; example in the following code block, you can see a new channel being created using the messagechannel.messagechannel constructor.
...And 4 more matches
ServiceWorkerMessageEvent.ServiceWorkerMessageEvent() - Web APIs
service worker messages will now use the messageevent interface, for consistency with other web messaging features.
... the serviceworkermessageevent() constructor creates a new serviceworkermessageevent object instance.
... syntax var myswme = new serviceworkermessageevent(type, init); parameters type a domstring that defines the type of the message event being created.
...And 3 more matches
MessagePort: message event - Web APIs
the message event is fired on a messageport object when a message arrives on that channel.
... bubbles no cancelable no interface messageevent event handler property onmessage examples suppose a script creates a messagechannel and sends one of the ports to a different browsing context, such as another <iframe>, using code like this: const channel = new messagechannel(); const myport = channel.port1; const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const messagecontrol = document.queryselector('#message'); const channelmessagebutton = document.queryselector('#channel-message'); channelmessagebutton.addeventlistener('click', () => { myport.postmessage(messagecontrol.value); }) targetframe.postmessage('init', targetorigin, [channel.port2]); the target can receive the port and start listenin...
...g 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 ...
MessagePort: messageerror event - Web APIs
the messageerror event is fired on a messageport object when it receives a message that can't be deserialized.
... bubbles no cancelable no interface messageevent event handler property onmessageerror examples suppose a script creates a messagechannel and sends one of the ports to a different browsing context, such as another <iframe>, using code like this: const channel = new messagechannel(); const myport = channel.port1; const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const messagecontrol = document.queryselector('#message'); const channelmessagebutton = document.queryselector('#channel-message'); channelmessagebutton.addeventlistener('click', () => { myport.postmessage(messagecontrol.value); }) targetframe.postmessage('init', targetorigin, [channel.port2]); the target can receive the port and start lis...
...tening 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 ...
MessagePort.onmessageerror - Web APIs
the onmessageerror event handler of the messageport interface is an eventlistener, called whenever an messageevent of type messageerror is fired on the port—that is, when it receives a message that cannot be deserialized.
... syntax port.onmessageerror = function() { ...
... }; specifications specification status comment html living standardthe definition of 'onmessageerror' in that specification.
MediaKeyMessageEvent.messageType - Web APIs
the mediakeymessageevent.messagetype read-only property indicates the type of message.
... syntax var messagetype = mediakeymessageevent.messagetype; specifications specification status comment encrypted media extensionsthe definition of 'messagetype' in that specification.
Message manager overview
message managers are designed to enable chrome-privileged javascript code in one process to communicate with chrome-privileged javascript code in a different process.
... this article describes the different types of message manager, how to access them, and at a high level, what sorts of things you can use them for.
... at the top level, there are two different sorts of message managers: frame message managers: these enable chrome process code to load a script into a browser frame (essentially, a single browser tab) in the content process.
...And 42 more matches
Creating a gloda message query
this content covers features introduced in thunderbird 3 this page describes how to programmatically create a message query using gloda, thunderbird's global database.
... creating your first message query...
...you can find the file, which includes doxygen markup of sorts, here: https://hg.mozilla.org/comm-central/file/tip/mailnews/db/gloda/modules/gloda.js components.utils.import("resource:///modules/gloda/public.js"); create the query let query = gloda.newquery(gloda.noun_message); add constraints to the query each constraint function takes one or more arguments which are "or"ed together.
...And 40 more matches
nsIMsgMessageService
objects that implements nsimsgmessageservice give the user top level routines related to messages like copying, displaying, attachment's manipulation, printing, streaming the message content to eml format string, etc.
... inherits from: nsisupports method overview void copymessage(in string asrcuri, in nsistreamlistener acopylistener, in boolean amovemessage, in nsiurllistener aurllistener, in nsimsgwindow amsgwindow, out nsiuri aurl); [noscript] void copymessages(in nsmsgkeyarrayptr keys, in nsimsgfolder srcfolder, in nsistreamlistener acopylistener, in boolean amovemessage, in nsiurllistener aurllistener, in nsimsgwindow amsgwindow, out nsiuri aurl); void displaymessage(in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener, in string acharsetoverride, out nsiuri aurl); void openattachment(in string acontenttype, in string afilename, in string aurl, in string amessageuri, in nsisupports adisplayconsumer, in nsimsg...
...window amsgwindow, in nsiurllistener aurllistener); void savemessagetodisk(in string amessageuri, in nsifilespec afile, in boolean ageneratedummyenvelope, in nsiurllistener aurllistener, out nsiuri aurl, in boolean canonicallineending, in nsimsgwindow amsgwindow); void geturlforuri(in string amessageuri, out nsiuri aurl, in nsimsgwindow amsgwindow); void displaymessageforprinting(in string amessageuri, in nsisupports adisplayconsumer, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener, out nsiuri aurl); void search(in nsimsgsearchsession asearchsession, in nsimsgwindow amsgwindow, in nsimsgfolder amsgfolder, in string asearchuri); nsiuri streammessage(in string amessageuri, in nsisupports aconsumer, in nsimsgwindow amsgwindow, in nsiurllistener...
...And 38 more matches
window.postMessage() - Web APIs
the window.postmessage() method safely enables cross-origin communication between window objects; e.g., between a page and a pop-up that it spawned, or between a page and an iframe embedded within it.
...window.postmessage() provides a controlled mechanism to securely circumvent this restriction (if used properly).
... broadly, one window may obtain a reference to another (e.g., via targetwindow = window.opener), and then dispatch a messageevent on it with targetwindow.postmessage().
...And 34 more matches
Console messages - Firefox Developer Tools
most of the web console is occupied by the message display pane: each message is displayed as a separate row: time the time the message was recorded.
... icon not all console messages contain icons.
... the following icons may be used: informational message warning error blocked; for network messages in addition, a disclosure triangle indicates that further information is available; clicking it displays or collapses that information.
...And 32 more matches
nsIMessageListenerManager
dom/base/nsimessagemanager.idlscriptable this interface enables clients to listen for messages sent using the nsimessagebroadcaster, nsimessagesender, or nsisyncmessagesender interfaces.
... 1.0 66 introduced gecko 17 inherits from: nsisupports last changed in gecko 41 (firefox 41 / thunderbird 41 / seamonkey 2.38) implemented by: @mozilla.org/globalmessagemanager;1.
... to access this service, use: var globalmm = components.classes["@mozilla.org/globalmessagemanager;1"] .getservice(components.interfaces.nsimessagelistenermanager); method overview void addmessagelistener(in astring messagename, in nsimessagelistener listener, [optional] in boolean listenwhenclosed) void removemessagelistener(in astring messagename, in nsimessagelistener listener); void addweakmessagelistener(in astring messagename, in nsimessagelistener listener); void removeweakmessagelistener(in astring messagename, in nsimessagelistener listener); methods addmessagelistener() reg...
...And 24 more matches
nsISyncMessageSender
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsimessagelistenermanager message "senders" have a single "other side" to which messages are sent.
... for example, a child-process message manager will send messages that are only delivered to its one parent-process message manager.
... see message manager interfaces for more details on the distinction between message senders and message broadcasters.
...And 22 more matches
MessageEvent - Web APIs
the messageevent interface represents a message received by a target object.
... this is used to represent messages in: server-sent events (see eventsource.onmessage).
... web sockets (see the onmessage property of the websocket interface).
...And 22 more matches
Message manager overview
message managers are designed to enable code in one process to communicate with code in a different process.
... at the top level, there are two different sorts of message managers: frame message managers: these enable chrome process code to load a script into a browser frame (essentially, a single browser tab) in the content process.
...if chrome code wants to run code in the content process so it can access web content, this is usually the sort of message manager to use.
...And 20 more matches
HTTP Messages - HTTP
WebHTTPMessages
http messages are how data is exchanged between a server and a client.
... there are two types of messages: requests sent by the client to trigger an action on the server, and responses, the answer from the server.
... http messages are composed of textual information encoded in ascii, and span over multiple lines.
...And 17 more matches
nsIMessageBroadcaster
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsimessagelistenermanager message "broadcasters" don't have a single "other side" that they send messages to, but rather a set of subordinate message managers.
... for example, broadcasting a message through a window message manager will broadcast the message to all frame message managers within its window.
... see message manager interfaces for more details on the distinction between message senders and message broadcasters.
...And 15 more matches
nsIFrameMessageManager
content/base/public/nsimessagemanager.idlscriptable provides methods for managing message listeners on local frames.
... this provides a way for local frames to receive messages from remote frames.
...you should use nsimessagelistenermanager or nsimessagesender instead.
...And 13 more matches
nsIMessageListener
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsisupports this interface is used to receive messages sent using the nsimessagebroadcaster, nsimessagesender, or nsisyncmessagesender interfaces.
... listeners are attached using the nsimessagelistenermanager interface.
... methods void receivemessage(); receivemessage() this is for js only.
...And 13 more matches
nsIMessageSender
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsimessagelistenermanager message senders enable clients to send asynchronous messages to a single "other side".
... for example, a child-process message manager will send messages that are only delivered to its one parent-process message manager.
... to send messages to multiple "other sides", you would use nsimessagebroadcaster.
...And 12 more matches
nsMsgMessageFlags
the nsmsgmessageflags interface describes possible flags for messages.
... equivalent flags are also defined in nsmsgmessageflags.h.
... constants name value description read 0x00000001 indicates whether or not the message is read.
...And 11 more matches
MessagePort - Web APIs
the messageport interface of the channel messaging api represents one of the two ports of a messagechannel, allowing messages to be sent from one port and listening out for them arriving at the other.
... methods inherits methods from its parent, eventtarget postmessage() sends a message from the port, and optionally, transfers ownership of objects to other browsing contexts.
... 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.
...And 11 more matches
Communicating using "postMessage" - Archive of obsolete content
as an alternative to port, content modules support the built-in message event.
... in most cases port is preferable to message events.
... however, the context-menu module does not support port, so to send messages from a content script to the add-on via a context menu object, you must use message events.
...And 10 more matches
Folders and message lists
getting the currently-selected message the folderdisplaywidget has several ways of getting the currently-selected message(s), depending on what exactly you're trying to do: gfolderdisplay.selectedcount: returns the number of messages currently selected.
... gfolderdisplay.selectedmessage: returns the first currently-selected message.
... when using this, be sure that there's only one selected message (or that you only care about the first one).
...And 10 more matches
ServiceWorkerMessageEvent - Web APIs
service worker messages will now use the messageevent interface, for consistency with other web messaging features.
... the serviceworkermessageevent interface of the serviceworker api contains information about an event sent to a serviceworkercontainer target.
... this extends the default message event to allow setting a serviceworker object as the source of a message.
...And 9 more matches
Worker.prototype.postMessage() - Web APIs
the postmessage() method of the worker interface sends a message to the worker's inner scope.
... the worker can send back information to the thread that spawned it using the dedicatedworkerglobalscope.postmessage method.
... syntax worker.postmessage(message, [transfer]); parameters message the object to deliver to the worker; this will be in the data field in the event delivered to the dedicatedworkerglobalscope.onmessage handler.
...And 9 more matches
ExtendableMessageEvent - Web APIs
the extendablemessageevent interface of the service worker api represents the event object of a message event fired on a service worker (when a message is received on the serviceworkerglobalscope from another context) — extends the lifetime of such events.
... constructor extendablemessageevent() creates a new extendablemessageevent object instance.
... extendablemessageevent.data read only returns the event's data.
...And 7 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.
... sent via client.postmessage()).
... this can be used to react to sent messages earlier, even before that page's content has finished loading.
...And 7 more matches
MessageChannel - Web APIs
the messagechannel interface of the channel messaging api allows us to create a new message channel and send data through it via its two messageport properties.
... properties messagechannel.port1 read only returns port1 of the channel.
... messagechannel.port2 read only returns port2 of the channel.
...And 6 more matches
Worker.onmessage - Web APIs
WebAPIWorkeronmessage
the onmessage property of the worker interface represents an eventhandler, that is a function to be called when the message event occurs.
... these events are of type messageevent and will be called when the worker's parent receives a message (i.e.
... from the dedicatedworkerglobalscope.postmessage method).
...And 6 more matches
nsIFrameMessageListener
content/base/public/nsimessagemanager.idlscriptable implement this interface in a remote frame handling process to receive messages from the browser process.
... 1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) this interface is used when implementing out-of-process handling of frames; the process handling a frame should implement this interface in order to receive messages.
... method overview void receivemessage(); methods receivemessage() note: this method is for javascript only.
...And 5 more matches
nsIPushMessage
dom/interfaces/push/nsipushnotifier.idlscriptable a push message sent to a system subscription.
... inherits from: nsisupports last changed in gecko 46.0 (firefox 46.0 / thunderbird 46.0 / seamonkey 2.43) nsipushmessage is the subject of a push-message observer notification.
... this interface resembles pushmessagedata from the push api.
...And 5 more matches
DedicatedWorkerGlobalScope.postMessage() - Web APIs
the postmessage() method of the dedicatedworkerglobalscope interface sends a message to the main thread that spawned it.
... the main scope that spawned the worker can send back information to the thread that spawned it using the worker.postmessage method.
... syntax postmessage(amessage, transferlist); parameters amessage the object to deliver to the main thread; this will be in the data field in the event delivered to the worker.onmessage handler.
...And 5 more matches
MessageChannel() - Web APIs
the messagechannel() constructor of the messagechannel interface returns a new messagechannel object with two new messageport objects.
... syntax var channel = new messagechannel(); returns a newly created messagechannel object.
... example in the following code block, you can see a new channel being created using the messagechannel.messagechannel constructor.
...And 5 more matches
XForms Message Element - Archive of obsolete content
introduction used in combination with xml event listeners to display a message to the user when the specified event occurs (see the spec).
... the message of the message element can exist in instance data, in a remote document, or as inline text.
... if more than one source of message is specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text.
...And 4 more matches
nsIContentFrameMessageManager
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsisyncmessagesender this interface provides the environment for scripts that are loaded into content frames using the nsiframescriptloader interface.
... it enables these scripts to receive messages from the chrome process and send messages back to the chrome process.
... frame scripts can send either synchronous or asynchronous messages to the chrome process: for details on these messaging apis see the documentation for the nsicontentframemessagemanager's parent classes nsisyncmessagesender and nsimessagesender.
...And 4 more matches
Client.postMessage() - Web APIs
the postmessage() method of the client interface allows a service worker to send a message to a client (a window, worker, or sharedworker).
... the message is received in the "message" event on navigator.serviceworker.
... syntax client.postmessage(message[, transfer]); client.postmessage(message[, { transfer }]); parameters message the message to send to the client.
...And 4 more matches
DedicatedWorkerGlobalScope.onmessage - Web APIs
the onmessage property of the dedicatedworkerglobalscope interface represents an eventhandler to be called when the message event occurs and bubbles through the worker — i.e.
... when a message is sent to the worker using the worker.postmessage method.
... syntax self.onmessage = function() { ...
...And 4 more matches
MediaKeyMessageEvent - Web APIs
the mediakeymessageevent interface of the encryptedmediaextensions api contains the content and related data when the content decryption module generates a message for the session.
...ht="50" fill="#fff" stroke="#d4dde4" stroke-width="2px" /><text x="38.5" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">event</text></a><polyline points="76,25 86,20 86,30 76,25" stroke="#d4dde4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#d4dde4"/><a xlink:href="/docs/web/api/mediakeymessageevent" target="_top"><rect x="116" y="1" width="200" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="216" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">mediakeymessageevent</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} constructor mediak...
...eymessageevent() creates a new instance of mediakeymessageevent.
...And 4 more matches
MessageChannel.port1 - Web APIs
the port1 read-only property of the messagechannel interface returns the first port of the message channel — the port attached to the context that originated the channel.
... syntax channel.port1; value a messageport object, the first port of the channel, that is the port attached to the context that originated the channel.
... example in the following code block, you can see a new channel being created using the messagechannel() constructor.
...And 4 more matches
MessageChannel.port2 - Web APIs
the port2 read-only property of the messagechannel interface returns the second port of the message channel — the port attached to the context at the other end of the channel, which the message is initially sent to.
... syntax channel.port2; value a messageport object representing the second port of the channel, the port attached to the context at the other end of the channel.
... example in the following code block, you can see a new channel being created using the messagechannel.messagechannel constructor.
...And 4 more matches
PushMessageData - Web APIs
the pushmessagedata interface of the push api provides methods which let you retrieve the push data sent by a server in various formats.
... messages received through the push api are sent encrypted by push services and then automatically decrypted by browsers before they are made accessible through the methods of the pushmessagedata interface.
... methods pushmessagedata.arraybuffer() extracts the data as an arraybuffer object.
...And 4 more matches
RTCDataChannel.onmessage - Web APIs
the rtcdatachannel.onmessage property stores an eventhandler which specifies a function to be called when the message event is fired on the channel.
... this event is represented by the messageevent interface.
... this event is sent to the channel when a message is received from the other peer.
...And 4 more matches
BroadcastChannel.onmessage - Web APIs
the broadcastchannel.onmessage event handler is a property that specifies the function to execute when a message event, of type messageevent, is received by this broadcastchannel.
... such an event is sent by the browser with a message broadcasted to the channel.
... syntax channel.onmessage = function; values function is the name of a user-defined function, without the () suffix or any parameters, or an anonymous function declaration, such as function(event) {...}.
...And 3 more matches
MediaError.message - Web APIs
the read-only property mediaerror.message returns a domstring which contains a human-readable string offering specific diagnostic details related to the error described by the mediaerror object, or an empty string ("") if no diagnostic information can be determined or provided.
... syntax var errormessage = mediaerror.message; value a domstring providing a detailed, specific explanation of what went wrong and possibly how it might be fixed.
...the error handler simply outputs a message to a box onscreen describing the error, including both the code and the message.
...And 3 more matches
ServiceWorkerGlobalScope: message event - Web APIs
the message event of the serviceworkerglobalscope interface occurs when incoming messages are received.
... controlled pages can use the serviceworker.postmessage() method to send messages to service workers.
... the service worker can optionally send a response back via the client.postmessage(), corresponding to the controlled page.
...And 3 more matches
ServiceWorkerGlobalScope.onmessage - Web APIs
the onmessage property of the serviceworkerglobalscope interface is an event handler fired whenever a message event occurs — when incoming messages are received.
...for the message event, service workers use the extendablemessageevent interface which extends the extendableevent interface.
... note: messages received from service worker contexts (e.g.
...And 3 more matches
nsIMessageWakeupService
content/base/public/nsimessagewakeupservice.idlscriptable implements the message manager wakeup service; this lets other components be woken up when specific message manager messages arrive.
... the parentprocessmessagemanager is used for this, so messages send from childprocessmessagemanagers will be heard.
...to indicate a wakeup request in a manifest file, add a line that looks something like this: category wakeup-request nscomponent @mozilla.org/myservice;1,nsimyinterface,getservice,mymessage1,mymessage2[,..] the category entry value consists of a comma separate string that contains: the contract id for your component (e.g.
...And 2 more matches
BroadcastChannel: message event - Web APIs
the message event is fired on a broadcastchannel object when a message arrives on that channel.
... bubbles no cancelable no interface messageevent event handler property onmessage examples live example in this example there's a "sender" <iframe> that broadcasts the contents of a <textarea> when the user clicks a button.
... there are two "receiver" iframes that listen to the broadcast message and write the result into a <div> element.
...And 2 more matches
ExtendableMessageEvent() - Web APIs
the extendablemessageevent() constructor creates a new extendablemessageevent object instance.
... syntax var extendablemessageevent = new extendablemessageevent(type, init); parameters type a domstring that defines the type of the message event being created.
... source: the client, serviceworker or messageport that sent the message.
...And 2 more matches
MIDIMessageEvent - Web APIs
the midimessageevent interface of the web midi api represents the event passed to the onmidimessage event handler of the midiinput interface.
... a midimessage event is fired every time a midi message is sent from a device represented by a midiinput, for example when a midi keyboard key is pressed, a knob is tweaked, or a slider is moved.
... constructor midimessageevent.midimessageevent creates a new midimessageevent object instance.
...And 2 more matches
MediaKeyMessageEvent() - Web APIs
the mediakeymessageevent constructor creates a new mediakeymessageevent object which creates a new instance of mediakeymessageevent.
... syntax var mediakeymessageevent = new mediakeymessageevent(typearg, options) parameters typearg a domstring containing one of may be one of license-request, license-renewal, license-renewal, or individualization-request.
... options options are as follows: messagetype: a developer-defined message type that allows applications to differentiate messages without parsing them.
...And 2 more matches
MessageEvent.ports - Web APIs
the ports read-only property of the messageevent interface is an array of messageport objects representing the ports associated with the channel the message is being sent through (where appropriate, e.g.
... in channel messaging or when sending a message to a shared worker).
... syntax var myports = messageevent.ports; value an array of messageport objects.
...And 2 more matches
RTCDataChannel: message event - Web APIs
the webrtc message event is sent to the onmessage event handler on an rtcdatachannel object when a message has been received from the remote peer.
... bubbles no cancelable no interface messageevent event handler property onmessage note: the message event uses as its event object type the messageevent interface defined by the html specification.
... examples for a given rtcdatachannel, dc, created for a peer connection using its createdatachannel() method, this code sets up a handler for incoming messages and acts on them by adding the data contained within the message to the current document as a new <p> (paragraph) element.
...And 2 more matches
ServiceWorkerContainer.onmessage - Web APIs
the onmessage property of the serviceworkercontainer interface is an event handler fired whenever a message event occurs — when incoming messages are received to the serviceworkercontainer object (e.g., via a client.postmessage() call).
... note: messages received from service worker contexts (e.g.
... as the event object of onmessage) are represented by messageevent objects in modern browsers, for consistency with other web messaging features.
...And 2 more matches
ServiceWorkerMessageEvent.data - Web APIs
service worker messages will now use the messageevent interface, for consistency with other web messaging features.
... the data read-only property of the serviceworkermessageevent interface returns the event's data.
... syntax var mydata = serviceworkermessageeventinstance.data; value any data type.
...And 2 more matches
ServiceWorkerMessageEvent.lastEventId - Web APIs
service worker messages will now use the messageevent interface, for consistency with other web messaging features.
... the lasteventid read-only property of the serviceworkermessageevent interface represents, in server-sent events, the last event id of the event source.
... syntax var mylasteventid = serviceworkermessageeventinstance.lasteventid; value a domstring.
...And 2 more matches
ServiceWorkerMessageEvent.origin - Web APIs
service worker messages will now use the messageevent interface, for consistency with other web messaging features.
... the origin read-only property of the serviceworkermessageevent interface returns the origin of the service worker's environment settings object.
... syntax var myorigin = serviceworkermessageeventinstance.origin; value a domstring.
...And 2 more matches
ServiceWorkerMessageEvent.ports - Web APIs
service worker messages will now use the messageevent interface, for consistency with other web messaging features.
... the ports read-only property of the serviceworkermessageevent interface returns an array of messageport objects connected with the message channel the message is being sent through.
... syntax var myports = serviceworkermessageeventinstance.ports; value an array of messageport objects.
...And 2 more matches
ServiceWorkerMessageEvent.source - Web APIs
service worker messages will now use the messageevent interface, for consistency with other web messaging features.
... the source read-only property of the serviceworkermessageevent returns a reference to the serviceworker object of the associated service worker that sent the message.
... syntax var mysource = serviceworkermessageeventinstance.source; value a serviceworker or messageport object.
...And 2 more matches
Error.prototype.message - JavaScript
the message property is a human-readable description of the error.
...spidermonkey makes extensive use of the message property for exceptions.
... the message property combined with the name property is used by the error.prototype.tostring() method to create a string representation of the error.
...And 2 more matches
Message Summary Database - Archive of obsolete content
the mail summary files (.msf) are used to store summary information about messages and threads in a folder, and some meta information about the folder.
...message headers the message header object implements the nsimsgdbhdr interface.
... this includes a set of per-message flags, the more commonly used headers (e.g., subject, sender, from, to, cc, date, etc), and a few other attributes, e.g., keywords.
...so the db knows which messages are in a thread, which message a message is in reply to, etc.
nsIConsoleMessage
xpcom/base/nsiconsolemessage.idlscriptable this interface is a base interface for messages passed to or from the nsiconsoleservice.
... inherits from: nsisupports last changed in gecko 1.7 implementations may provide an object that can be query interfaced, nsisupports.queryinterface(), to provide more specific message information.
...attributes attribute type description message wstring the message in a string format.
... [binaryname(messagemoz)] read only.
nsIWorkerMessageEvent
1.0 66 introduced gecko 1.9.1 inherits from: nsidomevent last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void initmessageevent(in domstring atypearg, in boolean acanbubblearg, in boolean acancelablearg, in domstring adataarg, in domstring aoriginarg, in nsisupports asourcearg); attributes attribute type description data domstring the event's data.
... methods initmessageevent() initializes the message event.
... void initmessageevent( in domstring atypearg, in boolean acanbubblearg, in boolean acancelablearg, in domstring adataarg, in domstring aoriginarg, in nsisupports asourcearg ); parameters atypearg the event type.
... see also using web workers nsiworkermessageport nsiworkerglobalscope nsiworkerscope nsiabstractworker nsiworker ...
nsIWorkerMessagePort
dom/interfaces/threads/nsidomworkers.idlscriptable this interface represents a worker thread's message port, which is used to allow the worker to post messages back to its creator.
... 1.0 66 introduced gecko 1.9.1 inherits from: nsisupports last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) method overview void postmessage(in domstring amessage); methods postmessage() posts a message into the event queue.
... void postmessage( in domstring amessage ); parameters amessage the message to post.
... see also using web workers nsiworkermessageevent nsiworkerglobalscope nsiworkerscope nsiabstractworker nsiworker ...
DOMException.message - Web APIs
the message read-only property of the domexception interface returns a domstring representing a message or description associated with the given error name.
... syntax var domexceptionmessage = domexceptioninstance.message; value a domstring.
... specifications specification status comment web idlthe definition of 'message' in that specification.
... desktopmobilechromeedgefirefoxinternet exploreroperasafariandroid webviewchrome for androidfirefox for androidopera for androidsafari on iossamsung internetmessagechrome full support yesedge full support 12firefox full support 1ie ?
EventSource.onmessage - Web APIs
the onmessage property of the eventsource interface is an eventhandler called when a message event is received, that is when a message is coming from the source.
... event objects of onmessage event handers are of type messageevent.
... syntax eventsource.onmessage = function examples evtsource.onmessage = function(e) { var newelement = document.createelement("li"); newelement.textcontent = "message: " + e.data; eventlist.appendchild(newelement); } note: you can find a full example on github — see simple sse demo using php.
... specifications specification status comment html living standardthe definition of 'onmessage' in that specification.
ExtendableMessageEvent.data - Web APIs
the data read-only property of the extendablemessageevent interface returns the event's data.
... syntax var mydata = extendablemessageevent.data; value any data type.
... examples when the following code is used inside a service worker to respond to a push messages by sending the data received via pushmessagedata to the main context via a channel message, the event object of onmessage will be a extendablemessageevent.
... var port; self.addeventlistener('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { console.log(e.data); port = e.ports[0]; } specifications specification status comment service workersthe definition of 'extendablemessageevent.data' in that specification.
ExtendableMessageEvent.lastEventId - Web APIs
the lasteventid read-only property of the extendablemessageevent interface represents, in server-sent events, the last event id of the event source.
... syntax var mylasteventid = extendablemessageevent.lasteventid; value a domstring.
... examples when the following code is used inside a service worker to respond to a push messages by sending the data received via pushmessagedata to the main context via a channel message, the event object of onmessage will be a extendablemessageevent.
... var port; self.addeventlistener('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { console.log(e.lasteventid); port = e.ports[0]; } specifications specification status comment service workersthe definition of 'extendablemessageevent.lasteventid' in that specification.
ExtendableMessageEvent.origin - Web APIs
the origin read-only property of the extendablemessageevent interface returns the origin of the client that sent the message.
... syntax var myorigin = extendablemessageevent.origin; value a usvstring.
... examples when the following code is used inside a service worker to respond to a push messages by sending the data received via pushmessagedata to the main context via a channel message, the event object of onmessage will be a extendablemessageevent.
... var port; self.addeventlistener('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { console.log(e.origin); port = e.ports[0]; } specifications specification status comment service workersthe definition of 'extendablemessageevent.origin' in that specification.
ExtendableMessageEvent.source - Web APIs
the source read-only property of the extendablemessageevent interface returns a reference to the client object from which the message was sent.
... syntax var mysource = extendablemessageevent.source; value a client, serviceworker or messageport object.
... examples when the following code is used inside a service worker to respond to a push messages by sending the data received via pushmessagedata to the main context via a channel message, the event object of onmessage will be a extendablemessageevent.
... var port; self.addeventlistener('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { console.log(e.source); port = e.ports[0]; } specifications specification status comment service workersthe definition of 'extendablemessageevent.source' in that specification.
MessagePort.close() - Web APIs
WebAPIMessagePortclose
the close() method of the messageport interface disconnects the port, so it is no longer active.
... this stops the flow of messages to that port.
... example in the following code block, you can see a handlemessage handler function, run when a message is sent back to this document using eventtarget.addeventlistener.
... 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.
NDEFMessage - Web APIs
the ndefmessage interface of the web nfc api is an abstract interface that represents message that can be received or sent to a to compatible nfc devices, e.g.
... constructor ndefmessage.ndefmessage() returns a new ndefmessage containing specified data.
... attributes ndefmessage.records read only represents a list of ndef records defining the ndef message.
... specifications specification status comment web nfc, ndefmessage draft initial definition.
SpeechRecognitionError.message - Web APIs
the message read-only property of the speechrecognitionerror interface returns a message describing the error in more detail.
... syntax var myerrormsg = event.message; value a domstring containing more details about the error that was raised.
... note that the spec does not define the exact wording of these messages — this is up to the implementors to decide upon.
... examples var recognition = new speechrecognition(); recognition.onerror = function(event) { console.log('speech recognition error detected: ' + event.error); console.log('additional information: ' + event.message); } ...
SpeechRecognitionErrorEvent.message - Web APIs
the message read-only property of the speechrecognitionerrorevent interface returns a message describing the error in more detail.
... syntax var myerrormsg = event.message; value a domstring containing more details about the error that was raised.
... note that the spec does not define the exact wording of these messages — this is up to the implementors to decide upon.
... examples var recognition = new speechrecognition(); recognition.onerror = function(event) { console.log('speech recognition error detected: ' + event.error); console.log('additional information: ' + event.message); } specifications specification status comment web speech apithe definition of 'message' in that specification.
WebSocket.onmessage - Web APIs
the websocket.onmessage property is an eventhandler that is called when a message is received from the server.
... it is called with a messageevent.
... syntax awebsocket.onmessage = function(event) { console.debug("websocket message received:", event); }; value an eventlistener.
... specifications specification status comment html living standardthe definition of 'websocket: onmessage' in that specification.
WindowEventHandlers.onmessage - Web APIs
the onmessage property of the windoweventhandlers mixin is the eventhandler called whenever an object receives a message event.
... syntax window.addeventlistener('message', function(event) { ...
... }) window.onmessage = function(event) { ...
... } specifications specification status comment html living standardthe definition of 'onmessage' in that specification.
Message manager
message managers provide a way for chrome-privileged javascript code to communicate across process boundaries.
... these guides explain how to use message managers in multiprocess firefox.
... guides message manager overview frame script loading and lifetime communicating with frame scripts performance best practices frame script environment limitations of frame scripts process scripts api reference nsiframescriptloader nsimessagelistenermanager nsimessagebroadcaster nsimessagesender nsisyncmessagesender nsicontentframemessagemanager nsiprocessscriptloader ...
nsIChromeFrameMessageManager
content/base/public/nsimessagemanager.idlscriptable handles loading of content in a remote chrome frame.
... 1.0 66 introduced gecko 2.0 inherits from: nsiframemessagemanager last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void loadframescript(in astring aurl, in boolean aallowdelayedload); void removedelayedframescript(in astring aurl); methods loadframescript() loads a script into the remote frame.
... see also content process event handling nsicontentframemessagemanager nsiframeloader nsiframemessagelistener ...
nsIInProcessContentFrameMessageManager
content/base/public/nsiframemessagemanager.idlnot scriptable ???
... 1.0 66 introduced gecko 2.0 inherits from: nsicontentframemessagemanager last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview nsicontent getownercontent(); violates the xpcom interface guidelines methods violates the xpcom interface guidelines getownercontent() nsicontent getownercontent(); parameters none.
...see also content process event handling nsicontentframemessagemanager ...
DB Views (message lists)
the thread pane (aka message list) is driven by classes that implement nsimsgdbview and inherit from nsmsgdbview.
... these are the main view classes: nsmsgthreadeddbview - (implementation) nsmsgsearchdbview - (implementation) nsmsgquicksearchdbview - (implementation) nsmsgxfvirtualfolderdbview - (implementation) nsmsggroupview - (implementation) usually, a view object has parallel arrays, which map directly to lines in the message list: m_keys message header key m_flags 32 bits, combination of message header flags and view-only flags (e.g., collapsed) m_level the indentation level when in threaded mode.
...one unique thing about nsmsggroupview is that instead of using the message database's nsmsgthread objects like the other view classes, it uses an nsmsggroupthread object, which also implements nsimsgthread.
Message Interfaces
nsimsghdr nsimsghdr - this interface describes headers for all mail messages.
... it can be used to retrieve address, subject and related header information for a mail message.
... nsimsgdbhdr nsimsgdbhdr - this interface describes headers for mail messages.
BroadcastChannel.onmessageerror - Web APIs
the onmessageerror event handler of the broadcastchannel interface is an eventlistener, called whenever an messageevent of type messageerror is fired on the broadcastchannel instance — that is, when it receives a message that cannot be deserialized.
... syntax bc.onmessageerror = function() { ...
... }; specifications specification status comment html living standardthe definition of 'onmessageerror' in that specification.
BroadcastChannel.postMessage() - Web APIs
the broadcastchannel.postmessage() sends a message, which can be of any kind of object, to each listener in any browsing context with the same origin.
... the message is transmitted as a message event targeted at each broadcastchannel bound to the channel.
... syntax var str = channel.postmessage(object); specifications specification status comment html living standardthe definition of 'broadcastchannel.postmessage()' in that specification.
DedicatedWorkerGlobalScope: message event - Web APIs
the message event is fired on a dedicatedworkerglobalscope object when the worker receives a message from its parent (i.e.
... when the parent sends a message using worker.postmessage()).
... bubbles no cancelable no interface messageevent event handler property onmessage examples this code creates a new worker and sends it a message using worker.postmessage(): const worker = new worker("static/scripts/worker.js"); worker.addeventlistener('message', (event) => { console.log(`received message from worker: ${event.data}`) }); the worker can listen for this message using addeventlistener(): // inside static/scripts/worker.js self.addeventlistener('message', (event) => { console.log(`received message from parent: ${event.data}`); }); alternatively, it could listen using the onmessage event handler property: // static/scripts/worker.js self.onmessage = (event) => { console.log(`received message from parent: ${e...
DedicatedWorkerGlobalScope.onmessageerror - Web APIs
the onmessageerror event handler of the dedicatedworkerglobalscope interface is an eventlistener, called whenever an messageevent of type messageerror is fired on the worker—that is, when it receives a message that cannot be deserialized.
... syntax onmessageerror = function() { ...
... }; specifications specification status comment html living standardthe definition of 'onmessageerror' in that specification.
EventSource: message event - Web APIs
the message event of the eventsource api is fired when data is received through an event source.
... bubbles no cancelable no interface messageevent event handler property eventsource.onmessage examples in this basic example, an eventsource is created to receive events from the server; a page with the name sse.php is responsible for generating the events.
... var evtsource = new eventsource('sse.php'); var eventlist = document.queryselector('ul'); evtsource.addeventlistener('message', (e) => { var newelement = document.createelement("li"); newelement.textcontent = "message: " + e.data; eventlist.appendchild(newelement); }); onmessage equivalent evtsource.onmessage = (e) => { var newelement = document.createelement("li"); newelement.textcontent = "message: " + e.data; eventlist.appendchild(newelement); }; specifications specification status html living standardthe definition of 'message event' in that specification.
ExtendableMessageEvent.ports - Web APIs
the ports read-only property of the extendablemessageevent interface returns the array containing the messageport objects representing the ports of the associated message channel (the channel the message is being sent through.) syntax var myports = extendablemessageevent.ports; value an array of messageport objects.
... examples when the following code is used inside a service worker to respond to a push messages by sending the data received via pushmessagedata to the main context via a channel message, the event object of onmessage will be a extendablemessageevent.
... var port; self.addeventlistener('push', function(e) { var obj = e.data.json(); if(obj.action === 'subscribe' || obj.action === 'unsubscribe') { port.postmessage(obj); } else if(obj.action === 'init' || obj.action === 'chatmsg') { port.postmessage(obj); } }); self.onmessage = function(e) { port = e.ports[0]; } specifications specification status comment service workersthe definition of 'extendablemessageevent.ports' in that specification.
GeolocationPositionError.message - Web APIs
the geolocationpositionerror.message read-only property returns a human-readable domstring describing the details of the error.
... syntax let msg = geolocationpositionerrorinstance.message value a human-readable domstring describing the details of the error.
... specifications specification status comment geolocation apithe definition of 'geolocationpositionerror.message' in that specification.
HTMLObjectElement.validationMessage - Web APIs
the validationmessage read-only property of the htmlobjectelement interface returns a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any).
... syntax var string = htmlobjectelement.validationmessage; value a domstring.
... specifications specification status comment html living standardthe definition of 'validationmessage' in that specification.
message - Web APIs
the mediakeymessageevent.message read-only property returns an arraybuffer with a message from the content decryption module.
... messages vary by key system.
... syntax var messagetype = mediakeymessageevent.messagetype; specifications specification status comment encrypted media extensionsthe definition of 'message' in that specification.
MediaKeySession.onmessage - Web APIs
the onmessage property of the mediakeysession is an event handler, fired whenever a mediakeymessageevent occurs, denoting a message is generated by the content decryption module.
...ssion" target="_top"><rect x="151" y="1" width="150" height="50" fill="#f4f7f8" stroke="#d4dde4" stroke-width="2px" /><text x="226" y="30" font-size="12px" font-family="consolas,monaco,andale mono,monospace" fill="#4d4e53" text-anchor="middle" alignment-baseline="middle">mediakeysession</text></a></svg></div> a:hover text { fill: #0095dd; pointer-events: all;} syntax mediakeysession.onmessage = function(mediakeymessageevent) { ...
... } specifications specification status comment encrypted media extensionsthe definition of 'onmessage' in that specification.
MessageEvent.data - Web APIs
WebAPIMessageEventdata
the data read-only property of the messageevent interface represents the data sent by the message emitter.
... syntax var data = messageevent.data; value the data sent by the message emitter; this can be any data type.
... example myworker.onmessage = function(e) { result.textcontent = e.data; console.log('message received from worker'); }; specifications specification status comment html living standardthe definition of 'messageevent: data' in that specification.
MessageEvent.lastEventId - Web APIs
the lasteventid read-only property of the messageevent interface is a domstring representing a unique id for the event.
... syntax var myid = messageevent.lasteventid; value a domstring representing the id.
... example myworker.onmessage = function(e) { result.textcontent = e.data; console.log('message received from worker'); console.log(e.lasteventid); }; specifications specification status comment html living standardthe definition of 'messageevent: lasteventid' in that specification.
MessageEvent.origin - Web APIs
the origin read-only property of the messageevent interface is a usvstring representing the origin of the message emitter.
... syntax var origin = messageevent.origin; value a usvstring representing the origin.
... example myworker.onmessage = function(e) { result.textcontent = e.data; console.log('message received from worker'); console.log(e.origin); }; specifications specification status comment html living standardthe definition of 'messageevent: origin' in that specification.
MessageEvent.source - Web APIs
the source read-only property of the messageevent interface is a messageeventsource (which can be a windowproxy, messageport, or serviceworker object) representing the message emitter.
... syntax let mysource = messageevent.source; value a messageeventsource (which can be a windowproxy, messageport, or serviceworker object) representing the message emitter.
... example myworker.onmessage = function(e) { result.textcontent = e.data; console.log('message received from worker'); console.log(e.source); }; specifications specification status comment html living standardthe definition of ' messageevent: source' in that specification.
MessagePort.start() - Web APIs
WebAPIMessagePortstart
the start() method of the messageport interface starts the sending of messages queued on the port.
... this method is only needed when using eventtarget.addeventlistener; it is implied when using messagechannel.onmessage.
... 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 sta...
NDEFMessage.records - Web APIs
the records property of ndefmessage interface represents a list of ndefrecords defining the ndef message.
... syntax var recordlist = ndefmessage.records; value a list of ndefrecord object that represent data recorded in the message.
... specifications specification status comment web nfc, dnefmessage.records draft initial definition.
OverconstrainedError.message - Web APIs
the message read-only property of the overconstrainederror interface returns the text supplied in the constructor.
... syntax var message = overconstrainederror.message; value a domstring.
... specifications specification status comment media capture and streamsthe definition of 'message' in that specification.
ServiceWorkerContainer: message event - Web APIs
the message event is used in a page controlled by a service worker to receive messages from the service worker.
... bubbles no cancelable no interface messageevent event handler property onmessage examples in this example the service worker get the client's id from a fetch event and then sends it a message using client.postmessage: // in the service worker async function messageclient(clientid) { const client = await clients.get(clientid); client.postmessage('hi client!'); } addeventlistener('fetch', (event) => { messageclient(event.clientid); event.respondwith(() => { // ...
... }); }); the client can receive the message by listening to the message event: // in the page being controlled navigator.serviceworker.addeventlistener('message', (message) => { console.log(message); }); specifications specification status service workersthe definition of 'message' in that specification.
WebGLContextEvent.statusMessage - Web APIs
the read-only webglcontextevent.statusmessage property contains additional event status information, or is an empty string if no additional information is available.
... examples the statusmessage property can contain a platform dependent string with details of an event.
... var canvas = document.getelementbyid('canvas'); var gl = canvas.getcontext('webgl'); canvas.addeventlistener('webglcontextcreationerror', function(e) { console.log('webgl context creation failed:' + e.statusmessage || 'unknown error'); }, false); specifications specification status comment webgl 1.0the definition of 'webglcontextevent.statusmessage' in that specification.
WebSocket: message event - Web APIs
the message event is fired when data is received through a websocket.
... bubbles no cancelable no interface messageevent event handler property onmessage examples // create websocket connection.
... const socket = new websocket('ws://localhost:8080'); // listen for messages socket.addeventlistener('message', function (event) { console.log('message from server ', event.data); }); specifications specification status html living standardthe definition of 'websocket message' in that specification.
Window: message event - Web APIs
the message event is fired on a window object when the window receives a message, for example from a call to window.postmessage() from another browsing context.
... bubbles no cancelable no interface messageevent event handler property onmessage examples suppose a script sends a message to a different browsing context, such as another <iframe>, using code like this: const targetframe = window.top.frames[1]; const targetorigin = 'https://example.org'; const windowmessagebutton = document.queryselector('#window-message'); windowmessagebutton.addeventlistener('click', () => { targetframe.postmessage('hello there', targetorigin); }); the receiver can listen for the message using addeventlistener() with code like this: window.addeventlistener('message', (event) => { console.log(`received message: ${event.data}`); }); alternatively the listener could use the onmessage event handler property: w...
...indow.onmessage = (event) => { console.log(`received message: ${event.data}`); }; specifications specification status html living standard living standard ...
WindowEventHandlers.onmessageerror - Web APIs
the onmessageerror event handler of the windoweventhandlers interface is an eventlistener, called whenever an messageevent of type messageerror is fired on a window—that is, when it receives a message that cannot be deserialized.
... syntax window.onmessageerror = function() { ...
... }; specifications specification status comment html living standardthe definition of 'onmessageerror' in that specification.
Worker: message event - Web APIs
the message event is fired on a worker object when the worker's parent receives a message from its worker (i.e.
... when the worker sends a message using dedicatedworkerglobalscope.postmessage()).
... bubbles no cancelable no interface messageevent event handler property onmessage examples this code creates a new worker and listens to messages from it using addeventlistener(): const worker = new worker("static/scripts/worker.js"); worker.addeventlistener('message', (event) => { console.log(`received message from worker: ${event.data}`) }); alternatively, it could listen using the onmessage event handler property: const worker = new worker("static/scripts/worker.js"); worker.onmessage = (event) => { console.log(`received message from worker: ${event.data}`) }; the worker posts messages using self.postmessage(): // static/scripts/worker.js self.postmessage('i\'m alive!'); specifications specification status ...
Worker: messageerror event - Web APIs
the messageerror event is fired on a worker object when it receives a message that can't be deserialized.
... bubbles no cancelable no interface messageevent event handler property onmessageerror examples create a worker, and listen for message and messageerror events using addeventlistener(): // inside main.js const worker = new worker("static/scripts/worker.js"); worker.addeventlistener("message", (event) => { console.error(`received message from worker: ${event}`); }); worker.addeventlistener("messageerror", (event) => { console.error(`error receiving message from worker: ${event}`); }); the same, but using the onmessageerror event handler property: // inside main.js const worker = new worker("static/scripts/worker.js"); worker.onmessage = (event) => { console.error(`received message from worker: ${event}`); }; worker.onmes...
...sageerror = (event) => { console.error(`error receiving message from worker: ${event}`); }; specifications specification status html living standard living standard ...
Worker.onmessageerror - Web APIs
the onmessageerror event handler of the worker interface is an eventlistener, called whenever an messageevent of type messageerror is fired on the worker instance — that is, when it receives a message that cannot be deserialized.
... syntax worker.onmessageerror = function() { ...
... }; specifications specification status comment html living standardthe definition of 'onmessageerror' in that specification.
<xsl:message> - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElementmessage
xslt/xpath reference: xslt elements, exslt functions, xpath functions, xpath axes the <xsl:message> element outputs a message (to the javascript console in ns) and optionally terminates execution of the stylesheet.
... syntax <xsl:message terminate="yes" | "no" > template </xsl:message> required attributes none.
...the default value is "no", in which case the message is output and execution continues.
BroadcastChannel: messageerror event - Web APIs
the messageerror event is fired on a broadcastchannel object when a message arrives on the channel that can't be deserialized.
... bubbles no cancelable no interface messageevent event handler property onmessageerror examples this code uses addeventlistener to listen for messages and errors: const channel = new broadcastchannel('example-channel'); channel.addeventlistener('message', (event) => { received.textcontent = event.data; }); channel.addeventlistener('messageerror', (event) => { console.error(event); }); the same, but using the onmessage and onmessageerror event handler properties: const channel = new broadcastchannel('example-channel'); channel.onmessage = (event) => { received.textcontent = event.data; }; channel.onmessageerror = (event) => { console.log(event); }; specifications specification status html living standar...
DedicatedWorkerGlobalScope: messageerror event - Web APIs
the messageerror event is fired on a dedicatedworkerglobalscope object when it receives a message that can't be deserialized.
... bubbles no cancelable no interface messageevent event handler property onmessageerror examples listen for messageerror using addeventlistener(): // inside worker.js self.addeventlistener('messageerror', (event) => { self.postmessage('error receiving message'); console.error(event); }); the same, but using the onmessageerror event handler property: // inside worker.js self.onmessageerror = (event) => { self.postmessage('error receiving message'); console.error(event); }; specifications specification status html living standard living standard ...
Window: messageerror event - Web APIs
the messageerror event is fired on a window object when it receives a message that can't be deserialized.
... bubbles no cancelable no interface messageevent event handler property onmessageerror examples listen for messageerror using addeventlistener(): window.addeventlistener('messageerror', (event) => { console.error(event); }); the same, but using the onmessageerror event handler property: window.onmessageerror = (event) => { console.error(event); }; specifications specification status html living standard living standard ...
message-icon - Archive of obsolete content
« xul reference home message-icon class that adds a message box icon.
PushMessageData.arrayBuffer() - Web APIs
the arraybuffer()method of the pushmessagedata interface extracts push message data as an arraybuffer object.
PushMessageData.blob() - Web APIs
the blob()method of the pushmessagedata interface extracts push message data as a blob object.
PushMessageData.json() - Web APIs
the json()method of the pushmessagedata interface extracts push message data by parsing it as a json string and returning the result.
PushMessageData.text() - Web APIs
the text()method of the pushmessagedata interface extracts push message data as a plain text string.
Index - Web APIs
WebAPIIndex
209 audioworkletnode.port api, audioworkletnode, experimental, property, reference, web audio api, port the read-only port property of the audioworkletnode interface returns the associated messageport.
... 214 audioworkletprocessor.port api, audio, audioworkletprocessor, experimental, property, reference, web audio api the read-only port property of the audioworkletprocessor interface returns the associated messageport.
...messages are broadcasted via a message event fired at all broadcastchannel objects listening to the channel.
...And 153 more matches
IPDL Tutorial
ipdl, short for "inter-process-communication protocol definition language", is a mozilla-specific language allowing c++ code to pass messages between processes or threads in an organized and secure way.
... all messages for multi-process plugins and tabs in firefox are declared in the ipdl language.
... all ipdl messages are sent between parent and a child end points, called actors.
...And 63 more matches
AsyncTestUtils extended framework
boilerplate add the following code to the top of your test file to import everything you need: load("../../mailnews/resources/loghelper.js"); load("../../mailnews/resources/asynctestutils.js"); load("../../mailnews/resources/messagegenerator.js"); load("../../mailnews/resources/messagemodifier.js"); load("../../mailnews/resources/messageinjection.js"); if the directory where you are adding the tests does not have a head_*.js file that has the two following lines, add them at the top of your test file (before the lines shown above): load("../../mailnews/resources/maildirservice.js"); load("../../mailnews/resources/mailte...
...stutils.js"); at the bottom of the test file, add the following: var tests =[ // list your tests here ]; function run_test() { configure_message_injection({mode: "local"}); async_run_tests(tests); } asynchronous testing basics why do we need it?
...for example, you would do "yield async_move_messages(...);" and be done with it.
...And 55 more matches
Signaling and video calling - Web APIs
through this third server, the two devices can locate one another, and exchange negotiation messages.
...although it's sdp, even this doesn't matter so much: the content of the message going through the signaling server is, in effect, a black box.
...the server supports several message types to handle tasks, such as registering new users, setting usernames, and sending public chat messages.
...And 49 more matches
nsIMsgDBView
sgviewindex index); nsimsgdbview clonedbview(in nsimessenger amessengerinstance, in nsimsgwindow amsgwindow, in nsimsgdbviewcommandupdater acommandupdater); void geturisforselection([array, size_is(count)] out string uris, out unsigned long count); void getindicesforselection([array, size_is(count)] out nsmsgviewindex indices, out unsigned long count); void loadmessagebymsgkey(in nsmsgkey amsgkey); void loadmessagebyviewindex(in nsmsgviewindex aindex); void loadmessagebyurl(in string aurl); void reloadmessage(); void reloadmessagewithallparts(); void selectmsgbykey(in nsmsgkey key); void selectfoldermsgbykey(in nsimsgfolder afolder, in nsmsgkey akey); void ondeletecompleted(in boolean succeeded); ...
... keyforfirstselectedmessage nsmsgkey readonly: the key of the first message in the current selection.
... viewindexforfirstselectedmsg nsmsgviewindex readonly: the index of the first selected message.
...And 47 more matches
Mail composition back end
pizzarro <rhp@netscape.com> contents overview sending messages nsimsgsend sending listener interfaces nsimsgsendlistener nsimsgcopyservicelistener copy operations copy to sent folder drafts templates "send later" sending unsent messages sending unsent messages listener quoting sample programs overview i've done considerable work in the past few weeks reorganizing the mail composition back end, so i thought it would be helpful to put together a small doc on the new interfaces and how one can use them.
... the mail composition back end is responsible for the assembly and creation of rfc822 messages to be delivered either via smtp or nntp services.
...included in this functionality is the code to copy the messages to the appropriate locations after delivery (i.e.
...And 47 more matches
Index
MozillaTechXPCOMIndex
209 mozistorageerror interfaces, storage the mozistorageerror interface represents errors returned by the storage api, offering attributes to obtain the error code as well as a human-readable error message corresponding to the error that occurred.
... 323 nsialertsservice interfaces, interfaces:scriptable, xpcom, xpcom api reference, xpcom interface reference by default a message is displayed in a small window that slides up from the bottom of the screen, holds there for a few seconds, then slides down.
... 390 nsichromeframemessagemanager interfaces, interfaces:scriptable, xpcom, xpcom interface reference loads a script into the remote frame.
...And 45 more matches
nsIMessenger
the nsimessenger interface provides functions for managing the history, undo and redo operations, and for loading, saving, or deleting messages and attachments in mailnews.
...cstring aurl); void loadurl(in nsidomwindow ptr, in acstring aurl); void launchexternalurl(in acstring aurl); boolean canundo(); boolean canredo(); unsigned long getundotransactiontype(); unsigned long getredotransactiontype(); void undo(in nsimsgwindow msgwindow); void redo(in nsimsgwindow msgwindow); void sendunsentmessages(in nsimsgidentity aidentity, in nsimsgwindow amsgwindow); void setdocumentcharset(in acstring characterset); void saveas(in acstring auri, in boolean aasfile, in nsimsgidentity aidentity, in astring amsgfilename); void openattachment(in acstring contenttpe, in acstring url, in acstring displayname, in acstring messageuri, in boolean isexternalattachment); void...
... saveattachment(in acstring contenttpe, in acstring url, in acstring displayname, in acstring messageuri, in boolean isexternalattachment); void saveallattachments(in unsigned long count, [array, size_is(count)] in string contenttypearray, [array, size_is(count)] in string urlarray, [array, size_is(count)] in string displaynamearray, [array, size_is(count)] in string messageuriarray); void saveattachmenttofile(in nsifile afile, in acstring aurl, in acstring amessageuri, in acstring acontenttype, in nsiurllistener alistener); void detachattachment(in string contenttpe, in string url, in string displayname, in string messageuri, in boolean savefirst, [optional] in boolean withoutwarning); void detachallattachments(in unsigned long count, [array, size_is(count)] i...
...And 42 more matches
nsIMsgDBHdr
the nsimsgdbhdr interface describes headers for mail messages.
... inherits from: nsisupports this interface is usually given to you in return to a query from the message database.
...for instance, msghdrforcurrentmessage() will return the currently selected message's header.
...And 42 more matches
ui/frame - Archive of obsolete content
messages logged from a frame script using the console will not appear in the terminal when you run the add-on using jpm run.
... communicating with frames you can exchange messages between the main add-on code and scripts loaded into the frame using an api modeled on window.postmessage().
...so there are three cases to consider: sending messages from a frame script to the main add-on code sending messages from the main add-on code to all instances of a frame, across all browser windows sending messages from the main add-on code to a single instance of a frame, attached to a specific browser window in all cases, postmessage() takes two arguments: the message itself and a targetorigin.
...And 41 more matches
Using Web Workers - Web APIs
once created, a worker can send messages to the javascript code that created it by posting messages to an event handler specified by that code (and vice versa).
... data is sent between workers and the main thread via a system of messages — both sides send their messages using the postmessage() method, and respond to messages via the onmessage event handler (the message is contained within the message event's data attribute.) the data is copied rather than shared.
...all you need to do is call the worker() constructor, specifying the uri of a script to execute in the worker thread (main.js): var myworker = new worker('worker.js'); sending messages to and from a dedicated worker the magic of workers happens via the postmessage() method and the onmessage event handler.
...And 40 more matches
Client-side form validation - Learn web development
you'll get messages such as: "this field is required" (you can't leave this field blank).
... if the information is correctly formatted, the application allows the data to be submitted to the server and (usually) saved in a database; if the information isn't correctly formatted, it gives the user an error message explaining what needs to be corrected, and lets them try again.
... if the user tries to send the data, the browser will block the form and display an error message.
...And 32 more matches
nsIMsgFolder
; void rename(in astring name, in nsimsgwindow msgwindow); void renamesubfolders( in nsimsgwindow msgwindow, in nsimsgfolder oldfolder); astring generateuniquesubfoldername(in astring prefix,in nsimsgfolder otherfolder); void updatesummarytotals(in boolean force); void summarychanged(); long getnumunread(in boolean deep); long gettotalmessages(in boolean deep); void clearnewmessages(); void clearrequirescleanup(); void setflag(in unsigned long flag); void clearflag(in unsigned long flag); boolean getflag(in unsigned long flag); void toggleflag(in unsigned long flag); void onflagchange(in unsigned long flag); void setprefflag(); nsimsgfolder getfolderswith...
...flag(in unsigned long flags, in unsigned long resultsize, out unsigned long numfolders); nsisupportsarray getallfolderswithflag(in unsigned long aflag); void getexpansionarray(in nsisupportsarray expansionarray); acstring geturiformsg(in nsimsgdbhdr msghdr); void deletemessages(in nsisupportsarray messages,in nsimsgwindow msgwindow, in boolean deletestorage, in boolean ismove, in nsimsgcopyservicelistener listener, in boolean allowundo); void copymessages(in nsimsgfolder srcfolder, in nsisupportsarray messages,in boolean ismove, in nsimsgwindow msgwindow,in nsimsgcopyservicelistener listener, in boolean isfolder, in boolean allowundo); void copyfolder(in nsimsgfolder srcfolder, in boolean ismovefolder,in nsimsgwindow msgwindow, in nsimsgcopyse...
...rvicelistener listener ); void copyfilemessage(in nsifile file, in nsimsgdbhdr msgtoreplace,in boolean isdraft, in unsigned long newmsgflags,in nsimsgwindow msgwindow,in nsimsgcopyservicelistener listener); void acquiresemaphore(in nsisupports semholder); void releasesemaphore(in nsisupports semholder); boolean testsemaphore(in nsisupports semholder); void getnewmessages(in nsimsgwindow awindow, in nsiurllistener alistener); void writetofoldercache(in nsimsgfoldercache foldercache, in boolean deep); long getnumnewmessages(in boolean deep); void setnumnewmessages(in long numnewmessages); acstring generatemessageuri(in nsmsgkey msgkey); void addmessagedispositionstate(in nsimsgdbhdr amessage,in nsmsgdispositio...
...And 30 more matches
dev/panel - Archive of obsolete content
when the panel's created, the framework passes it a debuggee: this is a messageport object that you can use to exchange json messages with the browser that the developer tools are currently debugging.
... the messages follow the remote debugging protocol.
...: const { panel } = require("dev/panel"); const { class } = require("sdk/core/heritage"); const mypanel = class({ extends: panel, label: "my panel", tooltip: "my new devtool", icon: "./my-devtool.png", url: "./my-devtool.html", setup: function(options) { // my setup goes here }, dispose: function() { // my teardown goes here }, onready: function() { // i can send messages to // the panel document here } }); alternatively, you can use the extend function: const { extend } = require("sdk/core/heritage"); function mypanel() {}; mypanel.prototype = extend(panel.prototype, { label: "my panel", tooltip: "...", ....
...And 28 more matches
HTTP Index - HTTP
WebHTTPIndex
though often based on a tcp/ip layer, it can be used on any reliable transport layer, that is, a protocol that doesn't lose messages silently like udp does.
...it relies on a few basic concepts like the notion of resources and uris, a simple structure of messages, and a client-server structure for the communication flow.
... 21 cors errors cors, errors, http, https, messages, same-origin, security, console, troubleshooting cross-origin resource sharing (cors) is a standard that allows a server to relax the same-origin policy.
...And 28 more matches
Index - MDN Web Docs Glossary: Definitions of Web-related terms
35 block cipher mode of operation block cipher mode of operation, cryptography, glossary, security a block cipher mode of operation, usually just called a "mode" in context, specifies how a block cipher should be used to encrypt or decrypt messages that are longer than the block size.
...challenge-response protocols are one way to fight against replay attacks where an attacker listens to the previous messages and resends them at a later time to get the same credentials as the original message.
... 76 cipher suite cryptography, glossary, security a cipher suite is a combination of a key exchange algorithm, authentication method, bulk encryption cipher, and message authentication code.
...And 27 more matches
Build your own function - Learn web development
active learning: let's build a function the custom function we are going to build will be called displaymessage().
... it will display a custom message box on a web page and will act as a customized replacement for a browser's built-in alert() function.
...type the following in your browser's javascript console, on any page you like: alert('this is a message'); the alert function takes a single argument — the string that is displayed in the alert box.
...And 25 more matches
nsMsgViewCommandType
for example to mark a message read, you would call: // assuming gdbview is a global nsimsgdbview gdbview.docommand(components.interfaces.nsmsgviewcommandtype.markmessagesread); mailnews/base/public/nsimsgdbview.idlscriptable please add a summary to this article.
... last changed in gecko 1.9 (firefox 3) constants name value description markmessagesread 0 marks the selected messages as read.
... markmessagesunread 1 mark the selected messages as unread togglemessageread 2 toggle the read flag of the selected messages flagmessages 3 flag the selected messages.
...And 24 more matches
Communicating with frame scripts
the api is mostly symmetrical, with one major exception: frame scripts can send asynchronous or synchronous messages to chrome, but chrome can only send asynchronous messages to content.
... content to chrome the frame script can choose to send synchronous or asynchronous messages to chrome code.
... asynchronous messaging to send an asynchronous message the frame script uses the global sendasyncmessage() function: // frame script sendasyncmessage("my-addon@me.org:my-e10s-extension-message"); sendasyncmessage() takes one mandatory parameter, which is the name of the message.
...And 22 more matches
Index
when dealing with certificates (x.509), file formats such as pkcs#12 (certificates and keys), pkcs#7 (signed data), and message formats as cms, we should mention asn.1, which is a syntax for storing structured data in a very efficient (small sized) presentation.
...there are tools for managing nss databases, for dumping or verifying certificates, for registering pkcs#11 modules with a database, for processing cms encrypted/signed messages, etc.
... 174 hashing - sample 1 html, hashing sample, javascript, nss, web development, hashing the nss same code below computes the hash of a file and saves it to another file, this illustrates the use of nss message apis.
...And 22 more matches
Communicating using "port" - Archive of obsolete content
to send messages from one side to the other, use port.emit() to receive messages sent from the other side, use port.on() messages are asynchronous: that is, the sender does not wait for a reply from the recipient but just emits the message and continues processing.
... here's a simple add-on that sends a message to a content script using port: var tabs = require("sdk/tabs"); var alertcontentscript = "self.port.on('alert', function(message) {" + " window.alert(message);" + "})"; tabs.on("ready", function(tab) { worker = tab.attach({ contentscript: alertcontentscript }); worker.port.emit("alert", "message from the add-on"); }); tabs.open("http://www.mozilla.org"); in total, the port object defines four functions: emit(): emit a message.
... on(): listen to a message.
...And 21 more matches
widget - Archive of obsolete content
so implementing a complete solution usually means you have to send messages between the content script and the main add-on code.
... you can communicate with the script using either the postmessage() api or (preferably, usually) the port api.
...but because content scripts can't use the sdk's apis, we'll want the content script to send messages to the main add-on code, which can then implement the media player functions using the sdk.
...And 21 more matches
sslerr.html
ssl_error_bad_mac_read -12273 "ssl received a record with an incorrect message authentication code." this usually indicates that the client and server have failed to come to agreement on the set of keys used to encrypt the application data and to check message integrity.
... ssl_error_bad_mac_alert -12272 "ssl peer reports incorrect message authentication code." the remote system has reported that it received a message with a bad message authentication code from the local system.
...this usually indicates that the client and server have failed to come to agreement on the set of keys used to encrypt the application data and to check message integrity.
...And 20 more matches
Using channel messaging - Web APIs
the channel messaging api allows two separate scripts running in different browsing contexts attached to the same document (e.g., two iframes, or the main document and an iframe, or two documents via a sharedworker) to communicate directly, passing messages between one another through two-way channels (or pipes) with a port at each end.
...you have to think about whether the origins trust one another, and how the messages are passed.
... message channels on the other hand can provide a secure channel that allows you to pass data between different browsing contexts.
...And 20 more matches
Communicating With Other Scripts - Archive of obsolete content
the guide explains how content scripts can communicate with: your main.js file, or any other modules in your add-on other content scripts loaded by your add-on page scripts (that is, scripts embedded in the web page or included using <script> tags) main.js your content scripts can communicate with your add-on's "main.js" (or any other modules you're written for your add-on) by sending it messages, using either the port.emit() api or the postmessage() api.
... see the articles on using postmessage() and using port for details.
... content scripts that have been loaded into the same document by different methods, or the same method called more than once, can pass messages directly to each other using the dom postmessage() api or a customevent.
...And 19 more matches
nsIConsoleService
it is used to log various messages, warnings, and errors and to obtain the logged messages.
... inherits from: nsisupports last changed in gecko 19 (firefox 19 / thunderbird 19 / seamonkey 2.16) implemented by: @mozilla.org/consoleservice;1 as a service: var consoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice); method overview void getmessagearray([array, size_is(count)] out nsiconsolemessage messages, out uint32_t count);obsolete since gecko 19 void getmessagearray([optional] out uint32_t count, [retval, array, size_is(count)] out nsiconsolemessage messages); void logmessage(in nsiconsolemessage message); void logstringmessage(in wstring message); void registerlistener(in nsiconsolelistener listener); void reset(); void unregisterlis...
...tener(in nsiconsolelistener listener); methods getmessagearray() to obtain an array of all logged messages.
...And 19 more matches
panel - Archive of obsolete content
ng" }, onchange: handlechange }); var mypanel = sdkpanels.panel({ contenturl: self.data.url("panel.html"), onhide: handlehide }); function handlechange(state) { if (state.checked) { mypanel.show({ position: button }); } } function handlehide() { button.state('window', {checked: false}); } updating panel content you can update the panel's content by: sending a message to a content script that updates the dom in the same document.
...so implementing a complete solution usually means you have to send messages between the content script and the main add-on code.
... you can communicate with the script using either the postmessage() api or (preferably, usually) the port api.
...And 18 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).
... the tutorial is designed for browser engineers who are implementing dom/web apis that need to, for example, send a message to the os or spin up something off the main thread - so it's biased towards supporting w3c/whatwg dom apis.
... simple message passing.
...And 18 more matches
Assert.jsm
method overview undefined ok(value, message); undefined equal(actual, expected, message); undefined notequal(actual, expected, message); undefined deepequal(actual, expected, message); undefined notdeepequal(actual, expected, message); undefined strictequal(actual, expected, message); undefined notstrictequal(actual, expected, message); undefined throws(block, expected, message...
...); promise rejects(promise, expected, message); undefined greater(lhs, rhs, message); undefined greaterorequal(lhs, rhs, message); undefined less(lhs, rhs, message); undefined lessorequal(lhs, rhs, message); undefined setreporter(reporterfunc); undefined report(failed, actual, expected, message, operator); constructor creates a new assert object.
... this statement is equivalent to assert.equal(true, !!guard, message_opt);.
...And 18 more matches
Index
13 autoconfig: how to create a configuration file autoconfiguration, thunderbird authoritative definition 14 autoconfiguration in thunderbird moved to autoconfiguration 15 buddy icons in mail seth spitzer mozilla is now able to show icons in the message header area and the addressbook card pane.
... for the message pane, the icon we will show is on disk at: <profile home>/nim/<value of pref aim.session.screenname>/picture/<screenname for sender email address>.gif when trying to determine the screenname for the sender, we search the addressbook that we are using for collection.
... any new window performance problems that mozilla has are especially painful in mail compose, as we need to create a new compose window on every new mail message or reply.
...And 18 more matches
context-menu - Archive of obsolete content
to communicate to the menu item associated with the content script, the content script can call the postmessage function attached to the global self object, passing it some json-able data.
... the menu item's "message" event listener will be called with that data.
... var cm = require("sdk/context-menu"); cm.item({ label: "edit image", context: cm.selectorcontext("img"), contentscript: 'self.on("click", function (node, data) {' + ' self.postmessage(node.src);' + '});', onmessage: function (imgsrc) { openimageeditor(imgsrc); } }); updating a menu item's label each menu item must be created with a label, but you can change its label later using a couple of methods.
...And 17 more matches
test/assert - Archive of obsolete content
methods ok(guard, message) tests whether an expression evaluates to true.
... message : string optional message to log, providing extra information about the test.
... equal(actual, expected, message) tests shallow, coercive equality with ==: assert.equal(1, 1, "test that one is one"); parameters actual : object the actual result.
...And 17 more matches
Introduction to SSL - Archive of obsolete content
the ssl handshake protocol involves using the ssl record protocol to exchange a series of messages between an ssl-enabled server and an ssl-enabled client when they first establish an ssl connection.
... this exchange of messages is designed to facilitate the following actions: authenticate the server to the client.
...to ensure that red hat console can control an ssl-enabled server, the server must enable at least one of the following cipher suites for ssl 3.0: rc4 with 128-bit encryption and md5 message authentication rc4 with 40-bit encryption and md5 message authentication rc2 with 40-bit encryption and md5 message authentication no encryption, md5 message authentication only cipher suites with rsa key exchange table 1 lists the cipher suites supported by ssl that use the rsa key-exchange algorithm.
...And 17 more matches
Concurrency model and the event loop - JavaScript
queue a javascript runtime uses a message queue, which is a list of messages to be processed.
... each message has an associated function which gets called in order to handle the message.
... at some point during the event loop, the runtime starts handling the messages on the queue, starting with the oldest one.
...And 17 more matches
Interacting with page scripts - Archive of obsolete content
this guide describes: how to share objects between content scripts and page scripts how to send messages between content scripts and page scripts sharing objects with page scripts there are two possible cases here: a content script might want to access an object defined by a page script a content script might want to expose an object to a page script access objects defined by page scripts to access page script objects from content scripts, you can use the global unsafewindow object.
...clicking "i will not work" fails, and the following message is logged: permission denied to access property 'greeting' expose functions to page scripts the structured clone algorithm is a bit more powerful than simple json serialization, but not much: in particular, functions aren't cloned.
... communicating with page scripts there are two different ways a content script can communicate with a page script: using the dom postmessage() api using custom dom events using the dom postmessage api note that before firefox 31 code in content scripts can't use window to access postmessage() and addeventlistener() and instead must use document.defaultview.
...And 16 more matches
Mail event system
for example, when a folder gets a new message, its total message count increases.
... the folder pane needs to know that this changed so that it can update the message count so the user can see it.
... sample control flow here is an example of a possible flow of control when a new message is added to a folder.
...And 16 more matches
Drawing and Event Handling - Plugins
a windowless plug-in draws itself only in response to a paint message from the browser.
...(the drawable is provided in the paint message.
... browser-side methods, called by the plug-in: npn_forceredraw: force a paint message to a windowless plug-in.
...And 16 more matches
Web Console remoting - Firefox Developer Tools
these can be: page errors, window.console api messages, network activity, and file activity.
...when navigation stops the following packet is sent: { "from": tabactor, "type": "tabnavigated", "state": "stop", "url": newurl, "title": newtitle, "nativeconsoleapi": true|false } getcachedmessages(types, onresponse) the webconsoleclient.getcachedmessages(types, onresponse) method sends the following packet to the server: { "to": "conn0.console9", "type": "getcachedmessages", "messagetypes": [ "pageerror", "consoleapi" ] } the getcachedmessages packet allows one to retrieve the cached messages from before the web console was open.
... you can only get cached messages for page errors and console api calls.
...And 16 more matches
Using server-sent events - Web APIs
for example, assuming the client script is on example.com: const evtsource = new eventsource("//api.example.com/ssedemo.php", { withcredentials: true } ); once you've instantiated your event source, you can begin listening for messages from the server by attaching a handler for the message event: evtsource.onmessage = function(event) { const newelement = document.createelement("li"); const eventlist = document.getelementbyid("list"); newelement.innerhtml = "message: " + event.data; eventlist.appendchild(newelement); } this code listens for incoming messages (that is, notices from the server that do not have an even...
...t field on them) and appends the message text to a list in the document's html.
... you can also listen for events with addeventlistener(): evtsource.addeventlistener("ping", function(event) { const newelement = document.createelement("li"); const time = json.parse(event.data).time; newelement.innerhtml = "ping at " + time; eventlist.appendchild(newelement); }); this code is similar, except that it will be called automatically whenever the server sends a message with the event field set to "ping"; it then parses the json in the data field and outputs that information.
...And 16 more matches
Establishing a connection: The WebRTC perfect negotiation pattern - Web APIs
however, despite that flexibility in transport and communication of signaling messages, there's still a recommended design pattern you should follow when possible, known as perfect negotiation.
... handling incoming messages on the signaling channel the last piece of the puzzle is code to handle incoming messages from the signaling server.
... that's implemented here as an onmessage event handler on the signaling channel object.
...And 16 more matches
Writing a WebSocket server in C# - Web APIs
networkstream methods: write(byte[] buffer, int offset, int size) writes bytes from buffer, offset and size determine length of message.
...offset and size determine the length of the message.
...note that this will block until the first 3 bytes of a message are available.
...And 16 more matches
Writing WebSocket servers - Web APIs
as usual, it may also give the reason why the handshake failed in the http response body, but the message may never be displayed (browsers do not display it).
... exchanging data frames either the client or the server can choose to send a message at any time — that's the magic of websockets.
... | +---------------------------------------------------------------+ the mask bit tells whether the message is encoded.
...And 16 more matches
An overview of HTTP - HTTP
WebHTTPOverview
clients and servers communicate by exchanging individual messages (as opposed to a stream of data).
... the messages sent by the client, usually a web browser, are called requests and the messages sent by the server as an answer are called responses.
...it is never the server (though some mechanisms have been added over the years to simulate server-initiated messages).
...And 16 more matches
Graceful asynchronous programming with Promises - Learn web development
the code that the video chat application would use might look something like this: function handlecallbutton(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.
...this uses setstatusmessage() to update the status box to indicate that an error occurred.
...And 15 more matches
nsIDBChangeListener
there are a couple of ways to access the message database: if you have a nsimsgfolder, you can do this like so: somefolder.msgdatabase.addlistener(mylistener); alternately, you can access the message database through the nsimsgdbview like so: gfolderdisplay.view.dbview.db.addlistener(mylistener); method overview void onhdrflagschanged(in nsimsgdbhdr ahdrchanged, in unsigned long aoldflags, in unsigned long anewflags, in nsidbc...
...ed(in nsidbchangelistener ainstigator); void onjunkscorechanged(in nsidbchangelistener ainstigator); void onhdrpropertychanged(in nsimsgdbhdr ahdrtochange, in unsigned long aoldflags, in prbool aprechange, inout pruint32 astatus, in nsidbchangelistener ainstigator); void onevent(in nsimsgdatabase adb, in string aevent); methods onhdrflagschanged() called when a message's flags change.
... void onhdrflagschanged(in nsimsgdbhdr ahdrchanged, in unsigned long aoldflags, in unsigned long anewflags, in nsidbchangelistener ainstigator); parameters ahdrchanged the nsimsgdbhdr of the message that changed.
...And 15 more matches
Content Scripts - Archive of obsolete content
a message-passing api allows the main code and content scripts to communicate with each other this complete add-on illustrates all of these principles.
... passing configuration options the contentscriptoptions is a json object that is exposed to content scripts as a read-only value under the self.options property: // main.js var tabs = require("sdk/tabs"); tabs.on('ready', function(tab) { tab.attach({ contentscript: 'window.alert(self.options.message);', contentscriptoptions: {"message" : "hello world"} }); }); any kind of jsonable value (object, array, string, etc.) can be used here.
...but sometimes you might want to interact with page scripts: you might want to share objects between content scripts and page scripts or to send messages between them.
...And 14 more matches
Cross Process Object Wrappers
chrome code can load frame scripts into the content process using the message manager, and can then communicate with them using a message-passing api.
... to learn more about this, see the documentation on using the message manager.
... passing cpows from frame scripts frame scripts can send messages to chrome using one of two global functions: sendasyncmessage() or sendsyncmessage().
...And 14 more matches
nsIScriptError
66 introduced gecko 1.0 inherits from: nsiconsolemessage last changed in gecko 1.9 (firefox 3) implemented by: @mozilla.org/scripterror;1.
... method overview void init(in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category); void initwithwindowid(in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid); autf8string tostring(); ...
... errormessage astring the error message in a string format without any context/line number information.
...And 14 more matches
ui/sidebar - Archive of obsolete content
communicating with sidebar scripts you can't directly access your sidebar's content from your main add-on code, but you can send messages between your main add-on code and scripts loaded into your sidebar.
... on the sidebar end of the conversation, sidebar scripts get a global variable addon that contains a port for sending and receiving messages.
... on the add-on side, you need to get a worker object for the sidebar before you can send or receive messages.
...And 13 more matches
Creating annotations - Archive of obsolete content
the matched element is highlighted and has a click handler bound to it which sends a message to the main add-on code.
... the selector page mod can be switched on and off using a message from the main add-on code.
... it is initially off: var matchedelement = null; var originalbgcolor = null; var active = false; function resetmatchedelement() { if (matchedelement) { (matchedelement).css('background-color', originalbgcolor); (matchedelement).unbind('click.annotator'); } } self.on('message', function onmessage(activation) { active = activation; if (!active) { resetmatchedelement(); } }); this selector listens for occurrences of the jquery mouseenter event.
...And 13 more matches
nsIJetpack
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) method overview void sendmessage(in astring amessagename /* [optional] in jsval v1, [optional] in jsval v2, ...
... */); void registerreceiver(in astring amessagename, in jsval areceiver); void unregisterreceiver(in astring amessagename, in jsval areceiver); void unregisterreceivers(in astring amessagename); void evalscript(in astring ascript); nsivariant createhandle(); void destroy(); methods sendmessage() this method asynchronously sends a message to the jetpack process.
... void sendmessage( in astring amessagename, [optional] in jsval v1, optional [optional] in jsval v2, optional ...
...And 13 more matches
Mail and RDF
overview of mail rdf graph the root resource for all accounts, folders and messages is the rdf resource named msgaccounts:/.
... from this resource, you can follow a number of arcs to find servers, folders, and finally messages.
... msgaccounts:/ +-- http://home.netscape.com/nc-rdf#child --> | imap://alecf@imap.mywork.com | +-- http://home.netscape.com/nc-rdf#isserver --> "true" | +-- http://home.netscape.com/nc-rdf#child --> | imap://alecf@imap.mywork.com/inbox | +-- http://home.netscape.com/nc-rdf#totalmessages --> "4" | +-- http://home.netscape.com/nc-rdf#isserver --> "false" | +-- http://home.netscape.com/nc-rdf#messagechild --> | | imap_message://alecf@imap.mywork.com/inbox#1 | +-- http://home.netscape.com/nc-rdf#messagechild --> | | imap_message://alecf@imap.mywork.com/inbox#2 | +-- http://home.netscape.com/nc-rdf#messagechild --> ...
...And 13 more matches
Push API - Web APIs
WebAPIPush API
the push api gives web applications the ability to receive messages pushed to them from a server, whether or not the web app is in the foreground, or even currently loaded, on a user agent.
...see the following articles for more information: cross-site request forgery (csrf) prevention cheat sheet preventing csrf and xsrf attacks for an app to receive push messages, it has to have an active service worker.
... the resulting pushsubscription includes all the information that the application needs to send a push message: an endpoint and the encryption key needed for sending data.
...And 13 more matches
Using WebRTC data channels - Web APIs
understanding message size limits for any data being transmitted over a network, there are size restrictions.
...at the application level—that is, within the user agent's implementation of webrtc on which your code is running—the webrtc implementation implements features to support messages that are larger than the maximum packet size on the network's transport layer.
... this can complicate things, since you don't necessarily know what the size limits are for various user agents, and how they respond when a larger message is sent or received.
...And 13 more matches
port - Archive of obsolete content
the port object provides message sending and receiving api enabling conversations between a content script and the main add-on code.
... port methods emit() the port.emit() function sends a message from one side to the other.
... it may be called with any number of parameters, but is most likely to be called with a name for the message and an optional payload.
...And 12 more matches
Frame script loading and lifetime
the script just writes "foo" to the command line: // chrome script var mm = gbrowser.selectedbrowser.messagemanager; mm.loadframescript('data:,dump("foo\\n")', true); loadframescript() takes two mandatory parameters: a url that points to the frame script you want to load a boolean flag, allowdelayedload note: if the message manager is a global frame message manager or a window message manager, loadframescript() may load the script multiple times, once in each applicable frame.
... to define the mapping between a chrome:// url and a frame script packaged with an extension, use a "chrome.manifest" file to register a chrome url: // chrome.manifest content my-e10s-extension chrome/content/ // chrome script mm.loadframescript("chrome://my-e10s-extension/content/content.js", true); allowdelayedload if the message manager is a global frame message manager or a window message manager then: if allowdelayedload is true, the frame script will be loaded into any new frame, which has opened after the loadframescript() call.
... for example: var mm = window.messagemanager; mm.loadframescript("chrome://my-e10s-extension/content/frame-script.js", true); the script will be loaded into all tabs currently open in this window, and all new tabs opened afterwards.
...And 12 more matches
PromiseWorker.jsm
summary a promiseworker is a chromeworker except instead of calling postmessage() to send a message, you call post(), which returns a promise.
...this answers the question "when should i use a promiseworker?", and the answer is, whenever you would normally use a chromeworker, but want postmessage to return promises.
...let worker = new promiseworker.abstractworker() worker.dispatch = function(method, args = []) { // dispatch a call to method `method` with args `args` return self[method](...args); }; worker.postmessage = function(...args) { // post a message to the main thread self.postmessage(...args); }; worker.close = function() { // close the worker self.close(); }; worker.log = function(...args) { // log (or discard) messages (optional) dump('worker: ' + args.join(' ') + '\n'); }; // connect it to message port.
...And 12 more matches
nsIMsgDatabase
iew void open(in nsilocalfile afoldername, in boolean acreate, in boolean aleaveinvaliddb); void forcefolderdbclosed(in nsimsgfolder afolder); void close(in boolean aforcecommit); void commit(in nsmsgdbcommit committype); void forceclosed(); void clearcachedhdrs; void resethdrcachesize(in unsigned long size); nsimsgdbhdr getmsghdrforkey(in nsmsgkey key); nsimsgdbhdr getmsghdrformessageid(in string messageid); boolean containskey(in nsmsgkey key); nsimsgdbhdr createnewhdr(in nsmsgkey key); void addnewhdrtodb(in nsimsgdbhdr newhdr, in boolean notify); nsimsgdbhdr copyhdrfromexistinghdr(in nsmsgkey key, in nsimsgdbhdr existinghdr, in boolean addhdrtodb); void listallkeys(in nsmsgkeyarrayref outputkeys); native code only!
... nsisimpleenumerator enumeratemessages(); nsisimpleenumerator enumeratethreads(); void synccounts; nsimsgthread getthreadcontainingmsghdr(in nsimsgdbhdr msghdr); void markhdrread(in nsimsgdbhdr msghdr, in boolean bread, in nsidbchangelistener instigator); void markhdrreplied(in nsimsgdbhdr msghdr, in boolean breplied, in nsidbchangelistener instigator); void markhdrmarked(in nsimsgdbhdr msghdr, in boolean mark,in nsidbchangelistener instigator); void markmdnneeded(in nsmsgkey key, in boolean bneeded,in nsidbchangelistener instigator); boolean ismdnneeded(in nsmsgkey key); void markmdnsent(in nsmsgkey key, in boolean bneeded, in nsidbchangelistener instigator); boolean ismdnsent(in nsmsgkey key); void markread(in nsmsgkey key, in boolean bread, in nsidbchangelistener instig...
... void deletemessages(in nsmsgkeyarrayptr nsmsgkeys, in nsidbchangelistener instigator); native code only!
...And 12 more matches
nsIPushService
dom/interfaces/push/nsipushservice.idlscriptable a service for components to subscribe and receive push messages from remote servers.
... passing the system principal exempts the subscription from permission checks and background messages quotas, which are enforced for service worker subscriptions.
... } ); receiving push messages subscriptions created from privileged code use xpcom observer notifications instead of service worker events.
...And 12 more matches
nsISmsDatabaseService
nsismsdatabaseservice dom/sms/interfaces/nsismsdatabaseservice.idlscriptable used to store and manage sms text messages for the websms api 1.0 66 introduced gecko 13.0 inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) implemented by: @mozilla.org/sms/smsdatabaseservice;1.
... to create an instance, use: var smsservice = components.classes["@mozilla.org/sms/smsdatabaseservice;1"] .createinstance(components.interfaces.nsismsdatabaseservice); method overview long savereceivedmessage(in domstring asender, in domstring abody, in unsigned long long adate); long savesentmessage(in domstring areceiver, in domstring abody, in unsigned long long adate); void getmessage(in long messageid, in long requestid, [optional] in unsigned long long processid); void deletemessage(in long messageid, in long requestid, [optional] in unsigned long long processid); void createmessagelist(in nsidommozsmsfilter filter, in boolean reverse, in long requestid, [optional] in unsigned long long processid); void getnextmessageinlist(in long listid, in long requestid, [...
...optional] in unsigned long long processid); void clearmessagelist(in long listid); void markmessageread(in long messageid, in boolean value, in long requestid, [optional] in unsigned long long processid) methods savereceivedmessage() void savereceivedmessage( in domstring asender, in domstring abody, in unsigned long long adate ); parameters asender a domstring with the sender of the text message.
...And 12 more matches
nsISmsRequestManager
to create an instance, use: var smsrequestmanager = components.classes["@mozilla.org/sms/smsrequestmanager;1"] .createinstance(components.interfaces.nsismsrequestmanager); method overview long addrequest(in nsidommozsmsrequest arequest); long createrequest(in nsidommozsmsmanager amanager, out nsidommozsmsrequest arequest); void notifycreatemessagelist(in long arequestid, in long alistid, in nsidommozsmsmessage amessage); void notifygetsmsfailed(in long arequestid, in long aerror); void notifygotnextmessage(in long arequestid, in nsidommozsmsmessage amessage); void notifygotsms(in long arequestid, in nsidommozsmsmessage amessage); void notifymarkedmessageread(in long arequestid, in bool aread); void notifymarkmessagereadfailed(in ...
...long arequestid, in long aerror); void notifynomessageinlist(in long arequestid); void notifyreadmessagelistfailed(in long arequestid, in long aerror); void notifysmsdeleted(in long arequestid, in bool adeleted); void notifysmsdeletefailed(in long arequestid, in long aerror); void notifysmssendfailed(in long arequestid, in long aerror); void notifysmssent(in long arequestid, in nsidommozsmsmessage amessage); constants all sms related errors that could apply to smsrequest objects.
...notifycreatemessagelist() void notifycreatemessagelist( in long arequestid, in long alistid, in nsidommozsmsmessage amessage ); parameters arequestid a number representing the id of the request.
...And 12 more matches
NSS tools : cmsutil
name cmsutil — performs basic cryptograpic operations, such as encryption and decryption, on cryptographic message syntax (cms) messages.
... synopsis cmsutil [options] arguments description the cmsutil command-line uses the s/mime toolkit to perform basic operations, such as encryption and decryption, on cryptographic message syntax (cms) messages.
...the options and arguments for the cmsutil command are defined as follows: -d decode a message.
...And 11 more matches
NSS tools : cmsutil
MozillaProjectsNSStoolscmsutil
name cmsutil — performs basic cryptograpic operations, such as encryption and decryption, on cryptographic message syntax (cms) messages.
... synopsis cmsutil [options] arguments description the cmsutil command-line uses the s/mime toolkit to perform basic operations, such as encryption and decryption, on cryptographic message syntax (cms) messages.
...the options and arguments for the cmsutil command are defined as follows: -d decode a message.
...And 11 more matches
Web Replay
seek to console messages errors and logged messages in the console developer tool can be clicked on to cause the tab to seek to the point in the recording where the error was generated or the message was logged.
... console error/messages are marked on the timeline and can be clicked to seek to that point.
... recording a recording content process differs from a normal content process in the following ways: calls to certain functions are intercepted by hooking them (rewriting the machine code at their entry points to call a different function with the same signature), including the function used to dispatch mach messages.
...And 11 more matches
Browser Console - Firefox Developer Tools
so it logs the same sorts of information as the web console - network requests, javascript, css, and security errors and warnings, and messages explicitly logged by javascript code.
... 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.
... at the top, a toolbar enables you to filter the messages that appear.
...And 11 more matches
A simple RTCDataChannel sample - Web APIs
first, we have a couple of buttons for establishing and closing the connection: <button id="connectbutton" name="connectbutton" class="buttonleft"> connect </button> <button id="disconnectbutton" name="disconnectbutton" class="buttonright" disabled> disconnect </button> then there's a box which contains the text input box into which the user can type a message to transmit, with a button to send the entered text.
... <div class="messagebox"> <label for="message">enter a message: <input type="text" name="message" id="message" placeholder="message text" inputmode="latin" size=60 maxlength=120 disabled> </label> <button id="sendbutton" name="sendbutton" class="buttonright" disabled> send </button> </div> finally, there's the little box into which we'll insert the messages.
... <div class="messagebox" id="receivebox"> <p>messages received:</p> </div> the javascript code while you can just look at the code itself on github, below we'll review the parts of the code that do the heavy lifting.
...And 11 more matches
Jetpack Processes - Archive of obsolete content
privileged apis when script is evaluated in a jetpack process via a call to nsijetpack.evalscript(), the script's global scope is endowed with the following privileged apis: sendmessage(amessagename [, v1 [, v2 [, ...]]]) similar to nsijetpack.sendmessage(), this function asynchronously sends a message to the chrome process.
... callmessage(amessagename [, v1 [, v2 [, ...]]]) this function is like sendmessage() but sends the message synchronously.
... it returns an array whose elements are the return values of each receiver in the chrome process that was triggered by the message.
...And 10 more matches
Index - Archive of obsolete content
16 communicating using "postmessage" add-on sdk no summary!
... 48 notifications add-on sdk, notifications display transient, toaster-style desktop messages to the user.
... 136 console add-on sdk enables your add-on to log error, warning or informational messages.
...And 10 more matches
Using workers in extensions - Archive of obsolete content
that file, ticker_worker.js, is shown here: var symbol = ""; function refreshinformation() { if (!symbol) { throw "no symbol set!"; } var fullurl = "http://quote.yahoo.com/d/quotes.csv?f=sl1d1t1c1ohgv&e=.csv&s=" + symbol; function inforeceived() { var output = httprequest.responsetext; if (output) { postmessage(output.trim()); } 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 wor...
... then it sets the worker's onmessage event handler to a function which looks at the event passed into it, and does one of two things: if there is a data field on the event, the stock symbol being tracked is set to the upper case version of that value.
... when the result is received from xmlhttprequest, instead of immediately updating the displayed information in the status bar, a message is sent to the main thread using the worker's postmessage() method.
...And 10 more matches
nsIMsgWindow
to create an instance, use: msgwindow = components.classes["@mozilla.org/messenger/msgwindow;1"] .createinstance(components.interfaces.nsimsgwindow); in thunderbird the default message window is stored in the global variable msgwindow.
... method overview void displayhtmlinmessagepane(in astring title, in astring body, in boolean clearmsghdr); void stopurls(); void closewindow(); attributes attribute type description windowcommands nsimsgwindowcommands this allows the backend code to send commands to the ui, such as clearmsgpane.
... msgheadersink nsimsgheadersink this allows the backend code to send message header information to the ui.
...And 10 more matches
page-worker - Archive of obsolete content
while content scripts can access dom content, they can't access any of the sdk apis, so in many cases you'll need to exchange messages between the content script and your main add-on code for a complete solution.
...you can communicate with the script using either the postmessage() api or (preferably, usually) the port api.
...is add-on loads a page from wikipedia, and runs a content script in it to send all the headers back to the main add-on code: var pageworkers = require("sdk/page-worker"); // this content script sends header titles from the page to the add-on: var script = "var elements = document.queryselectorall('h2 > span'); " + "for (var i = 0; i < elements.length; i++) { " + " postmessage(elements[i].textcontent) " + "}"; // create a page worker that loads wikipedia: pageworkers.page({ contenturl: "http://en.wikipedia.org/wiki/internet", contentscript: script, contentscriptwhen: "ready", onmessage: function(message) { console.log(message); } }); for conciseness, this example creates the content script as a string and uses the contentscript property.
...And 9 more matches
sslfnc.html
ssl_v2_compatible_hello tells the ssl library whether or not to send ssl3 client hello messages in ssl2-compatible format.
...it is better to allow the ssl handshake to complete and then have your application return an error message to the client that informs the user of the need for a certificate.
... ssl_v2_compatible_hello tells the ssl library whether or not to send ssl3 client hello messages in ssl2-compatible format.
...And 9 more matches
NSS Tools cmsutil
using cmsutil newsgroup: mozilla.dev.tech.crypto the cmsutil command-line utility uses the s/mime toolkit to perform basic operations, such as encryption and decryption, on cryptographic message syntax (cms) messages.
...the options and arguments for the cmsutil command are defined as follows: options -ddecode a message.
... -c encrypt a message.
...And 9 more matches
Redis Tips
event logging lists, zsets, pubsub queues lists (rpush, blpop, blpoprpush, etc.) priority queues zsets membership sets, bitstrings state hashes heartbeats zsets hit counters zsets message broadcast pubsub search reverse indexes (never use keys in production) documentation redis has fantastic documentation.
... check this out: publish subscribe unsubscribe psubscribe punsubscribe publish publishes a message to a channel.
... in one redis-cli, do this: redis1> subscribe message-channel reading messages...
...And 9 more matches
nsIWebSocketListener
1.0 66 introduced gecko 8.0 inherits from: nsisupports last changed in gecko 8.0 (firefox 8.0 / thunderbird 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 ack...
...nowledge a message sent via nsiwebsocketchannel.sendmsg() or nsiwebsocketchannel.sendbinarymsg().
... onbinarymessageavailable() called when a binary message has been received.
...And 9 more matches
Mail client architecture overview
the mail reader gecko (xul and html rendering) rdf (dynamic widgets) js (menus, events) libmime mail datasources mail javascript folder/message management msgdb imap/nntp/pop3 necko (networking) sections in grey refer to modules outside of mail/news the base module the base module provides a generic interface to a set of protocol-independant messaging services.
... this includes management of accounts, folders and messages.
... the base module consists of the following basic building blocks account management - the account manager is the root object of the server/folder/message hierarchy.
...And 9 more matches
EventSource - Web APIs
once the connection is opened, incoming messages from the server are delivered to your code in the form of events.
... if there is an event field in the incoming message, the triggered event is the same as the event field value.
... if no event field is present, then a generic message event is fired.
...And 9 more matches
SubtleCrypto.verify() - Web APIs
/* fetch the contents of the "message" textbox, and encode it in a form we can use for sign operation.
... */ function getmessageencoding() { const messagebox = document.queryselector(".rsassa-pkcs1 #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } /* fetch the encoded message-to-sign and verify it against the stored signature.
...*/ async function verifymessage(publickey) { const signaturevalue = document.queryselector(".rsassa-pkcs1 .signature-value"); signaturevalue.classlist.remove("valid", "invalid"); let encoded = getmessageencoding(); let result = await window.crypto.subtle.verify( "rsassa-pkcs1-v1_5", publickey, signature, encoded ); signaturevalue.classlist.add(result ?
...And 9 more matches
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
WebHTMLElementinput
it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message.
... setcustomvalidity() sets a custom message to display if the input element's value isn't valid.
...on form submission, if there is a form control that fails constraint validation, supporting browsers will display an error message on the first invalid form control; displaying a default message based on the error type, or a message set by you.
...And 9 more matches
Content Processes - Archive of obsolete content
the final section explains why the sdk still uses the notion of content scripts and message passing, even though the multiprocess model for which they were designed never materialized.
...we can, however, pass json messages between scripts in different processes.
...content scripts differ from scripts that are loaded by the page itself in that they are provided with a messaging api that can be used to send messages back to the add-on script.
...And 8 more matches
console - Archive of obsolete content
enables your add-on to log error, warning or informational messages.
... 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.
... if the add-on has been installed in firefox, then the messages appear in the browser console.
...And 8 more matches
Modifying Web Pages Based on URL - Archive of obsolete content
a simple code snippet where content script is supplied as contentscript option and url pattern is given as include option is as follows: // import the page-mod api var pagemod = require("sdk/page-mod"); // create a page-mod // it will run a script whenever a ".org" url is loaded // the script replaces the page contents with a message pagemod.pagemod({ include: "*.org", contentscript: 'document.body.innerhtml = ' + ' "<h1>page matches ruleset</h1>";' }); do as follows: create a new directory and navigate to it.
... for example, if we save the script above under the add-on's data directory in a file called my-script.js: // import the page-mod api var pagemod = require("sdk/page-mod"); // import the self api var self = require("sdk/self"); // create a page-mod // it will run a script whenever a ".org" url is loaded // the script replaces the page contents with a message pagemod.pagemod({ include: "*.org", contentscriptfile: self.data.url("my-script.js") }); or from firefox 34 onwards: // import the page-mod api var pagemod = require("sdk/page-mod"); // create a page-mod // it will run a script whenever a ".org" url is loaded // the script replaces the page contents with a message pagemod.pagemod({ include: "*.org", contentscriptfile: "./my-script.js" ...
... // import the page-mod api var pagemod = require("sdk/page-mod"); // import the self api var self = require("sdk/self"); // create a page mod // it will run a script whenever a ".org" url is loaded // the script replaces the page contents with a message pagemod.pagemod({ include: "*.org", contentscriptfile: [self.data.url("jquery-1.7.min.js"), self.data.url("my-script.js")] }); you can use both contentscript and contentscriptfile in the same page-mod.
...And 8 more matches
MCD, Mission Control Desktop, AKA AutoConfig - Archive of obsolete content
ref: bug 690370 available functions are (see prefcalls.js file for details): function getprefbranch() 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.
...lockpref("mail.identity.id1.useremail", mail); lockpref("mail.server.server2.name", mail); lockpref("mail.identity.id1.fullname", cn); //debug with popup error messages doesn't work anymore :-( !!
...z_ldap_xpcom=1 moz_mail_news= moz_mork=1 moz_morkreader= and set --enable-extensions=pref in mozconfig file, in fedora source rpm it is: [root@b008-02 sources]# grep enable-extensions /root/rpmbuild/sources/thunderbird-mozconfig ac_add_options --enable-extensions=pref it seems worse this time , as even after applying those compilation options mentioned above, i now get the following error message while stating thunderbird with autoconfig (autoconf.js having pref('general.config.filename','thunderbird.cfg'); ) and thunderbird.cfg calling getldap* functions to retrieve cn and mail address of the current user.
...And 8 more matches
Debugging HTML - Learn web development
here, the error message is relatively easy to understand — "unterminated double quote string".
...however, error messages can quickly get more complicated and less easy to interpret as programs get bigger, and even simple cases can look a little intimidating to someone who doesn't know anything about rust.
...these are usually easy to fix as long as you are familiar with the language's syntax and know what the error messages mean.
...And 8 more matches
Performance
this highlights some performance pitfalls related to frame scripts/message manager usage and alternative approaches to avoid them.
... do some work on the window } function dosomething(message) { result = helper(content, message.data) sendasyncmessage("my-addon:response-from-child", {something: result}) } addmessagelistener("my-addon:request-from-parent", dosomething) why is this bad?
...do some work on the window } function dosomething(message) { frameglobal = message.target result = helper(frameglobal.content, message.data) frameglobal.sendasyncmessage("my-addon:response-from-child", {something: result}) } function addframe(frameglobal) { frameglobal.addmessagelistener("my-addon:request-from-parent", dosomething) } javascript modules are per-process singletons and thus all their objects are only initialized once, which make...
...And 8 more matches
nsMsgNavigationType
the nsmsgnavigationtype interface contains constants used for message navigation in thunderbird.
... for example to move forward a message, you would call: // assuming gdbview is a global nsimsgdbview var resultid = new object(); var resultindex = new object(); var threadindex = new object(); gdbview.viewnavigate(components.interfaces.nsmsgnavigationtype.nextmessage, resultid, resultindex, threadindex, true); the nsmsgnavigationtype interface is defined as a global variable in thunderbird: var nsmsgviewcommandtype = components.interfaces.nsmsgviewcommandtype; mailnews/base/public/nsimsgdbview.idlscriptable please add a summary to this article.
... last changed in gecko 1.9 (firefox 3) constants name value description firstmessage 1 go to the first message in the view.
...And 8 more matches
Channel Messaging API - Web APIs
the channel messaging api allows two separate scripts running in different browsing contexts attached to the same document (e.g., two iframes, or the main document and an iframe, two documents via a sharedworker, or two workers) to communicate directly, passing messages between one another through two-way channels (or pipes) with a port at each end.
... channel messaging concepts and usage a message channel is created using the messagechannel() constructor.
... once created, the two ports of the channel can be accessed through the messagechannel.port1 and messagechannel.port2 properties (which both return messageport objects.) the app that created the channel uses port1, and the app at the other end of the port uses port2 — you send a message to port2, and transfer the port over to the other browsing context using window.postmessage along with two arguments (the message to send, and the object to transfer ownership of, in this case the port itself.) when these transferable objects are transferred, they are 'neutered' on the previous context — the one they previously belonged to.
...And 8 more matches
SubtleCrypto.sign() - Web APIs
WebAPISubtleCryptosign
these systems all use a digest algorithm to hash the message to a short fixed size before signing.
... it's different from rsassa-pkcs1-v1_5 in that it incorporates a random salt in the signature operation, so the same message signed with the same key will not result in the same signature each time.
... hmac the hmac algorithm calculates and verifies hash-based message authentication codes according to the fips 198-1 standard.
...And 8 more matches
Worker - Web APIs
WebAPIWorker
the worker interface of the web workers api represents a background task that can be created via script, which can send messages back to its creator.
... worker.onmessage an eventlistener called whenever a messageevent of type message bubbles through the worker — i.e.
... when a message is sent to the parent document from the worker via dedicatedworkerglobalscope.postmessage.
...And 8 more matches
Back to the Server: Server-Side JavaScript On The Rise - Archive of obsolete content
er_examples/js/ext-2.1/resources/css/ext-all.css" type="text/css" rel="stylesheet"/> <script src="/jaxer_examples/js/ext-2.1/adapter/ext/ext-base.js"/> <script src="/jaxer_examples/js/ext-2.1/ext-all.js"/> <link href="/jaxer_examples/css/main.css" type="text/css" rel="stylesheet"/> <script runat="both" src="/jaxer_examples/js/validatecomments.js"/> <script> var txt_name; var txt_email; var txt_message; var btn_comments; var form_comments; ext.onready( function() { // create the name text field txt_name = new ext.form.textfield({ name: "name", fieldlabel: "name", width: 200 }); // create the e-mail text field txt_email = new ext.form.textfield({ name: "email", fieldlabel: "e-mail", width: 200 }); // create the message text field txt_message = new ext.form.textarea({ nam...
...e: "message", fieldlabel: "message", width: 200 }); // create a button used to send the form details.
... btn_comments = 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.
...And 7 more matches
Accessibility/LiveRegionDevGuide
it is responsible for queuing messages derived from live region events, where priority is determined by chronological order and the live politeness properties.
...the "purge by timestamp" method will be used to remove old messages that are no longer deemed relevant while "purge by politeness" is used to satisfy the aria live politeness specification.
...this property, along with an event's time stamp, determine the priority of a message within the priority queue.
...And 7 more matches
Getting Started with Chat
try to keep messages as concise as possible.
... when addressing someone directly, try to use name: message format.
...try to keep your messages within that subject matter.
...And 7 more matches
nsIMsgThread
imsgdbhdr getchild(in nsmsgkey msgkey); nsimsgdbhdr getchildhdrat(in long index); nsimsgdbhdr getroothdr(out long index); void removechildat(in long index); void removechildhdr(in nsimsgdbhdr child, in nsidbchangeannouncer announcer); void markchildread(in boolean bread); nsimsgdbhdr getfirstunreadchild(); nsisimpleenumerator enumeratemessages(in nsmsgkey parent); attributes attribute type description threadkey nsmsgkey unsigned long key designating this thread.
... subject acstring subject of the thread newestmsgdate unsigned long numchildren unsigned long readonly: number of messages in the thread.
... numunreadchildren unsigned long readonly: number of unread messages in the thread.
...And 7 more matches
nsISmsService
dom/sms/interfaces/nsismsservice.idlscriptable used to send sms text messages for the websms api 1.0 66 introduced gecko 13.0 inherits from: nsisupports last changed in gecko 15.0 (firefox 15.0 / thunderbird 15.0 / seamonkey 2.12) implemented by: @mozilla.org/sms/smsservice;1.
... to create an instance, use: var smsservice = components.classes["@mozilla.org/sms/smsservice;1"] .createinstance(components.interfaces.nsismsservice); method overview [implicit_jscontext] nsidommozsmsmessage createsmsmessage(in long id, in domstring delivery, in domstring sender, in domstring receiver, in domstring body, in jsval timestamp, in bool read ); unsigned short getnumberofmessagesfortext(in domstring text); boolean hassupport(); void send(in domstring number, in domstring message, in long requestid, [optional] in unsigned long long processid); methods createsmsmessage() [implicit_jscontext] nsidommozsmsmessage createsmsmessage( in long id, in domstring delivery, in domstring sender, in domstring receiver, in do...
...mstring body, in jsval timestamp, in bool read ); parameters id a number representing the id of the message.
...And 7 more matches
Demo Addon
furthermore, it shows some messages in the inbox and lists a random attachment.
... to list some messages of the folder we use: for each (let msghdr in fixiterator(inbox.msgdatabase.enumeratemessages(), ci.nsimsgdbhdr)) { if (++i >= 10 && lastmsghdr != null) break; messages.push({ author: msghdr.mime2decodedauthor, subject: msghdr.mime2decodedsubject, date: new date(msghdr.date/1000), }); //...
... } to get a collection of messages in the inbox, we use inbox.msgdatabase.enumeratemessages().
...And 7 more matches
Using the Multiple Accounts API
incoming servers (nsimsgincomingserver): an incoming server represents a remote message store such as a pop, imap, or nntp server.
... identities (nsimsgidentity): an identity contains all the information necessary to compose and outgoing mail message.
...- boolean, should we download new messags on biff (true) or just alert user that there is new mail (false) preference: mail.server.server.directory - local platform-specific path to store messages and folder indexes preference: mail.server.server.name - user-visible name of server the following are specific to imap: preference: mail.server.server.admin_url - administration url for server preference: mail.server.server.using_subscription - boolean, should we use subscriptions?
...And 7 more matches
Using Objective-C from js-ctypes
$ clang -framework appkit test.m && ./a.out class, message, and selector our task at hand is to convert objective-c syntax to c syntax.
... let's look at the following codelet: [nsspeechsynthesizer alloc] it passes an alloc message to the nsspeechsynthesizer class, in objective-c syntax.
... register the alloc selector for the message.
...And 7 more matches
Constraint validation API - Web APIs
validationmessage a read-only property that returns an empty string if the element is not a candidate for constraint validation, or if the element's value is valid.
... if the element's value is not valid, it returns a localized validation message.
... this will be displayed in the ui if the element is the only form control with a validity problem; if a custom error message is set using setcustomvalidity(), this will be shown.
...And 7 more matches
Event reference
message a message is received through a websocket.
... storage events change (see non-standard events) storage update events checking downloading error noupdate obsolete updateready value change events broadcast checkboxstatechange hashchange input radiostatechange readystatechange valuechange uncategorized events invalid message message open show less common and non-standard events abortable fetch events event name fired when abort a dom request is aborted, i.e.
... message messageevent websocket a message is received through a websocket.
...And 7 more matches
<input type="email"> - HTML: Hypertext Markup Language
WebHTMLElementinputemail
it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message.
...in our simplified form, the user needs to enter their e-mail address and a message describing the problem they need help with.
...let'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 sta...
...And 7 more matches
event/target - Archive of obsolete content
const { eventtarget } = require("sdk/event/target"); let target = eventtarget(); for a convenience though optional options arguments may be used, in which case all the function properties with keys like: onmessage, onmyevent...
... will be auto registered for associated 'message', 'myevent' events on the created instance.
... adding listeners eventtarget interface defines on method, that can be used to register event listeners on them for the given event type: target.on('message', function onmessage(message) { // note: `this` pseudo variable is an event `target` unless // intentionally overridden via `.bind()`.
...And 6 more matches
remote/parent - Archive of obsolete content
// remote.js const { process } = require("sdk/remote/child"); process.port.emit("message-from-remote", "hello from remote"); process.port.on("message-from-main", function(process, message) { console.log("main says: " + message); }); // main.js const { processes, remoterequire } = require("sdk/remote/parent"); remoterequire("./remote.js", module); processes.port.emit("message-from-main", "hello from main"); processes.port.on("message-from-remote", function(process, message) { ...
... console.log("remote says: " + message); }); child process privileges a module loaded into a child process can't do everything that the same module loaded into the parent process can.
...cess.port.emit("id", processid); }); // main.js const { processes, remoterequire } = require("sdk/remote/parent"); // load "remote.js" into every current and future process remoterequire("./remote.js", module); // for every current and future process processes.forevery(process => { // ask for the process id process.port.emit("fetchid"); // first argument is always the process, then the message payload process.port.once("id", (process, id) => { console.log("child process is remote:" + process.isremote); console.log("child process id:" + id); }); }); content frame manipulation this demonstrates telling every current frame to link to a specific anchor element: // remote.js const { frames } = require("sdk/remote/child"); // listeners receive the frame the event was for as t...
...And 6 more matches
Introduction to Public-Key Cryptography - Archive of obsolete content
any attempt to modify data or substitute a false message for a legitimate one will be detected.
...for example, the digital signature on an email message, combined with the certificate that identifies the sender, provide strong evidence that the person identified by that certificate did indeed send that message.
...using s/mime to sign or encrypt email messages requires the sender of the message to have an s/mime certificate.
...And 6 more matches
nsIPushSubscription
dom/interfaces/push/nsipushservice.idlscriptable includes information needed to send a push message to privileged code.
...sending a post request to this url routes the message to the instance of firefox that created the subscription.
... a subscription also has a public key and secret; these are used to encrypt message payloads.
...And 6 more matches
nsIWebProgressListener
ess, in long amaxtotalprogress); void onsecuritychange(in nsiwebprogress awebprogress, in nsirequest arequest, in unsigned long astate); void onstatechange(in nsiwebprogress awebprogress, in nsirequest arequest, in unsigned long astateflags, in nsresult astatus); void onstatuschange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage); constants state transition flags these flags indicate the various states that requests may transition through as they are being loaded.
...for instance, a load that starts in a window might send progress and status messages for the new site, but it will not send the onlocationchange until we are sure that we are loading this new page here.
...the status message is intended to be displayed to the user (for example, in the status bar of the browser).
...And 6 more matches
Gloda examples
see creating a gloda message query for more examples.
... a) show all messages in a conversation regardless of the folder in which they are stored, b) search messages by subject assuming that you have a message (glodamessage) in the conversation already, this is straight forward using glodamessage.conversation.getmessagescollection() alistener = { /* called when new items are returned by the database query or freshly indexed */ onitemsadded: function _onitemsadded(aitems, acollection) { }, /* called when items that are already in our collection get re-indexed */ onitemsmodified: function _onitemsmodified(aitems, acollection) { }, /* called when items that are in our collection are purged from the system */ onitemsremoved: function _onitemsremoved(aitems, acollection) { }, /* called when our database query com...
...pletes */ onquerycompleted: function _onquerycompleted(conversation_coll) { try { for (var conv in conversation_coll) { //do something with the conversation here alert(conv.subject); } } catch (e) {} } } glodamessage.conversation.getmessagescollection(alistener) alternatively if you need to get a conversation based on the subject, you need to do a query (using the same listener as above).
...And 6 more matches
Finding the code for a feature
here is my (edited) response: nsimsgtagservice is used to store the list of valid tags, so it is not the correct way to tag messages.
... tags are applied using the message database property "keyword".
...i know there is a menu command "tag" to tag the message - how does it do it?
...And 6 more matches
BroadcastChannel - Web APIs
messages are broadcasted via a message event fired at all broadcastchannel objects listening to the channel.
... event handlers broadcastchannel.onmessage an eventhandler property that specifies the function to execute when a message event is fired on this object.
... broadcastchannel.onmessageerror an eventhandler called when a messageevent of type messageerror is fired—that is, when it receives a message that cannot be deserialized.
...And 6 more matches
DedicatedWorkerGlobalScope - Web APIs
dedicatedworkerglobalscope.onmessage is an eventhandler representing the code to be called when the message event is raised.
... these events are of type messageevent and will be called when the worker receives a message from the document that started it (i.e.
... from the worker.postmessage method.) dedicatedworkerglobalscope.onmessageerror is an eventhandler representing the code to be called when the messageerror event is raised.
...And 6 more matches
Using microtasks in JavaScript with queueMicrotask() - Web APIs
the snippet below creates a function that batches multiple messages into an array, using a microtask to send them as a single object when the context exits.
... const messagequeue = []; let sendmessage = message => { messagequeue.push(message); if (messagequeue.length === 1) { queuemicrotask(() => { const json = json.stringify(messagequeue); messagequeue.length = 0; fetch("url-of-receiver", json); }); } }; when sendmessage() gets called, the specified message is first pushed onto the message queue array.
... if the message we just added to the array is the first one, we enqueue a microtask that will send a batch.
...And 6 more matches
Window - Web APIs
WebAPIWindow
window.messagemanager returns the message manager object for this window.
... window.confirm() displays a dialog with a message that the user needs to respond to.
... window.dump() writes a message to the console.
...And 6 more matches
content/worker - Archive of obsolete content
it exports the worker trait, which enables content scripts and the add-on code to exchange messages using the port or postmessage apis.
... onmessage function functions that will registered as a listener to a 'message' events.
... methods postmessage(data) asynchronously emits "message" events in the enclosed worker, where content script was loaded.
...And 5 more matches
Displaying annotations - Archive of obsolete content
if it finds any it binds functions to that element's mouseenter and mouseleave events to send messages to the main module, asking it to show or hide the annotation.
... like the selector, the matcher also listens for the window's unload event and on unload sends a detach message to the main module, so the add-on can clean it up.
... the complete content script is here: self.on('message', function onmessage(annotations) { annotations.foreach( function(annotation) { if(annotation.url == document.location.tostring()) { createanchor(annotation); } }); $('.annotated').css('border', 'solid 3px yellow'); $('.annotated').bind('mouseenter', function(event) { self.port.emit('show', $(this).attr('annotation')); event.stoppropagation(); event.preventdefault(); }); $('.annotated').bind('mouseleave', function() { self.port.emit('hide'); }); }); function createanchor(annotation) { annotationanchorancestor = $('#' + annotation.ancestorid); annotationanchor = $(annotationanchorancestor).parent().find( ':contains(' + annotation.anchortext + ')').last(); $(...
...And 5 more matches
JavaScript Object Management - Archive of obsolete content
modify the hello world extension so that the message says how many times it has been displayed.
... the message could say something like "hello!
... this message has been shown 5 times." keep the counter as a variable in the browseroverlay object, and increment it every time the message is going to be shown.
...And 5 more matches
Introducing asynchronous JavaScript - Learn web development
we add a click event listener to it so that when the button is clicked: an alert() message appears.
...let's look at a quick example, from our fetching data from the server article: fetch('products.json').then(function(response) { return response.json(); }).then(function(json) { products = json; initialize(); }).catch(function(err) { console.log('fetch problem: ' + err.message); }); note: you can find the finished version on github (see the source here, and also see it running live).
...le.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); }); console.log ('all done!'); the browser will begin executing the code, see the first console.log() statement (starting) and execute it, and then create the image variable.
...And 5 more matches
What went wrong? Troubleshooting JavaScript - Learn web development
types of error generally speaking, when you do something wrong in code, there are two main types of error that you'll come across: syntax errors: these are spelling errors in your code that actually cause the program not to run at all, or stop working part way through — you will usually be provided with some error messages too.
... these are usually okay to fix, as long as you are familiar with the right tools and know what the error messages mean!
...these are often harder to fix than syntax errors, as there usually isn't an error message to direct you to the source of the error.
...And 5 more matches
Working with Svelte stores - Learn web development
objective: learn how to use svelte stores using stores we will create an alert component that shows notifications on screen, which can receive messages from any component.
... in this case, the alert component is independent from the rest — it is not a parent or child of any other — so the messages don't fit into the component hierarchy.
...any component will be able to write to this store, and the alert component will subscribe to it and display a message whenever the store is modified.
...And 5 more matches
Gecko Logging
mozilla logging macros moz_log(module, level, message) outputs the given message if the module has the given log level enabled.
... level - the log level of the message.
... message - a printf-style message to output.
...And 5 more matches
Process scripts
for example, if you call the global frame message manager's loadframescript() function, then the script will be loaded separately into all open tabs.
... you can load a process script by accessing a parent process message manager and calling its loadprocessscript() function.
... the following code uses the global parent process message manager, which will load the script into the the chrome process and any child processes: // chrome code let ppmm = cc["@mozilla.org/parentprocessmessagemanager;1"] .getservice(ci.nsiprocessscriptloader); ppmm.loadprocessscript("chrome://whatever/process-script.js", true); ppmm.addmessagelistener("hello", function(msg) { ...
...And 5 more matches
Creating localizable web applications
text messages don't hardcode english content allow localizers to localize english content, such as: text messages, number formats, date formats, word order and sentence structure.
...error messages), or in javascript libraries and scripts.
...bad: <p><?= _("<strong class=\"legal\">design acceptance:</strong> if a design is accepted, we will send the following message:");?></p> <p><?= _("<strong class=\"legal\">design rejection:</strong> if a design is rejected, we will send the following message:");?></p> snippet 4.
...And 5 more matches
XPCOM Interface Reference
cklistpromptnsiblocklistservicensiboxobjectnsibrowserboxobjectnsibrowserhistorynsibrowsersearchservicensicrlinfonsicrlmanagernsicachensicachedeviceinfonsicacheentrydescriptornsicacheentryinfonsicachelistenernsicachemetadatavisitornsicacheservicensicachesessionnsicachevisitornsicachingchannelnsicancelablensicategorymanagernsichannelnsichanneleventsinknsichannelpolicynsicharsetresolvernsichromeframemessagemanagernsichromeregistrynsiclassinfonsiclipboardnsiclipboardcommandsnsiclipboarddragdrophooklistnsiclipboarddragdrophooksnsiclipboardhelpernsiclipboardownernsicollectionnsicommandcontrollernsicommandlinensicommandlinehandlernsicommandlinerunnernsicomponentmanagernsicomponentregistrarnsicompositionstringsynthesizernsiconsolelistenernsiconsolemessagensiconsoleservicensicontainerboxobjectnsicontentfr...
...amemessagemanagernsicontentprefnsicontentprefcallback2nsicontentprefobservernsicontentprefservicensicontentprefservice2nsicontentsecuritypolicynsicontentsniffernsicontentviewnsicontentviewmanagernsicontentviewernsicontrollernsicontrollersnsiconverterinputstreamnsiconverteroutputstreamnsicookiensicookie2nsicookieacceptdialognsicookieconsentnsicookiemanagernsicookiemanager2nsicookiepermissionnsicookiepromptservicensicookieservicensicookiestoragensicrashreporternsicryptohmacnsicryptohashnsicurrentcharsetlistenernsicyclecollectorlistenernsidbchangelistenernsidbfolderinfonsidnslistenernsidnsrecordnsidnsrequestnsidnsservicensidomcanvasrenderingcontext2dnsidomchromewindownsidomclientrectnsidomdesktopnotificationnsidomdesktopnotificationcenternsidomelementnsidomeventnsidomeventgroupnsidomeventlistenernsi...
...aviconservicensifeednsifeedcontainernsifeedelementbasensifeedentrynsifeedgeneratornsifeedpersonnsifeedprocessornsifeedprogresslistenernsifeedresultnsifeedresultlistenernsifeedtextconstructnsifilensifileinputstreamnsifileoutputstreamnsifilepickernsifileprotocolhandlernsifilespecnsifilestreamsnsifileurlnsifileutilitiesnsifileviewnsifocusmanagernsiformhistory2nsiframeloadernsiframeloaderownernsiframemessagelistenernsiframemessagemanagernsiframescriptloadernsigsettingscollectionnsigsettingsservicensigeolocationprovidernsigeolocationupdatensiglobalhistorynsiglobalhistory2nsiglobalhistory3nsihtmleditornsihttpheaderlistenernsihapticfeedbacknsihttpactivitydistributornsihttpactivityobservernsihttpchannelnsihttpchannelinternalnsihttpheadervisitornsihttpservernsihttpupgradelistenernsiidnservicensiiframeboxo...
...And 5 more matches
Version, UI, and Status Information - Plugins
« previousnext » this chapter describes the functions that allow a plug-in to display a message on the status line, get agent information, and check on the current version of the plug-in api and the browser.
... displaying a status line message users are accustomed to checking the ui status line at the bottom of the browser window for updates on the progress of an operation or the url of a link on the page.
... to accomplish this, the plug-in calls the npn_status method to display your message on the status line.
...And 5 more matches
AesCtrParams - Web APIs
aes is a block cipher, meaning that it splits the message into blocks and encrypts it a block at a time.
... in ctr mode, every time a block of the message is encrypted, an extra block of data is mixed in.
... a given counter block value must never be used more than once with the same key: given a message n blocks long, a different counter block must be used for every block.
...And 5 more matches
Key Values - Web APIs
keyboardevent.key value description virtual keycode windows mac linux android "close" [1] closes the current document or message.
... appcommand_close gdk_key_close (0x1008ff56) qt::key_close (0x010000ce) keycode_media_close (128) "new" [1] creates a new document or message.
... appcommand_new gdk_key_new (0x1008ff68) qt::key_new (0x01000120) "open" [1] opens an existing document or message.
...And 5 more matches
RTCDataChannel - Web APIs
these labels are not required to be unique.maxpacketlifetime read only the read-only rtcdatachannel property maxpacketlifetime returns the amount of time, in milliseconds, the browser is allowed to take to attempt to transmit a message, as set when the data channel was created, or null.maxretransmits read only the read-only rtcdatachannel property maxretransmits returns the maximum number of times the browser should try to retransmit a message before giving up, as set when the data channel was created, or null, which indicates that there is no maximum.negotiated read only the read-only rtcdatachannel property negotiated indic...
...ates whether the rtcdatachannel's connection was negotiated by the web app (true) or by the webrtc layer (false).ordered read only the read-only rtcdatachannel property ordered indicates whether or not the data channel guarantees in-order delivery of messages; the default is true, which indicates that the data channel is indeed ordered.protocol read only the read-only rtcdatachannel property protocol returns a domstring containing the name of the subprotocol in use.
...when an error occurs on the data channel, the function receives as input an errorevent object describing the error which occurred.onmessage the rtcdatachannel.onmessage property stores an eventhandler which specifies a function to be called when the message event is fired on the channel.
...And 5 more matches
Writing WebSocket client applications - Web APIs
the browser may also output to its console a more descriptive error message as well as a closing code as defined in rfc 6455, section 7.4 through the closeevent.
...to do this, simply call the websocket object's send() method for each message you want to send: examplesocket.send("here's some text that the server is urgently awaiting!"); you can send data as a string, blob, or arraybuffer.
...for example, a chat program can interact with a server using a protocol implemented using packets of json-encapsulated data: // send text to all users through the server function sendtext() { // construct a msg object containing the data the server needs to process the message from the chat client.
...And 5 more matches
self - Archive of obsolete content
data is available to the content script in the options property of self: // main.js const tabs = require("sdk/tabs"); tabs.open({ url: "./page.html", onready: function(tab) { tab.attach({ contentscriptfile: "./content-script.js", contentscriptoptions: { a: "blah" } }); } }); // content-script.js alert(self.options.a); port you can use port to receive messages from, and send messages to, the main add-on code.
... methods the self object has four methods, which enable the content script to send messages to, and receive messages from, the main add-on code.
...the exception is the context-menu module, which still uses postmessage.
...And 4 more matches
page-mod - Archive of obsolete content
communicating with content scripts your add-on's "main.js" can't directly access the state of content scripts you load, but you can communicate between your add-on and its content scripts by exchanging messages.
...the listener is passed a worker object that your add-on can use to send and receive messages.
...it adds a listener to the getelements message.
...And 4 more matches
Add a Context Menu Item - Archive of obsolete content
when it's clicked, the selection is sent to the main add-on code, which just logs it: var contextmenu = require("sdk/context-menu"); var menuitem = contextmenu.item({ label: "log selection", context: contextmenu.selectioncontext(), contentscript: 'self.on("click", function () {' + ' var text = window.getselection().tostring();' + ' self.postmessage(text);' + '});', onmessage: function (selectiontext) { console.log(selectiontext); } }); try it: run the add-on, load a web page, select some text and right-click.
...the constructor in this case takes four options: label, context, contentscript, and onmessage.
...in this case the script listens for the user to click on the item, then sends a message to the add-on containing the selected text.
...And 4 more matches
Chapter 5: Let's build a Firefox extension - Archive of obsolete content
listing 9: content for clock.dtd locale\en-us\clock.dtd: <!entity helloworld.clock "clock"> <!entity helloworld.currenttime "current time"> locale\fr-fr\clock.dtd: <!entity helloworld.clock "horloge"> <!entity helloworld.currenttime "heure courante"> replacing user interface messages within javascript files with properties references it may happen your extension displays some useful messages such as alerts to the user.
...something like : wrongpassmessage=invalid password areyousuremessage=are you sure?
..."].getservice(components.interfaces.nsistringbundleservice); var _bundle = gmyextensionbundle.createbundle("chrome://myextension/locale/myextension.properties") you can now use your string substitutes in the .js where they are needed: see examples below if ( password == userpassword ) { oprefs.setboolpref("access.authenticated", true); } else { alert (_bundle.getstringfromname("wrongpassmessage")); function clear() { sure = confirm(_bundle.getstringfromname("areyousuremessage")); } operations check this brings us to the operations check.
...And 4 more matches
Plug-in Development Overview - Gecko Plugin API Reference
for more information about mime types, see these mime rfcs: rfc-2045: "multipurpose internet mail extensions (mime) part one: format of internet message bodies" rfc-2046: "multipurpose internet mail extensions (mime) part two: media types" rfc-4288: "media type specifications and registration procedures" there are some variations to how plug-ins are handled on different platforms.
...for example, this description list corresponds to the types in the previous example: string 1: "quicktime video", string 4: "aiff audio", and string 5: "jpeg image format." str#' 126: string 1 can contain a descriptive message about the plug-in.
... this message, which is in html format, is displayed by the browser in its "about plug-ins" page.
...And 4 more matches
Frame script environment
the frame script's global is a contentframemessagemanager, giving it the following environment: content the dom window of the content loaded in the browser.
... addmessagelistener() listen to messages from chrome.
... removemessagelistener() stop listening to messages from chrome.
...And 4 more matches
Frame script environment
the frame script's global is a contentframemessagemanager, giving it the following environment: content the dom window of the content loaded in the browser may be null (see below) docshell the nsidocshell associated with the browser.
... addmessagelistener() listen to messages from chrome.
... removemessagelistener() stop listening to messages from chrome.
...And 4 more matches
IME handling guide
its message is one of following values: ecompositionstart this is dispatched at starting a composition.
...mranges should not be empty only with this message.
... table of event messages meaning of mdata who sets mdata?
...And 4 more matches
WebChannel.jsm
the webchannel.jsm javascript code module provides an abstraction that uses the message manager and custom events apis to create a two-way communication channel between chrome and content code for specific origins (using a specific origin passed to the constructor or a lookup with nsipermissionmanager while also ensuring the scheme is https).
... method overview listen(function callback); stoplistening(); send(object message, eventtarget target); attributes id string webchannel id methods listen() registers the callback for messages on this channel.
... parameters callback callback function containing function(id, message, sendercontext) parameters.
...And 4 more matches
nsIMsgIncomingServer
g attr); acstring getcharattribute(in string name); acstring getcharvalue(in string attr); nsilocalfile getfilevalue(in string relpref, in string abspref); nsimsgfilterlist getfilterlist(in nsimsgwindow amsgwindow); long getintattribute(in string name); long getintvalue(in string attr); nsimsgfolder getmsgfolderfromuri(in nsimsgfolder afolderresource, in acstring auri); void getnewmessages(in nsimsgfolder afolder, in nsimsgwindow amsgwindow, in nsiurllistener aurllistener); acstring getpasswordwithui(in astring apromptstring, in astring aprompttitle, in nsimsgwindow amsgwindow, out boolean okayvalue); astring getunicharattribute(in string name); astring getunicharvalue(in string attr); boolean isnewhdrduplicate(in nsimsgdbhdr anewhdr); void onuserorhostnamechanged(in a...
... canfilemessagesonserver boolean canhavefilters boolean read only.
... cansearchmessages boolean read only.
...And 4 more matches
nsIMsgSearchTerm
illa/ mailnews/ base/ search/ public/ nsimsgsearchterm.idl attributes attrib attribute nsmsgsearchattribvalue attrib; op attribute nsmsgsearchopvalue op; value attribute nsimsgsearchvalue value; booleanand attribute boolean booleanand; arbitraryheader attribute acstring arbitraryheader; hdrproperty /** * not to be confused with arbitraryheader, which is a header in the * rfc822 message.
... this is a property of the nsimsgdbhdr, and may have * nothing to do the message headers, e.g., gloda-id.
...ty boolean matchpriority(in nsmsgpriorityvalue priority); matchage boolean matchage(in prtime days); matchsize boolean matchsize(in unsigned long size); matchlabel boolean matchlabel(in nsmsglabelvalue alabelvalue); matchjunkstatus boolean matchjunkstatus(in string ajunkscore); matchjunkpercent /* * test search term match for junkpercent * * @param ajunkpercent junkpercent for message (0-100, 100 is junk) * @return true if matches */ boolean matchjunkpercent(in unsigned long ajunkpercent); matchjunkscoreorigin /* * test search term match for junkscoreorigin * @param ajunkscoreorigin who set junk score?
...And 4 more matches
nsIWorkerScope
1.0 66 introduced gecko 1.9.1 inherits from: nsiworkerglobalscope last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void postmessage(in domstring amessage, [optional] in nsiworkermessageport amessageport); void close(); attributes attribute type description onclose nsidomeventlistener a listener object to be called when the worker stops running.
... onmessage nsidomeventlistener a listener object to be called when a message is posted on the port.
... the message is in the event's data member.
...And 4 more matches
Cached compose window FAQ
any new window performance problems that mozilla has are especially painful in mail compose, as we need to create a new compose window on every new mail message or reply.
... to test it start mozilla do new message.
...(the compose window is now cached) do new message again.
...And 4 more matches
Plug-in Development Overview - Plugins
for more information about mime types, see these mime rfcs: rfc-2045: "multipurpose internet mail extensions (mime) part one: format of internet message bodies" rfc-2046: "multipurpose internet mail extensions (mime) part two: media types" rfc-4288: "media type specifications and registration procedures" there are some variations to how plug-ins are handled on different platforms.
...for example, this description list corresponds to the types in the previous example: string 1: "quicktime video", string 4: "aiff audio", and string 5: "jpeg image format." str#' 126: string 1 can contain a descriptive message about the plug-in.
... this message, which is in html format, is displayed by the browser in its "about plug-ins" page.
...And 4 more matches
Inspecting web sockets - Firefox Developer Tools
filtering web socket frames to focus on specific messages, frames can be filtered using the filter at the top of the messages panel.
... the following filters are available: all displays all messages (by default, except control messages).
... sent displays only messages sent by the browser (by default, except control messages).
...And 4 more matches
Waterfall - Firefox Developer Tools
event type for example, "click" or "message".
... worker event in main thread shown when the main thread sends a message to a worker, or receives a message from a worker.
... one of: serialize data on the main thread the main thread is serializing a message to be sent to the worker.
...And 4 more matches
RTCDataChannel.send() - Web APIs
different browsers have different limitations on the size of the message you can send.
... specifications exist to define how to automatically fragment large messages, but not all browsers implement them, and those that do have various additional restrictions.
... this will get less complicated over time, but for now, if you have questions, see understanding message size limits in using webrtc data channels.
...And 4 more matches
SubtleCrypto.deriveKey() - Web APIs
possible values of the array are: encrypt: the key may be used to encrypt messages.
... decrypt: the key may be used to decrypt messages.
... sign: the key may be used to sign messages.
...And 4 more matches
Web NFC API - Web APIs
the web nfc api allows exchanging data over nfc via light-weight nfc data exchange format (ndef) messages.
... interfaces ndefmessage interface that represents ndef messages that can be received from or sent to a compatible device or tag via ndefreader and ndefwriter objects respectively.
... a message is composed of metadata and ndef records.
...And 4 more matches
Synchronous and asynchronous requests - Web APIs
if an error occurred, an error message is displayed.
...*/) { var xhr = new xmlhttprequest(); xhr.callback = callback; xhr.arguments = array.prototype.slice.call(arguments, 2); xhr.onload = xhrsuccess; xhr.onerror = xhrerror; xhr.open("get", url, true); xhr.send(null); } usage: function showmessage(message) { console.log(message + this.responsetext); } loadfile("message.txt", showmessage, "new message!\n\n"); the signature of the utility function loadfile declares (i) a target url to read (via an http get request), (ii) a function to execute on successful completion of the xhr operation, and (iii) an arbitrary list of additional arguments that are passed through the xhr object (via t...
...it, in turn, invokes the callback function specified in the invocation of the loadfile function (in this case, the function showmessage) which has been assigned to a property of the xhr object (line 11).
...And 4 more matches
<input type="url"> - HTML: Hypertext Markup Language
WebHTMLElementinputurl
it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message.
...in our simplified form, the user needs to enter the url of the page that has a problem, and a message describing what is wrong.
...that's because the title may be displayed or spoken as part of a validation error message.
...And 4 more matches
HTTP headers - HTTP
WebHTTPHeaders
end-to-end headers these headers must be transmitted to the final recipient of the message: the server for a request, or the client for a response.
... if viewport-width occurs in a message more than once, the last value overrides all previous occurrences.
...if width occurs in a message more than once, the last value overrides all previous occurrences conditionals last-modified the last modification date of the resource, used to compare several versions of the same resource.
...And 4 more matches
Planned changes to shared memory - JavaScript
there is standardization work ongoing that enables developers to create sharedarraybuffer objects again, but changes are needed in order to be use these across threads (i.e., postmessage() for sharedarraybuffer objects throws by default).
... for top-level documents, two headers will need to be set: cross-origin-opener-policy with same-origin as value (protects your origin from attackers) cross-origin-embedder-policy with require-corp as value (protects victims from your origin) with these two headers set, postmessage() will no longer throw for sharedarraybuffer objects and shared memory across threads is therefore available.
... unless the two headers mentioned above are set, the various postmessage() apis will throw for sharedarraybuffer objects.
...And 4 more matches
notifications - Archive of obsolete content
display transient, toaster-style desktop messages to the user.
...when the message is clicked, a string is logged to the console.
... parameters options : object optional options: name type title string a string to display as the message's title.
...And 3 more matches
Storing annotations - Archive of obsolete content
torid = anchor[1]; this.anchortext = anchor[2]; } now we need to link this code to the annotation editor, so that when the user presses the return key in the editor, we create and store the new annotation: var annotationeditor = panels.panel({ width: 220, height: 220, contenturl: data.url('editor/annotation-editor.html'), contentscriptfile: data.url('editor/annotation-editor.js'), onmessage: function(annotationtext) { if (annotationtext) handlenewannotation(annotationtext, this.annotationanchor); annotationeditor.hide(); }, onshow: function() { this.postmessage('focus'); } }); listing stored annotations to prove that this works, let's implement the part of the add-on that displays all the previously entered annotations.
... this is implemented as a panel that's shown in response to the widget's right-click message.
... annotation list content script here's the annotation list's content script: self.on("message", function onmessage(storedannotations) { var annotationlist = $('#annotation-list'); annotationlist.empty(); storedannotations.foreach( function(storedannotation) { var annotationhtml = $('#template .annotation-details').clone(); annotationhtml.find('.url').text(storedannotation.url) .attr('href', storedannotation.url); annotationhtml.find('.url...
...And 3 more matches
Display a Popup - Archive of obsolete content
you can run content scripts in the panel: although the script running in the panel can't directly access your main add-on code, you can exchange messages between the panel script and the add-on code.
...the main add-on code logs the message to the console.
...text_entry.on("show", function() { text_entry.port.emit("show"); }); // listen for messages called "text-entered" coming from // the content script.
...And 3 more matches
Interaction between privileged and non-privileged pages - Archive of obsolete content
note: if you're using html5's postmessage() to send a message from unprivileged code to privileged code, adding 'true' to the end of your event listener in your privileged chrome code will allow the message to be received.
... document.addeventlistener("message", function(e) { yourfunction(e); }, false, true); sending data from chrome to unprivileged document to "answer" the web page (e.g., return code), your extension can set an attribute or attach child elements on the event target element (<myextensiondataelement/> in this example).
...in the following code sample 2 methods are combined: setting an extra attribute in the original event target element, and creating a new event message with a new event target element.
...And 3 more matches
Handling Preferences - Archive of obsolete content
as the warning message states, you should be very careful when changing preferences.
...the contents of the file are fairly simple: // amount of messages shown to the user.
... pref("extensions.xulschoolhello.message.count", 0); this defines a preference we'll use to keep track of the amount of times we have displayed a greeting message to the user.
...And 3 more matches
The Essentials of an Extension - Archive of obsolete content
sayhello : function(aevent) { let stringbundle = document.getelementbyid("xulschoolhello-string-bundle"); let message = stringbundle.getstring("xulschoolhello.greeting.label"); window.alert(message); } and, finally, this is our function declaration.
...we call the getstring method of the bundle element and get the localized message to be displayed.
... we then call the window.alert function with the message, just like we would do in an html document.
...And 3 more matches
User Notifications and Alerts - Archive of obsolete content
notification boxes are very easy to create, and are very customizable: let nb = gbrowser.getnotificationbox(); let acceptbutton = new object(); let declinebutton = new object(); let message = this._bundle.getstring("xulschoolhello.friendmessage.label"); let that = this; acceptbutton.label = this._bundle.getstring("xulschoolhello.acceptbutton.label"); acceptbutton.accesskey = this._bundle.getstring("xulschoolhello.acceptbutton.accesskey"); acceptbutton.popup = null; acceptbutton.callback = function() { that.acceptrequest(); }; // similarly for decline button.
... nb.appendnotification( message, "xulschoolhello-friend-notification", "chrome://xulschoolhello/skin/friend-notification.png", nb.priority_info_high, [ acceptbutton, declinebutton ]); all browser tabs have a notification box by default, so you don't need to do any overlaying.
...the appendnotification method takes the message, id, image (32x32), level and buttons.
...And 3 more matches
SeaMonkey - making custom toolbar (SM ver. 1.x) - Archive of obsolete content
<rdf:li> <rdf:seq about="chrome://navigator/content/navigator.xul"> <rdf:li>chrome://custombutton/content/button.xul</rdf:li> </rdf:seq> </rdf:li> <!-- address book --> <rdf:li> <rdf:seq about="chrome://messenger/content/addressbook/addressbook.xul"> <rdf:li>chrome://custombutton/content/button.xul</rdf:li> </rdf:seq> </rdf:li> <!-- message --> <rdf:li> <rdf:seq about="chrome://messenger/content/messagewindow.xul"> <rdf:li>chrome://custombutton/content/button.xul</rdf:li> </rdf:seq> </rdf:li> <!-- message compose --> <rdf:li> <rdf:seq about="chrome://messenger/content/messengercompose/messengercompose.xul"> <rdf:li>chrome://custombutton/content/button.xul</rdf:li> </rdf:seq> ...
...xul"> <script type="application/javascript" src="chrome://custombutton/content/button.js"/> <!-- browser --> <toolbar id="nav-bar"> <hbox id="nav-bar-buttons"> <toolbarbutton id="custom-button-1"/> </hbox> </toolbar> <!-- address book --> <toolbar id="abtoolbar"> <hbox id="toolbar_button_box"> <toolbarbutton id="custom-button-1" position="8"/> </hbox> </toolbar> <!-- message compose --> <toolbar id="composetoolbar"> <hbox id="toolbar_button_box"> <toolbarbutton id="custom-button-1" position="8"/> </hbox> </toolbar> <!-- mail, message --> <hbox id="toolbar_button_box"> <toolbarbutton id="custom-button-1" position="15"/> </hbox> <!-- composer --> <toolbar id="edittoolbar"> <toolbarbutton id="custom-button-1" position="18"/> </toolbar> <!-- chat -...
...you should see the pop-up message.
...And 3 more matches
SSL and TLS - Archive of obsolete content
an ssl/tls session always begins with an exchange of messages called the ssl handshake, initial communication between the server and client.
... supported cipher suites for rsa cipher suites with the rsa key exchange that are commonly supported include the following: aes and sha message authentication.
... triple des and sha message authentication.
...And 3 more matches
Theme changes in Firefox 2 - Archive of obsolete content
if no updates are found, this icon is displayed at the left side of the message strip that appears across the top of the window.
...s-button:active #forward-button[buttondown="true"] #history-button:active #home-button:active #mail-button #mail-button:active #mail-button[disabled="true"] #mail-button[open="true"] #new-tab-button:active #new-tab-button[checked="true"] #new-window-button:active #new-window-button[checked="true"] #paste-button:active #print-button:active #reload-button:active #stop-button:active .messagebutton .messageimage .messagetext browsermessage toolbar[iconsize="small"] #bookmarks-button:active toolbar[iconsize="small"] #copy-button:active toolbar[iconsize="small"] #cut-button:active toolbar[iconsize="small"] #downloads-button:active toolbar[iconsize="small"] #history-button:active toolbar[iconsize="small"] #home-button:active toolbar[iconsize="small"] #mail-button toolbar[icons...
...the following styles must be implemented to support the window that appears when the user browses to a suspected phishing site: #safebrowsing-dim-area-canvas #safebrowsing-page-canvas #safebrowsing-palm-close #safebrowsing-palm-close-container #safebrowsing-palm-google-logo #safebrowsing-palm-message #safebrowsing-palm-message-actionbox #safebrowsing-palm-message-content #safebrowsing-palm-message-tail #safebrowsing-palm-message-tail-container #safebrowsing-palm-message-titlebox .safebrowsing-palm-bigtext .safebrowsing-palm-fixed-width .safebrowsing-palm-paragraph .safebrowsing-palm-smalltext the following styles are used to display, in the url bar, an indicator of whether or not t...
...And 3 more matches
XForms Alert Element - Archive of obsolete content
introduction this message will be shown when the form control cannot properly bind to instance data or when the instance data value is invalid or out of the specified range of selectable values (see the spec).
... the message of the alert element can exist in instance data, in a remote document, or as inline text.
... if more than one source of message is specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text.
...And 3 more matches
How does the Internet work? - Learn web development
this router has only one job: like a signaler at a railway station, it makes sure that a message sent from a given computer arrives at the right destination computer.
... to send a message to computer b, computer a must send the message to the router, which in turn forwards the message to computer b and makes sure the message is not delivered to computer c.
...the next step is to send the messages from our network to the network we want to reach.
...And 3 more matches
Your first form - Learn web development
we are asking the user for their name, their e-mail and the message they want to send.
... the input field for the message is a <textarea>; a multiline text field.
... in terms of html code we need something like the following to implement these form widgets: <form action="/my-handling-form-page" method="post"> <ul> <li> <label for="name">name:</label> <input type="text" id="name" name="user_name"> </li> <li> <label for="mail">e-mail:</label> <input type="email" id="mail" name="user_email"> </li> <li> <label for="msg">message:</label> <textarea id="msg" name="user_message"></textarea> </li> </ul> </form> update your form code to look like the above.
...And 3 more matches
JavaScript basics - Learn web development
if values couldn't change, then you couldn't do anything dynamic, like personalize a greeting message or change an image displayed in an image gallery.
... for example, the alert() function makes a pop-up box appear inside the browser window, but we need to give it a string as an argument to tell the function what message to display.
... adding a personalized welcome message next, let's change the page title to a personalized welcome message when the user first visits the site.
...And 3 more matches
mach
running from the root of the source tree checkout, you should just be able to type: $ ./mach if all is well, you should see a help message.
... of course, in a random dir you just get a cryptic error message to improve the experience.
... for full help: $ ./mach help try building the tree: $ ./mach build if you get error messages, make sure that you have all of the build requisites for your system.
...And 3 more matches
Limitations of chrome scripts
to make the shim unnecessary: factor the code that needs to access content into a separate script, load that script into the content process as a frame script, and communicate between the chrome script and the frame script using the message-passing apis.
... see the article on using the message manager.
... the correct way to access the dom window is through a message manager.
...And 3 more matches
IPDL Best Practices
are you sending the __delete__ message to trigger protocol deletion?
...using ipdl generated structs as data structures outside of ipc serialization/deserialization ipdl generated structures are meant to facilitate serialization/deserialization and message passing.
...minimize overall use of messages reducing ipc traffic is a righteous goal.
...And 3 more matches
Localizing with Mercurial
if you see a message about the version of mercurial (e.g.
...if you see a message about the version of mercurial (e.g.
...if you see a message about the version of mercurial (e.g.
...And 3 more matches
gettext
for instance, in php the default keyword for regular messages is gettext() and _().
... for messages with plural support, the default keyword is ngettext().
... the string definition in the messages.po file will look like this: #: file.php:3 #, php-format msgid "%d user likes this." msgid_plural "%d users like this." msgstr[0] "" msgstr[1] "" depending on the localizer's target language and its rules for creating plural forms, there might be another field for translation, e.g.
...And 3 more matches
Observer Notifications
message manager topic subject data description message-manager-disconnect nsicontentframemessagemanager null this notification is sent when a message manager disconnects.
... the subject of the notification is the message manager that disconnected.
... if you're using a message manager to communicate with a script that may be running in a different process, you might need to know when the message manager has disconnected from the other end of the conversation, so you can stop sending it messages or expecting to receive messages.
...And 3 more matches
nsIMsgDBViewCommandUpdater
last changed in gecko 1.9 (firefox 3) inherits from: nsisupports in thunderbird this is implemented for different windows in several different places: nsmsgdbviewcommandupdater (for the standalone message window) nsmsgdbviewcommandupdater (for the threadpane message window) nsmsgsearchcommandupdater (for search dialogs) method overview void updatecommandstatus(); void displaymessagechanged(in nsimsgfolder afolder, in astring asubject, in acstring akeywords); void updatenextmessageafterdelete(); methods updatecommandstatus() called when the number of selected items changes.
... displaymessagechanged() called when the displayed message has changed.
... void displaymessagechanged(in nsimsgfolder afolder, in astring asubject, in acstring akeywords ); parameters afolder the folder containing selected message.
...And 3 more matches
nsIMsgWindowCommands
mailnews/base/public/nsimsgwindow.idlscriptable this interface defines methods used by the back end to update the user interface in a mail or news message list.
...method overview void selectfolder(in acstring folderuri); void selectmessage(in acstring messageuri); void clearmsgpane(); methods selectfolder() this method is called by the backend to change the folder displayed in the message window.
... selectmessage() this method is called by the backend to change the displayed message.
...And 3 more matches
nsIProcessScriptLoader
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsisupports this interface is used by parent process message managers to load scripts into a child process.
...the global object for process scripts is a contentprocessmessagemanager.
... if this function is called on a chromemessagebroadcaster, : it will load the process script into all child processes.
...And 3 more matches
nsIRadioInterfaceLayer
terfaces.nsiinterfacerequestor) .createinstance(components.interfaces.nsiradiointerfacelayer); method overview void answercall(in unsigned long callindex); void deactivatedatacall(in domstring cid, in domstring reason); void dial(in domstring number); void enumeratecalls(in nsiriltelephonycallback callback); void getdatacalllist(); unsigned short getnumberofmessagesfortext(in domstring text); void hangup(in unsigned long callindex); void registercallback(in nsiriltelephonycallback 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 ...
...exceptions thrown missing exception missing description getnumberofmessagesfortext() returns the number of multi-part sms needed for a given text (160 characters for one sms).
... unsigned short getnumberofmessagesfortext( in domstring text ); parameters text the body text of an sms.
...And 3 more matches
nsIStringBundleService
ervice, use: var stringbundleservice = components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice); method overview nsistringbundle createbundle(in string aurlspec); nsistringbundle createextensiblebundle(in string aregistrykey); void flushbundles(); wstring formatstatusmessage(in nsresult astatus, in wstring astatusarg); methods createbundle() nsistringbundle createbundle( in string aurlspec ); parameters aurlspec the url of the properties file to load.
... formatstatusmessage() formats a message string from a status code and status arguments.
... typically used to format a message received by a nsiprogresseventsink's onstatus method.
...And 3 more matches
XPCOM Interface Reference by grouping
browser autocomplete nsiautocompletecontroller nsiautocompleteinput nsiautocompletesearch console nsiconsolelistener nsiconsolemessage nsiconsoleservice document nsidocshell dom device nsidomgeogeolocation nsidomgeoposition nsidomgeopositionaddress nsidomgeopositioncallback nsidomgeopositioncoords nsidomgeopositionerror nsidomgeopositionerrorcallback nsidomgeopositionoptions nsidomglobalpropertyinitializer element nsidomchromewindow nsidomclientrect ...
...essibleeditabletext nsiaccessibleevent nsiaccessiblehyperlink nsiaccessiblehypertext nsiaccessibleimage nsiaccessibleprovider nsiaccessibleretrieval nsiaccessiblerole nsiaccessiblescrolltype nsiaccessibleselectable nsiaccessiblestates nsiaccessibletable nsiaccessibletext nsiaccessibletreecache nsiaccessiblevalue nsiaccessnode nsisyncmessagesender script nsiscriptableunescapehtml nsiscriptableunicodeconverter nsiscripterror nsiscripterror2 stylesheet nsistylesheetservice url nsiuri nsiurl util nsidomserializer nsidomxpathevaluator nsidomxpathexception nsidomxpathexpression nsidomxpathresult xslt nsixsltexception nsixsltprocessor downl...
...oad nsidownload nsidownloadmanager nsidownloadprogresslistener element internal nsiworker nsiworkerglobalscope nsiworkermessageevent nsiworkermessageport nsiworkerscope tree nsitreeboxobject nsitreecolumn nsitreecolumns nsitreecontentview nsitreeselection nsitreeview xform nsixformsmodelelement nsixformsnsinstanceelement nsixformsnsmodelelement xmlhttprequest nsixmlhttprequesteventtarget favicon nsifavicondatacallback nsifaviconservice frame nsichromeframemessagemanager nsiframeloader nsiframeloaderowner nsiframemessagelistener nsiframemessagemanager interface nsijsxmlhttprequest jetpack nsijetpack nsijetpackservice ...
...And 3 more matches
customDBHeaders Preference
in addition to the preference outlined in setting up extension development environment, you'll want to add the following preferences: // this allows you to add extra headers while composing messages user_pref("mail.compose.other.header", "x-superfluous,x-other,x-whatever"); // this enables the preservation of custom headers as incoming mail is processed user_pref( "mailnews.customdbheaders", "x-superfluous,x-other"); important: please pay careful attention to the case of the mailnews.customdbheaders preference.
... because comparisons are case-insensitive, all of the custom headers get set to lowercase when the data gets migrated to the message database.
... javascript code once again, other tutorials have demonstrated the general javascript code used to populated columns with data from a message header, so i'm just including my file for reference.
...And 3 more matches
Thunderbird extensions
functions for dealing with messages (delete, archive, change tags, etc.) are included.
...gloda provides concepts such as conversations, messages, identities, contacts.
... all these concepts are related : a conversation contains messages which are linked to identities (from field, to field) which are themselves part of a contact: indeed, a contact has multiple identities.
...And 3 more matches
WebIDL bindings
each new tag requires that a localized string be defined, containing the deprecation message to display.
... throwtypeerror: allows throwing a typeerror with the given error message.
... the list of allowed typeerrors and corresponding messages is in dom/bindings/errors.msg.
...And 3 more matches
Web Console UI Tour - Firefox Developer Tools
funnel: click this icon to filter the messages that are displayed in the console.
... filter categories: you can click a filter category (such as errors, warnings, css, or xhr) to display just those types of messages.
... show timestamps: when enabled, timestamps are shown on the left-hand side of each message row to say when the messages were logged.
...And 3 more matches
Broadcast Channel API - Web APIs
by creating a broadcastchannel object, you can receive any messages that are posted to it.
... // connection to a broadcast channel const bc = new broadcastchannel('test_channel'); sending a message it is enough to call the postmessage() method on the created broadcastchannel object, which takes any object as an argument.
... an example string message: // example of sending of a very simple message bc.postmessage('this is a test message.'); any kind of object can be sent, not just a domstring.
...And 3 more matches
console - Web APIs
WebAPIConsole
methods console.assert() log a message and stack trace to console if the first argument is false.
... console.debug() outputs a message to the console with the log level debug.
... console.error() outputs an error message.
...And 3 more matches
RTCPeerConnection.createDataChannel() - Web APIs
options optional an rtcdatachannelinit dictionary providing configuration options for the data channel rtcdatachannelinit dictionary the rtcdatachannelinit dictionary provides the following fields, any of which may be included in the object passed as the options parameter in order to configure the data channel to suit your needs: ordered optional indicates whether or not messages sent on the rtcdatachannel are required to arrive at their destination in the same order in which they were sent (true), or if they're allowed to arrive out-of-order (false).
... maxpacketlifetime optional the maximum number of milliseconds that attempts to transfer a message may take in unreliable mode.
... maxretransmits optional the maximum number of times the user agent should attempt to retransmit a message which fails the first time in unreliable mode.
...And 3 more matches
SharedWorker - Web APIs
sharedworker.port read only returns a messageport object used to communicate with and control the shared worker.
...both scripts contain this: var myworker = new sharedworker('worker.js'); both scripts then access the worker through a messageport object created using the sharedworker.port property.
... 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.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'); } inside the worker we use the sharedworkerglobalscope.onconnect handler to connect to the same port discussed above.
...And 3 more matches
Web APIs
WebAPI
half_float ext_disjoint_timer_query ext_float_blend ext_frag_depth ext_srgb ext_shader_texture_lod ext_texture_compression_bptc ext_texture_compression_rgtc ext_texture_filter_anisotropic eckeygenparams eckeyimportparams ecdhkeyderiveparams ecdsaparams effecttiming element elementcssinlinestyle elementtraversal errorevent event eventlistener eventsource eventtarget extendableevent extendablemessageevent f featurepolicy federatedcredential fetchevent file fileentrysync fileerror fileexception filelist filereader filereadersync filerequest filesystem filesystemdirectoryentry filesystemdirectoryreader filesystementry filesystementrysync filesystemfileentry filesystemflags filesystemsync focusevent fontface fontfaceset fontfacesetloadevent formdata formdataentryva...
...rver intersectionobserverentry interventionreportbody k keyboard keyboardevent keyboardlayoutmap keyframeeffect keyframeeffectoptions l largestcontentfulpaint layoutshift layoutshiftattribution linearaccelerationsensor linkstyle localfilesystem localfilesystemsync localmediastream location lock lockmanager lockedfile m midiaccess midiconnectionevent midiinput midiinputmap midimessageevent midioutputmap mscandidatewindowhide mscandidatewindowshow mscandidatewindowupdate msgestureevent msgraphicstrust msmanipulationevent msrangecollection mssitemodeevent magnetometer mathmlelement mediacapabilities mediacapabilitiesinfo mediaconfiguration mediadecodingconfiguration mediadeviceinfo mediadevices mediaelementaudiosourcenode mediaencodingconfiguration mediaerror media...
...image mediakeymessageevent mediakeysession mediakeystatusmap mediakeysystemaccess mediakeysystemconfiguration mediakeys medialist mediametadata mediapositionstate mediaquerylist mediaquerylistevent mediaquerylistlistener mediarecorder mediarecordererrorevent mediasession mediasessionactiondetails mediasettingsrange mediasource mediastream mediastreamaudiodestinationnode mediastreamaudiosourcenode mediastreamaudiosourceoptions mediastreamconstraints mediastreamevent mediastreamtrack mediastreamtrackaudiosourcenode mediastreamtrackaudiosourceoptions mediastreamtrackevent mediatrackconstraints mediatracksettings mediatracksupportedconstraints merchantvalidationevent messagechannel messageevent messageport metadata mimetype mimetypearray mouseevent mousescrollevent mousewheelevent mutatio...
...And 3 more matches
CORS errors - HTTP
WebHTTPCORSErrors
in these pages, we'll look into some common cors error messages and how to resolve them.
... now try to reproduce the failing transaction and check the console if you are seeing a cors violation error message.
... it will probably look like this: the text of the error message will be something similar to the following: cross-origin request blocked: the same origin policy disallows reading the remote resource at https://some-url-here.
...And 3 more matches
HTTP response status codes - HTTP
WebHTTPStatus
the meaning of the success depends on the http method: get: the resource has been fetched and is transmitted in the message body.
... head: the entity headers are in the message body.
... put or post: the resource describing the result of the action is transmitted in the message body.
...And 3 more matches
Error - JavaScript
instance properties error.prototype.message error message.
...similar to message.
...you can handle the error using the try...catch construct: try { throw new error('whoops!') } catch (e) { console.error(e.name + ': ' + e.message) } handling a specific error you can choose to handle only specific error types by testing the error type with the error's constructor property or, if you're writing for modern javascript engines, instanceof keyword: try { foo.bar() } catch (e) { if (e instanceof evalerror) { console.error(e.name + ': ' + e.message) } else if (e instanceof rangeerror) { console.error(e.name + ':...
...And 3 more matches
event/core - Archive of obsolete content
an event listener may be registered to any event target using the on function: var { on, once, off, emit } = require('sdk/event/core'); var target = { name: 'target' }; on(target, 'message', function listener(event) { console.log('hello ' + event); }); on(target, 'data', console.log); an event of a specific type may be emitted on any event target object using the emit function.
... emit(target, 'message', 'event'); // info: 'hello event' emit(target, 'data', { type: 'data' }, 'second arg'); // info: [object object] 'second arg' registered event listeners may be removed using off function: off(target, 'message'); emit(target, 'message', 'bye'); // info: 'hello bye' sometimes listener only cares about first event of specific type.
...all listeners of the specific type can be easily removed (only two argument must be passed): off(target, 'message'); also, removing all registered listeners is possible (only one argument must be passed): off(target); globals functions on(target, type, listener) registers an event listener that is called every time events of the specified type is emitted on the given event target.
...And 2 more matches
util/deprecate - Archive of obsolete content
globals functions deprecatefunction(fun, msg) dump to the console the error message given in the second argument, prefixed with "deprecated:", and print the stacktrace; then execute the function passed as first argument and returns its value.
... it does not raise an exception, but just displays the error message and continues to execute the function.
... parameters fun : function the function to execute after the error message msg : string the error message to display returns * : the returned value from fun deprecateusage(msg) dump to the console the error message given, prefixed with "deprecated:", and print the stacktrace.
...And 2 more matches
Modifying the Page Hosted by a Tab - Archive of obsolete content
l scripts", icon: "./icon-16.png", onclick: function () { tabs.activetab.attach({ contentscriptfile: [self.data.url('first.js'), self.data.url('second.js')] }); } }); communicating with the content scripts your add-on script and content scripts can't directly access each other's variables or call each other's functions, but they can send each other messages.
... to send a message from one side to the other, sender calls port.emit() and receiver listens using port.on().
... in the add-on script, tab.attach() returns a worker object containing the port property you use to send messages to the content script.
...And 2 more matches
Inner-browsing extending the browser navigation paradigm - Archive of obsolete content
good candidates for inner-browsing include a spell check application, in which the text entered in a web page is checked as it is typed; a webmail application that uses the inner-browsing model to display the separate messages and message lists in an integrated way, much like a client mail app; and a stock ticker that spools the information across the web page.
...webmail application the flexibility to easily access and manage all message headers in mail applications (like netscape mail or eudora) is probably one of the useful features when compared with web-based mail applications.
... in general, when a webmail account has more than a few messages, clicking 'next page' sends a request to the server.
...And 2 more matches
Property Files - Archive of obsolete content
in addition, you may wish to display a message which is generated from a script, if, for example, you do not know the exact text to be displayed.
...resultmessage=%2$s files found in the %1$s directory.
...a line that begins with a hash sign ('#') is treated as a comment: # this is a comment welcomemessage=hello, world!
...And 2 more matches
Debugging a XULRunner Application - Archive of obsolete content
if you would like the console messages to appear in the console you used to launch the application, you can use the gecko console redirector.
... to output messages to the javascript console there are two ways to output messages to the js console: components.utils.reporterror(str) will output str as an "error" (i.e.
... jsdump(str) (function defined below) will output str as a "message" with a speech bubble icon next to it: function jsdump(str) { components.classes['@mozilla.org/consoleservice;1'] .getservice(components.interfaces.nsiconsoleservice) .logstringmessage(str); } for more information about the error console see the error console and browser console article.
...And 2 more matches
Extentsions FAQ - Archive of obsolete content
just drag them there from the toolbar customisation window, like you would when adding buttons to the toolbars." option #4 install toolbar control <http://webdesigns.ms11.net/chromeditp.html> asking for help with getting an extension to process windows messages.
... could someone make an extension for thunderbird that preview upcomeing events and number of new messages?
... how to attach information using the stringproperties of an imap message with out changing the properties?
...And 2 more matches
NPN_Status - Archive of obsolete content
« gecko plugin api reference « browser side plug-in api summary lets a plug-in display a message on the browser's status line.
... syntax #include <npapi.h> void npn_status(npp instance, const char* message); parameters the function has the following parameters: instance pointer to the current plug-in instance.
... message pointer the buffer that contains the status message string to display.
...And 2 more matches
XForms Help Element - Archive of obsolete content
the help message will be displayed if the f1 key is pressed while the containing form control has focus or if the containing form control recieves a xforms-help event.
... the message of the help element can exist in instance data, in a remote document, or as inline text.
... if more than one source of message is specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text.
...And 2 more matches
RDF in Fifty Words or Less - Archive of obsolete content
first, rdf is a graph-based model for describing internetresources (like web pages and email messages), and how these resources relate to one another.
...there are tons of others, including email messages, usenet news articles (or entire usenet news groups), and search results from your favorite web crawler, just to name a few.
...all the messages that i've received over night appear.
...And 2 more matches
UI pseudo-classes - Learn web development
for example, if we apply the following css to the above html: input:required { border: 1px solid black; } input:optional { border: 1px solid silver; } the required controls would have a black border, and the optional control will have a silver border, like so: you can also try submitting the form without filling it in, to see the client-side validation error messages browsers give you by default.
...the issue is really one of semantics — out-of-range is a more specific type of invalid communication, so you might want to provide a different message for out-of-range inputs, which will be more helpful to users than just saying "invalid".
...our out-of-range.html demo (see also the source code) builds on top of the previous example to provide out-of-range messages for the numeric inputs, as well as saying whether they are required.
...And 2 more matches
A first splash into JavaScript - Learn web development
if it is correct: display congratulations message.
... 5 !== 2 + 4 // true 'chris' !== 'bob' // true 5 !== 2 + 3 // false 2 !== '2' // true; number versus string < less than 6 < 10 // true 20 < 10 // false > greater than 6 > 10 // false 20 > 10 // true conditionals returning to our checkguess() function, i think it's safe to say that we don't want it to just spit out a placeholder message.
...if it is, the player has guessed correctly and the game is won, so we show the player a congratulations message with a nice green color, clear the contents of the low/high guess information box, and run a function called setgameover(), which we'll discuss later.
...And 2 more matches
Dynamic behavior in Svelte: working with variables and props - Learn web development
let's start by showing a status message.
... find the <h2> heading with an id of list-heading and replace the hardcoded number of active and completed tasks with dynamic expressions: <h2 id="list-heading">{completedtodos} out of {totaltodos} items completed</h2> go to the app, and you should see the "2 out of 3 items completed" message as before, but this time the information is coming from the todos array.
...observe how the numbers in the message are updated appropriately.
...And 2 more matches
Handling common JavaScript problems - Learn web development
when clicked, each one should alert a message containing its number (the value of i at the time it was created), however each one reports i as 11, because for loops do all their iterating before nested functions are invoked.
... after the packages have finished installing, try loading up a javascript file: you'll see any issues highlighted with green (for warnings) and red (for errors) circles next to the line numbers, and a separate panel at the bottom provides line numbers, error messages, and sometimes suggested values or other fixes.
... if you look at the console, you'll see the error message "uncaught typeerror: can't access property "length", heroes is undefined", and the referenced line number is 49.
...And 2 more matches
Setting up the infrastructure
copy the shell scripts from /addons/trunk/site/app/locale/ to your locale directory: extract-po.sh will be used to extract all english strings from your application's directories specified in source_dirs, merge the resulting template (*.pot) file with the existing (already containing translations) messages.po files for each locale (if they exist) and merge the new messages.po files to messages.mo files.
... compile-mo.sh will only compile all locales' messages.po files to message.mo files.
... this is useful when a localizer submits a new version of the messages.po file.
...And 2 more matches
Bytecode Descriptions
kind is used only to generate an appropriate error message.
...jsop::calliter is used for implicit calls to @@iterator methods, to ensure error messages are formatted with jsmsg_not_iterable ("x is not iterable") rather than jsmsg_not_function ("x[symbol.iterator] is not a function").
...msgnumber must be one of the error codes listed in js/src/js.msg; it determines the .message and [[prototype]] of the new error object.
...And 2 more matches
JSAPI Cookbook
// javascript throw new error("failed to grow " + varietal + ": too many greenflies."); /* jsapi */ js_reporterror(cx, "failed to grow %s: too many greenflies.", varietal); return false; to internationalize your error messages, and to throw other error types, such as syntaxerror or typeerror, use js_reporterrornumber instead.
...jsapi code can override this by creating the error object directly and passing additional arguments to the constructor: // javascript throw new error(message, filename, lineno); /* jsapi */ bool throwerror(jscontext *cx, jsobject *global, const char *message, const char *filename, int32 lineno) { jsstring *messagestr; jsstring *filenamestr; js::value args[3]; js::value exc; messagestr = js_newstringcopyz(cx, message); if (!messagestr) return false; filenamestr = js_newstringcopyz(cx, filename); ...
... if (!filenamestr) return false; args[0] = string_to_jsval(messagestr); args[1] = string_to_jsval(filenamestr); args[2] = int_to_jsval(lineno); if (js_callfunctionname(cx, global, "error", 3, args, &exc)) js_setpendingexception(cx, exc); return false; } ...
...And 2 more matches
JS_ReportError
create a formatted error or warning message to pass to a user-defined error reporting function.
... format const char * format string to convert into an error message using js_vsmprintf.
... error message variables to insert into the format string.
...And 2 more matches
Components.utils.reportError
this means you can use components.utils.reporterror to report debugging messages to the error console, just like dump() can be used to print messages to the native console.
... however you should use nsiconsoleservice for logging, as it logs the messages with normal severity, unlike reporterror.
... function mydump(amessage) { var consoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice); consoleservice.logstringmessage("my component: " + amessage); } firefox 3: the error console will not display chrome errors by default.
...And 2 more matches
nsIFrameScriptLoader
idl file: mozilla-central/source/dom/base/nsimessagemanager.idl inherits from: nsisupports this interface is used to load frame scripts.
... if this function is called on a chromemessagebroadcaster (for example, a global frame message manager or a window message manager) then: loadframescript() will load the frame script independently into each applicable frame: every open frame in the given window for the window message manager, or every frame in every window for the global message manager if aallowdelayedload is true, then the script will also be loaded into any applicable ...
... if this function is called on a chromemessagesender: it will load the frame script only into this chromemessagesender's frame aallowdelayedload should always be true.
...And 2 more matches
nsIMsgIdentity
autoquote boolean should we automatically quote the original message?
... replyontop long should replies appear above or below the quoted message.
... (1 - replies appear above the quoted message.
...And 2 more matches
nsIMsgSendLater
to create an instance, use var msgsendlater = components.classes["@mozilla.org/messengercompose/sendlater;1"] .getservice(components.interfaces.nsimsgsendlater); method overview void sendunsentmessages(in nsimsgidentity identity); void removelistener(in nsimsgsendlaterlistener listener); void addlistener(in nsimsgsendlaterlistener listener); nsimsgfolder getunsentmessagesfolder](in nsimsgidentity identity); attributes attribute type description msgwindow nsimsgwindow methods sendunsentmessages() sends all unsent messag...
... void sendunsentmessages(in nsimsgidentity identity) parameters identity the nsimsgidentity to send unsent messages for removelistener() remove an event listener from this nsisendmsglater instance void removelistener(in nsimsgsendlaterlistener listener); parameters listener the nsimsgsendlaterlistener to remove.
... getunsentmessagesfolder() get the unsent messages folder for an identity.
...And 2 more matches
XPCOM reference
in a big change from the original nsiabcard, properties are now stored in a hash table instead of as attributes on the interface, allowing it to be more flexible.nsicookie2 mozilla 1 8 branchnsimsgsearchvaluedefined in comm-central/ mailnews/ base/ search/ public/ nsimsgsearchvalue.idl nsmsgmessageflagsthe nsmsgmessageflags interface describes possible flags for messages.
... equivalent flags are also defined in nsmsgmessageflags.h.
... nsmsgnavigationtypethe nsmsgnavigationtype interface contains constants used for message navigation in thunderbird.
...And 2 more matches
Using js-ctypes
components.utils.import("resource://gre/modules/ctypes.jsm"); var lib = ctypes.open("c:\\windows\\system32\\user32.dll"); /* declare the signature of the function we are going to call */ var msgbox = lib.declare("messageboxw", ctypes.winapi_abi, ctypes.int32_t, ctypes.int32_t, ctypes.jschar.ptr, ctypes.jschar.ptr, ctypes.int32_t); var mb_ok = 0; var ret = msgbox(0, "hello world", "title", mb_ok); lib.close(); in line 3, the user32.dll system library is loaded.
... line 6 declares msgbox() to be a method that calls the windows function messageboxw.
... about declaring the function how we knew how to declare the function was by going to msdn site and looking at the messagebox (messageboxw is just a unicode version of same function) function.
...And 2 more matches
URLs - Plugins
this example uploads a file from the root of the local file system to an ftp server and displays the response in a frame named response: char* mydata = "file:///c\/mydirectory/myfilename"; uint32 mylength = strlen(mydata) + 1; err = npn_posturl(instance, "ftp://fred@ftp.example.com/pub/", "response", mylength, mydata, true); sending mail a plug-in can send an email message using npn_posturl or npn_posturlnotify.
... the following code sends a mail message with the default headers from the client machine.
... 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.
...And 2 more matches
Gecko Plugin API Reference - Plugins
using the appropriate attributes using the embed element for plug-in display using custom embed attributes plug-in references plug-in development overview writing plug-ins registering plug-ins ms windows unix mac os x drawing a plug-in instance handling memory sending and receiving streams working with urls getting version and ui information displaying messages on the status line making plug-ins scriptable building plug-ins building, platforms, and compilers building carbonized plug-ins for mac os x type libraries installing plug-ins native installers xpi plug-ins installations plug-in installation and the windows registry initialization and destruction initialization instance creation instance destruction shu...
...n initialize and shutdown example drawing and event handling the npwindow structure drawing plug-ins printing the plug-in setting the window getting information windowed plug-ins mac os windows unix event handling for windowed plug-ins windowless plug-ins specifying that a plug-in is windowless invalidating the drawing area forcing a paint message making a plug-in opaque making a plug-in transparent creating pop-up menus and dialog boxes event handling for windowless plug-ins streams receiving a stream telling the plug-in when a stream is created telling the plug-in when a stream is deleted finding out how much data the plug-in can accept writing the stream to the plug-in sending the stream in random-access mode ...
...e stream deleting the stream example of sending a stream urls getting urls getting the url and displaying the page posting urls posting data to an http server uploading files to an ftp server sending mail memory allocating and freeing memory mac os flushing memory (mac os only) version, ui, and status information displaying a status line message getting agent information getting the current version finding out if a feature exists reloading a plug-in plug-in side plug-in api this chapter describes methods in the plug-in api that are available from the plug-in object.
...And 2 more matches
HTMLObjectElement.setCustomValidity - Web APIs
the setcustomvalidity() method of the htmlobjectelement interface sets a custom validity message for the element.
... syntax htmlobjectelement.setcustomvalidity(message); parameters error the message to use for validity errors.
... examples in this example, we pass the id of an input element, and set different error messages depending on whether the value is missing, too low or too high.
...And 2 more matches
HTMLObjectElement - Web APIs
htmlobjectelement.standby is a domstring that reflects the standby html attribute, specifying a message to display while the object loads.
... htmlobjectelement.validationmessage read only returns a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any).
... htmlobjectelement.setcustomvalidity() sets a custom validity message for the element.
...And 2 more matches
Capabilities, constraints, and settings - Web APIs
logelement a <div> into which any error messages or other log-type output will be written.
...if either call to json.parse() throws an exception, handleerror() is called to output the error message to the log.
... if an error occurs applying either set of constraints, handleerror() is used to output a message into the log.
...And 2 more matches
RTCDataChannel.binaryType - Web APIs
when a binary message is received on the data channel, the resulting message event's messageevent.data property is an object of the type specified by the binarytype.
... syntax var type = adatachannel.binarytype; adatachannel.binarytype = type; value a domstring that can have one of these values: "blob" received binary messages' contents will be contained in blob objects.
... "arraybuffer" received binary messages' contents will be contained in arraybuffer objects.
...And 2 more matches
RTCDataChannel: open event - Web APIs
the webrtc open event is sent to an rtcdatachannel object's onopen event handler when the underlying transport used to send and receive the data channel's messages is opened or re-opened.
...it enables the message input box and send button as well as enabling the disconnect button and disabling the connect button.
... finally, the message input box is focused so the user can immediately begin to type.
...And 2 more matches
ServiceWorkerContainer - Web APIs
message occurs when incoming messages are received by the serviceworkercontainer object (e.g.
... via a messageport.postmessage() call.) also available via the serviceworkercontainer.onmessage property.
... serviceworkercontainer.startmessages() explicitly starts the flow of messages being dispatched from a service worker to pages under its control (e.g.
...And 2 more matches
ServiceWorkerGlobalScope - Web APIs
an active service worker is automatically restarted to respond to events, such as serviceworkerglobalscope.onfetch or serviceworkerglobalscope.onmessage.
... message occurs when incoming messages are received.
... controlled pages can use the messageport.postmessage() method to send messages to service workers.
...And 2 more matches
SharedWorkerGlobalScope.onconnect - Web APIs
the onconnect property of the sharedworkerglobalscope interface is an event handler representing the code to be called when the connect event is raised — that is, when a messageport connection is opened between the associated sharedworker and the main thread.
...}; examples this example shows a shared worker file — when a connection to the worker occurs from a main thread via a messageport, the onconnect event handler fires.
... the event object is a messageevent.
...And 2 more matches
SubtleCrypto.encrypt() - Web APIs
authentication helps protect against chosen-ciphertext attacks, in which an attacker can ask the system to decrypt arbitrary messages, and use the result to deduce information about the secret key.
... function getmessageencoding() { const messagebox = document.queryselector(".rsa-oaep #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } function encryptmessage(publickey) { let encoded = getmessageencoding(); return window.crypto.subtle.encrypt( { name: "rsa-oaep" }, publickey, encoded ); } aes-ctr this code fetches the conten...
... function getmessageencoding() { const messagebox = document.queryselector(".aes-ctr #message"); let message = messagebox.value; let enc = new textencoder(); return enc.encode(message); } function encryptmessage(key) { let encoded = getmessageencoding(); // counter will be needed for decryption counter = window.crypto.getrandomvalues(new uint8array(16)); return window.crypto.subtle.encrypt( { name: "aes-ctr", counter, length: 64 }, key, encoded ); } let iv = new uint8array(16); let key = new uint8array(16); let data = new uint8array(12345); //crypto functions are wrapped in promises so we have to use await and make sure the fun...
...And 2 more matches
Writing a WebSocket server in Java - Web APIs
here's an implementation split into parts: import java.io.ioexception; import java.io.inputstream; import java.io.outputstream; import java.net.serversocket; import java.net.socket; 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\nw...
... if (get.find()) { matcher match = pattern.compile("sec-websocket-key: (.*)").matcher(data); match.find(); byte[] response = ("http/1.1 101 switching protocols\r\n" + "connection: upgrade\r\n" + "upgrade: websocket\r\n" + "sec-websocket-accept: " + base64.getencoder().encodetostring(messagedigest.getinstance("sha-1").digest((match.group(1) + "258eafa5-e914-47da-95ca-c5ab0dc85b11").getbytes("utf-8"))) + "\r\n\r\n").getbytes("utf-8"); out.write(response, 0, response.length); decoding messages after a successful handshake, client can send messages to the server, but now these are encoded.
... if we send "abcdef", we get these bytes: 129 134 167 225 225 210 198 131 130 182 194 135 - 129: fin (is this the whole message?) rsv1 rsv2 rsv3 opcode 1 0 0 0 0x1=0001 fin: you can send your message in frames, but now keep things simple.
...And 2 more matches
Using the Web Speech API - Web APIs
we simply have a title, instructions paragraph, and a div into which we output diagnostic messages.
... <h1>speech color changer</h1> <p>tap/click then say a color to change the background color of the app.</p> <div> <p class="output"><em>...diagnostic messages</em></p> </div> the css provides a very simple responsive styling so that it looks ok across devices.
... 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 2 more matches
window.dump() - Web APIs
WebAPIWindowdump
window.dump() prints messages to the (native) console.
... syntax window.dump(message); dump(message); parameters message is the string message to log.
...the message passed to dump() is sent to the system console (native console) if the firefox process was started with the -console option.
...And 2 more matches
Cognitive accessibility - Accessibility
rtisements; providing consistent web page layout and navigation; incorporating familiar elements, such as underlined links that are blue when not visited and purple when visited; dividing processes into logical, essential steps with progress indicators; making website authentication as easy as possible without compromising security; and making forms easy to complete, such as with clear error messages and simple error recovery.
...for example, being able to extend the expiration time on an application requiring an authentication code sent to a mobile device via text message helps with the following scenarios: people with attention or anxiety disorders.
... input assistance guidelines aim to reduce the likelihood that users, especially those with disabilities, make a mistake, and, if they do make a mistake, increase the likelihood that they see and comprehend the error message and can successfully fix any errors.
...And 2 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
a set of system messages that confer accessibility-related events such as focus changes, changes to document content and state changes in ui objects like checkboxes.
... solution: allow microsoft windows to handle wm_getobject messages for objid_window.
... when the win32 api function accessibleobjectfromwindow() is called, windows sends the window in question a wm_getobject message requesting an iaccessible for your root object in the window.
...And 2 more matches
Constraint validation - Developer guides
basically, the idea is to trigger javascript on some form field event (like onchange) to calculate whether the constraint is violated, and then to use the method field.setcustomvalidity() to set the result of the validation: an empty string means the constraint is satisfied, and any other string means there is an error and this string is the error message to display to the user.
... if (constraint.test(zipfield.value)) { // the zip follows the constraint, we use the constraintapi to tell it zipfield.setcustomvalidity(""); } else { // the zip doesn't follow the constraint, we use the constraintapi to // give a message about the format required for this country zipfield.setcustomvalidity(constraints[country][1]); } } then we link it to the onchange event for the <select> and the oninput event for the <input>: window.onload = function () { document.getelementbyid("country").onchange = checkzip; document.getelementbyid("zip").oninput = checkzip; } you can see a live example of the postal code va...
... visual styling of constraint validation apart from setting constraints, web developers want to control what messages are displayed to the users and how they are styled.
...And 2 more matches
MIME types (IANA media types) - HTTP
with the exception of multipart/form-data, used in the post method of html forms, and multipart/byteranges, used with 206 partial content to send part of a document, http doesn't handle multipart documents in a special way: the message is transmitted to the browser (which will likely show a "save as" window if it doesn't know how to display the document).
... there are two multipart types: message list at iana a message that encapsulates other messages.
... this can be used, for instance, to represent an email that includes a forwarded message as part of its data, or to allow sending very large messages in chunks as if it were multiple messages.
...And 2 more matches
Index - HTTP
WebHTTPHeadersIndex
27 content-range http, http header, reference, response header, header the content-range response http header indicates where in a full body message a partial message belongs.
... 57 date general header, http, reference, header the date general http header contains the date and time at which the message was originated.
... 107 trailer http, reference, header the trailer response header allows the sender to include additional fields at the end of chunked messages in order to supply metadata that might be dynamically generated while the message body is sent, such as a message integrity check, digital signature, or post-processing status.
...And 2 more matches
Trailer - HTTP
WebHTTPHeadersTrailer
the trailer response header allows the sender to include additional fields at the end of chunked messages in order to supply metadata that might be dynamically generated while the message body is sent, such as a message integrity check, digital signature, or post-processing status.
... header type response header forbidden header name yes syntax trailer: header-names directives header-names http header fields which will be present in the trailer part of chunked messages.
... these header fields are disallowed: message framing headers (e.g., transfer-encoding and content-length), routing headers (e.g., host), request modifiers (e.g., controls and conditionals, like cache-control, max-forwards, or te), authentication headers (e.g., authorization or set-cookie), or content-encoding, content-type, content-range, and trailer itself.
...And 2 more matches
Control flow and error handling - JavaScript
// create an object type userexception function userexception(message) { this.message = message; this.name = 'userexception'; } // make the exception convert to a pretty string when used as a string // (e.g., by the error console) userexception.prototype.tostring = function() { return `${this.name}: "${this.message}"`; } // create an instance of the object type and throw it throw new userexception('value too high'); try...catch statement the try...catch s...
...it formats the message as an error, and adds it to the list of error messages generated by the page.
... utilizing error objects depending on the type of error, you may be able to use the name and message properties to get a more refined message.
...And 2 more matches
How to make PWAs re-engageable using Notifications and Push - Progressive web apps (PWAs)
but instead of relying only on user actions, we can do more, using push messages and notifications to automatically re-engage and deliver new content whenever it is available.
... as mentioned before, to be able to receive push messages, you have to have a service worker, the basics of which are already explained in the making pwas work offline with service workers article.
... from the server-side, the whole process has to be encrypted with public and private keys for security reasons — allowing everyone to send push messages unsecured using your app would be a terrible idea.
...And 2 more matches
Cross-domain Content Scripts - Archive of obsolete content
cross-domain iframes the following "main.js" creates a page-worker which loads a local html file called "page.html", attaches a content script called "page.js" to the page, waits for messages from the script, and logs the payload.
... //main.js var data = require("sdk/self").data; var pageworker = require("sdk/page-worker").page({ contenturl: data.url("page.html"), contentscriptfile: data.url("page-script.js") }); pageworker.on("message", function(message) { console.log(message); }); the "page.html" file embeds an iframe whose content is served from "http://en.m.wikipedia.org/": <!doctype html> <!-- page.html --> <html> <head></head> <body> <iframe id="wikipedia" src="http://en.m.wikipedia.org/"></iframe> </body> </html> the "page-script.js" file locates "today's featured article" and sends its content to "main.js": // page-script.js var iframe = window.document.getelementbyid("wikipedia"); var todaysfeaturedarticle = iframe.contentwindow.document.getelementbyid("mp-tfa...
..."); self.postmessage(todaysfeaturedarticle.textcontent); for this to work, we need to add the "cross-domain-content" key to "package.json": "permissions": { "cross-domain-content": ["http://en.m.wikipedia.org/"] } the add-on should successfully retrieve the iframe's content.
... the "main.js": creates a panel whose content is supplied by "panel.html" and adds a content script "panel-script.js" to it sends the panel a "show" message when it is shown adds a button which shows the panel when it is clicked // main.js var data = require("sdk/self").data; var forecast_panel = require("sdk/panel").panel({ height: 50, contenturl: data.url("panel.html"), contentscriptfile: data.url("panel-script.js") }); forecast_panel.on("show", function(){ forecast_panel.port.emit("show"); }); require("sdk/ui/button/action").actionbutton({ id: "get-forecast", label: "get the f...
Logging - Archive of obsolete content
because dom objects aren't available to the main add-on code, the sdk provides its own global console object with most of the same methods as the dom console, including methods to log error, warning, or informational messages.
... 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!
...the following add-on logs the html content of every tab the user loads, by calling console.log() inside a content script: require("sdk/tabs").on("ready", function(tab) { tab.attach({ contentscript: "console.log(document.body.innerhtml);" }); }); console output if you are running your add-on from the command line (for example, executing jpm run or jpm test) then the console's messages appear in the command shell you used.
... if you've installed the add-on in firefox then the messages appear in firefox's browser console.
Custom toolbar button - Archive of obsolete content
you should see the pop-up message.
... advanced troubleshooting if you have some technical knowledge, then you can use the application's javascript console to see error messages.
... however, you might see messages that are unhelpful or confusing, or that come from other parts of the application.
...or use short cut "ctrl + shift + j" messages in the javascript console can provide information about javascript, xul or css files.
window - Archive of obsolete content
amespace(), isequalnode, issamenode, issupported(), lookupnamespaceuri, lookupprefix, normalize(), queryselector(), queryselectorall(), removeattribute(), removeattributenode(), removeattributens(), removechild(), removeeventlistener(), replacechild(), setattribute(), setattributenode(), setattributenodens(), setattributens(), setuserdata see also: dom window object methods note the error message "xml parsing error: undefined entity...<window" can be caused by a missing or unreachable dtd file referenced in the xul file.
... a filename following the system keyword in a doctype declaration may silently fail to load and the only error message will be an undefined entity error on the next xul element.
...p://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml"> <!-- icon from chrome --> <html:link rel="icon" href="chrome://myextension/content/path/to/favicon.png"/> <!-- from a remote site --> <html:link rel="icon" href="http://www.mozilla.org/favicon.ico"/> since firefox 3.6 the above listed code does not work correctly - it produces the following message: "warning: xul box for box element contained an inline link child, forcing all its children to be wrapped in a block".
...if it is placed between box tags, window controls are rendered fine, but still there is this error message.
TCP/IP Security - Archive of obsolete content
other commonly used protocols at the network layer are internet control message protocol (icmp) and internet group management protocol (igmp).
... one example is secure multipurpose internet mail extensions (s/mime), which is commonly used to encrypt email messages.
... transport layer protocols such as ssl are most commonly used to provide security for communications with individual http-based applications, although they are also used to provide protection for communication sessions of other types of applications such as smtp, point of presence (pop), internet message access protocol (imap), and file transfer protocol (ftp).
... the integrity of data can be assured by generating a message authentication code (mac) value, which is a keyed cryptographic checksum of the data.
Error.description - Archive of obsolete content
remarks the description property contains the error message string associated with a specific error.
... the description and message properties provide the same functionality; the descriptionproperty provides backward compatibility; the message property complies with the ecma standard.
... try { // cause an error: x = y } catch(e) { // prints "[object error]": document.write(e) document.write (" "); // prints 5009: document.write((e.number & 0xffff)) document.write (" "); // prints "'y' is undefined": document.write(e.description); document.write (" "); // prints "'y' is undefined": document.write(e.message) } requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet explorer 10 standards, internet explorer 11 standards.
... applies to: error object see also number property (error) message property (error) name property (error) ...
JSException - Archive of obsolete content
constructor summary the netscape.javascript.jsexception class has the following constructors: jsexception deprecated constructors optionally let you specify a detail message and other information.
... backward compatibility javascript 1.1 through 1.3 jsexception had three public constructors which optionally took a string argument, specifying the detail message or other information for the exception.
... jsexception constructors, deprecated in javascript 1.4, constructs a jsexception object with an optional detail message.
...public jsexception(string s, string filename, int lineno, string source, int tokenindex) arguments s the detail message.
Asynchronous - MDN Web Docs Glossary: Definitions of Web-related terms
networking and communications asynchronous communication is a method of exchanging messages between two or more parties in which each party receives and processes messages whenever it's convenient or possible to do so, rather than doing so immediately upon receipt.
... additionally, messages may be sent without waiting for acknowledgement, with the understanding that if a problem occurs, the recipient will request corrections or otherwise handle the situation.
... for humans, e-mail is an asynchronous communication method; the sender sends an email and the recipient will read and reply to the message when it's convenient to do so, rather than doing so at once.
... and both sides can continue to send and receive messages whenever they wish, instead of having to schedule them around each other.
HTML: A good basis for accessibility - Learn web development
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.
... <h1>links</h1> <p>this is a link to <a href="https://www.mozilla.org">mozilla</a>.</p> <p>another link, to the <a href="https://developer.mozilla.org">mozilla developer network</a>.</p> <h2>buttons</h2> <p> <button data-message="this is from the first button">click me!</button> <button data-message="this is from the second button">click me too!</button> <button data-message="this is from the third button">and me!</button> </p> <h2>form</h2> <form> <div> <label for="name">fill in your name:</label> <input type="text" id="name" name="name"> </div> <div> <label for="age">enter your age:</label> ...
...for example, you sometimes see buttons marked up using <div>s, for example: <div data-message="this is from the first button">click me!</div> <div data-message="this is from the second button">click me too!</div> <div data-message="this is from the third button">and me!</div> but using such code is not advised — you immediately lose the native keyboard accessibility you would have had if you'd just used <button> elements, plus you don't get any of the default css styling that buttons g...
...here we've given our fake <div> buttons the ability to be focused (including via tab) by giving each one the attribute tabindex="0": <div data-message="this is from the first button" tabindex="0">click me!</div> <div data-message="this is from the second button" tabindex="0">click me too!</div> <div data-message="this is from the third button" tabindex="0">and me!</div> basically, the tabindex attribute is primarily intended to allow tabbable elements to have a custom tab order (specified in positive numerical order), instead of just being tabbed through in their default source order.
HTML: A good basis for accessibility - Learn web development
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.
... <h1>links</h1> <p>this is a link to <a href="https://www.mozilla.org">mozilla</a>.</p> <p>another link, to the <a href="https://developer.mozilla.org">mozilla developer network</a>.</p> <h2>buttons</h2> <p> <button data-message="this is from the first button">click me!</button> <button data-message="this is from the second button">click me too!</button> <button data-message="this is from the third button">and me!</button> </p> <h2>form</h2> <form> <div> <label for="name">fill in your name:</label> <input type="text" id="name" name="name"> </div> <div> <label for="age">enter your age:</label> ...
...for example, you sometimes see buttons marked up using <div>s, for example: <div data-message="this is from the first button">click me!</div> <div data-message="this is from the second button">click me too!</div> <div data-message="this is from the third button">and me!</div> but using such code is not advised — you immediately lose the native keyboard accessibility you would have had if you'd just used <button> elements, plus you don't get any of the default css styling that buttons g...
...here we've given our fake <div> buttons the ability to be focused (including via tab) by giving each one the attribute tabindex="0": <div data-message="this is from the first button" tabindex="0">click me!</div> <div data-message="this is from the second button" tabindex="0">click me too!</div> <div data-message="this is from the third button" tabindex="0">and me!</div> basically, the tabindex attribute is primarily intended to allow tabbable elements to have a custom tab order (specified in positive numerical order), instead of just being tabbed through in their default source order.
How the Web works - Learn web development
the browser needs to find out which server the website lives on, so it can send http messages to the right place (see below).
... the browser sends an http request message to the server, asking it to send a copy of the website to the client (you go to the shop and order your goods).
... this message, and all other data sent between the client and the server, is sent across your internet connection using tcp/ip.
... if the server approves the client's request, the server sends the client a "200 ok" message, which means "of course you can look at that website!
Introduction to events - Learn web development
these are often used to display information about filling in form fields when they are focused, or displaying an error message if a form field is filled with an incorrect value.
...when you fill in the details and select the submit button, the natural behavior is for the data to be submitted to a specified page on the server for processing, and the browser to be redirected to a "success message" page of some kind (or the same page, if another is not specified.) the trouble comes when the user has not submitted the data correctly — as a developer, you want to prevent the submission to the server and give an error message saying what's wrong and what needs to be done to put things right.
...if they are, we call the preventdefault() function on the event object — which stops the form submission — and then display an error message in the paragraph below our form to tell the user what's wrong: const form = document.queryselector('form'); const fname = document.getelementbyid('fname'); const lname = document.getelementbyid('lname'); const para = document.queryselector('p'); form.onsubmit = function(e) { if (fname.value === '' || lname.value === '') { e.preventdefault(); para.textcontent = 'you need to fill in bot...
... a good example is a series of list items — if you want each one to pop up a message when selected, you can set the click event listener on the parent <ul>, and events will bubble from the list items to the <ul>.
Test your skills: Conditionals - Learn web development
we want you to create a conditional that checks whether season contains the string "summer", and if so assigns a string to response that gives the user an appropriate message about the season.
... you need to create an if...else structure that checks whether the machine is switched on and puts a message into the response variable if it isn't, telling the user to switch the machine on.
... inside the first, you need to nest an if...else if...else that puts appropriate messages into the response variable depending on what the value of score is — if the machine is turned on.
... we'd like you to create an if...else structure that checks whether the machine is switched on and puts a message into the machineresult variable telling the user whether it is on or off.
Client-side storage - Learn web development
in our simple example, we just print a message to the javascript console.
...eelement('button'); listitem.appendchild(deletebtn); deletebtn.textcontent = 'delete'; // set an event handler so that when the button is clicked, the deleteitem() // function is run deletebtn.onclick = deleteitem; // iterate to the next item in the cursor cursor.continue(); } else { // again, if list item is empty, display a 'no notes stored' message if(!list.firstchild) { const listitem = document.createelement('li'); listitem.textcontent = 'no notes stored.'; list.appendchild(listitem); } // if there are no more cursor items to iterate through, say so console.log('notes all displayed'); } }; } again, let's break this down: first we empty out the <ul> element's content, before then fi...
...this block checks whether any notes were inserted into the <ul> — if not, it inserts a message to say no note was stored.
...objectstore.delete(noteid); // report that the data item has been deleted transaction.oncomplete = function() { // delete the parent of the button // which is the list item, so it is no longer displayed e.target.parentnode.parentnode.removechild(e.target.parentnode); console.log('note ' + noteid + ' deleted.'); // again, if list item is empty, display a 'no notes stored' message if(!list.firstchild) { let listitem = document.createelement('li'); listitem.textcontent = 'no notes stored.'; list.appendchild(listitem); } }; } the first part of this could use some explaining — we retrieve the id of the record to be deleted using number(e.target.parentnode.getattribute('data-note-id')) — recall that the id of the record was saved in a data-no...
Fetching data from the server - Learn web development
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.
... however, a complete website would handle this error more gracefully by displaying a message on the user's screen and perhaps offering options to remedy the situation, but we don't need anything more than a simple console.log().
...you'll see a message similar to "network request for produc.json failed with response 404: file not found".
... the properties for getting the status and status message are the same, but they are found on the request (xhr) object, not the response object.
Useful string methods - Learn web development
filtering greeting messages in the first exercise we'll start you off simple — we have an array of greeting card messages, but we want to sort them to list just the christmas messages.
...) structure, to test each string and only print it in the list if it is a christmas message.
... first think about how you could test whether the message in each case is a christmas message.
... what string is present in all of those messages, and what method could you use to test whether it is present?
Client-Server Overview - Learn web development
web servers wait for client request messages, process them when they arrive, and reply to the web browser with an http response message.
...for example, the http request that is sent when you perform a search on mdn for the term "client server overview" will look a lot like the text shown below (it will not be identical because parts of the message depend on your browser/setup).
... the format of http messages is defined in a "web standard" (rfc7230).
... at the end of the message we see the body content — which contains the actual html returned by the request.
TypeScript support in Svelte - Learn web development
(ts) let timeout ./svelte-todo-typescript/src/components/alert.svelte:11:28 warn: parameter 'message' implicitly has an 'any' type, but a better type may be inferred from usage.
... (ts) change = (message, ms) => { ./svelte-todo-typescript/src/components/alert.svelte:11:37 warn: parameter 'ms' implicitly has an 'any' type, but a better type may be inferred from usage.
... (ts) (message, ms) => { you can fix these by specifying the corresponding types, like so: export let ms = 3000 let visible: boolean let timeout: number const onmessagechange = (message: string, ms: number) => { cleartimeout(timeout) if (!message) { // hide alert if message is empty note: there's no need to specify the ms type with export let ms:number = 3000 because typescript is already inferring it from its default value.
...we shouldn't need to store any kind of value — we know that the alert store should contain string messages, and the todos store should contain an array of todotype, etc.
Handling common HTML and CSS problems - Learn web development
these allows you to paste your code into a window, and it will flag up any errors with crosses, which can then be hovered to get an error message informing you what the problem is.
... after the packages have finished installing, try loading up an html file and a css file: you'll see any issues highlighted with green (for warnings) and red (for errors) circles next to the line numbers, and a separate panel at the bottom provides line numbers, error messages, and sometimes suggested values or other fixes.
...hovering the warning triangle will provide a descriptive error message: other browser devtools have similar features.
...it is often useful to search for specific error messages if you have them — other developers will be likely to have had the same problems as you.
Setting up your own test automation environment - Learn web development
webdriver will then wait for 2 seconds; the document title is then accessed, and if it is "webdriver - google search", we will return a message to claim the test is passed.
...ion(title) { if(title === 'webdriver - google search') { console.log('test passed'); } else { console.log('test failed'); } driver.quit(); }); }); } in terminal, make sure you are inside your project folder, then enter the following command: node google_test_multiple if you are using a mac and do decide to test safari, you might get an error message along the lines of "could not create a session: you must enable the 'allow remote automation' option in safari's develop menu to control safari via webdriver." if you get this, follow the given instruction and try again.
...in this case we get the title of the current page with the gettitle() method, then return a pass or fail message depending on what its value is.
...is not empty) by using getattribute() to retrieve it's value attribute value, and print a message to the console if it is not empty.
Accessibility API cross-reference
dial n/a n/a n/a a dialog or message box.
...is for expandable items that are not expanded, such as folded tree branches or accordions collapsed collapsed collapsed aria-expanded=false different from xul's collapsed="true" attribute which indicates something is hidden this is the default button or menu item default n/a n/a identifies the element that provides an error message for the object.
... n/a n/a aria-errormessage an item that has been expanded, such as a tree item or accordion expanded expanded expanded aria-expanded=true indicates this object allows progressive disclosure of its children.
...the button is inconsistent when it will act on a group of objects (such as a list of mail messages) that are not in the same state.
Multiprocess on Windows
as you should already know from the prerequisite reading, single threaded apartments receive remote procedure calls (rpcs) from com, via the windows message queue.
...the windows message queue carries a lot of baggage for the purposes of maintaining backward compatibility.
... on the other hand, com's multithreaded apartment (mta) uses a much faster ipc mechanism that does not suffer from the same problems as the message queue.
...unfortunately, crossing apartment boundaries using com incurs the exact same problem as crossing process boundaries: if we directly use com's built in marshaling capabilities to forward an rpc from the mta to the main thread sta, com will still use the sta's message queue, thus defeating the purpose of using the mta in the first place!
Mozilla’s UAAG evaluation report
(p1) p onmouseover, onmousedown, onmouseup, onmousemove, onclick, ondbclick: no keyboard support onfocus and onblur: cannot be activated with pointer 1.3 provide text messages.
... (p1) c status line and alert boxes used to convey messages and alerts guideline 2.
... mozilla exposes the focus via wm_focus system messages mozilla does not use the system focus drawing routines, because they aren't flexible enough (don't support css) 7.2 respect input configuration conventions.
...(p3) vg a progress bar and status bar message indicates loading progress the scroll bar indicates how far into the document the current graphical view is the size of the current document is in the page info screen, sometimes it says unavailable guideline 11.
Site Identity Button
if the site identity button on your site shows something you do not expect (for example, an orange warning triangle when you expect a green padlock) you can find out the cause of the problem by looking in the web console in the firefox developer tools: ensure your web console is displaying messages in the 'security' category force-refresh the page on your site that is causing problems watch for any security messages that may appear a downgraded security ui will be due to one of these three problems: mixed content - while your page has been served over tls, but subresources loaded for your page have not.
... in this case, expect to see a 'mixed content' message in the web console.
...look for messages about weak ciphers (e.g.
... insecure renegotation - older versions of tls had a flaw in the basic design; if your server uses an affected version, the security ui will be downgraded but no web console message will be displayed.
Downloads.jsm
.import("resource://gre/modules/task.jsm"); task.spawn(function () { yield downloads.fetch("http://www.mozilla.org/", os.path.join(os.constants.path.tmpdir, "example-download.html")); console.log("example-download.html has been downloaded."); }).then(null, components.utils.reporterror); observing downloads this example logs a message every time a change occurs in one of the global download lists.
... to demonstrate the logging, a new download is started while a message box is being shown.
... the download is stopped and removed from the list when the message box is closed, regardless of whether it has been completed or not.
...close the message to stop."); } finally { yield list.remove(download); yield download.finalize(true); } } finally { yield list.removeview(view); } }).then(null, components.utils.reporterror); conversion from nsidownloadmanager starting in firefox for desktop version 26, the nsidownloadmanager and nsidownload interfaces are not available anymore.
PopupNotifications.jsm
method overview void locationchange(); notification getnotification(id, browser); void remove(notification); notification show(browser, id, message, anchorid, mainaction, secondaryactions, options); properties attribute type description ispanelopen boolean returns true if the notification panel is currently visible, false if it is not.
... notification show( browser, id, message, anchorid, mainaction, secondaryactions, options ); parameters browser the xul <xul:browser> element with which the notification is associated.
... message a string to display in the notification panel.
...the callback code can modify the notification message/actions if necessary during this notification.
Localizing with Koala
koala will show you a message if the "hg add" was successful.
...(you could also commit each file individually if you felt like it.) koala will ask you to type in a commit message.
...a good way of doing that is to ask yourself a question: "if i was a new person to this project and new nothing about the work already done in this repository, would this message help me understand what changes were made in this revision?".
... type a good commit message and click "ok".
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.
... verification via text message if a service supports verification, via sms, it sends a text message with a one-time pin to the user’s phone number.
...this was chosen as an early second factor 'protocol' as text messages are widely supported, however, even nist no longer recommends sms verification.
... the ss7 telephony system is vulnerable, making eavesdropping, or rerouting text messages quite trivial.
JSS Provider Notes
by default, the jss provider carries out all operations except messagedigest on the internal key storage token, a software token included in jss/nss.
... messagedigest operations take place by default on the internal crypto token, another internal software token in jss/nss.
...dsakpg.initialize(1024); keypair dsapair = dsakpg.generatekeypair(); supported classes cipher dsaprivatekey dsapublickey keyfactory keygenerator keypairgenerator mac messagedigest rsaprivatekey rsapublickey secretkeyfactory secretkey securerandom signature what's not supported the following classes don't work very well: keystore: there are many serious problems mapping the jca keystore interface onto nss's model of pkcs #11 modules.
... messagedigest supported algorithms md5 md2 sha-1 (sha1, sha ) rsaprivatekey notes getmodulus() is not supported because nss does not support extracting data from private keys.
Mozilla-JSS JCA Provider notes
by default, the jss provider carries out all operations except messagedigest on the internal key storage token, a software token included in jss/nss.
... messagedigest operations take place by default on the internal crypto token, another internal software token in jss/nss.
...dsakpg.initialize(1024); keypair dsapair = dsakpg.generatekeypair(); supported classes cipher dsaprivatekey dsapublickey keyfactory keygenerator keypairgenerator mac messagedigest rsaprivatekey rsapublickey secretkeyfactory secretkey securerandom signature cipher supported algorithms notes aes des desede (des3) rc2 rc4 rsa the following modes and padding schemes are supported: algorithm mode padding des ecb nopadding cbc nopadding ...
... messagedigest supported algorithms md5 md2 sha-1 (sha1, sha) rsaprivatekey notes getmodulus() is not supported because nss does not support extracting data from private keys.
Python binding for NSS
the example and test ssl code sent short messages and then did a sock.recv(1024).
... we had always received the entire message in one sock.recv() call because it was so short.
... nsprerror now derived from standardexception, provides: errno (numeric error code) strerror (error description associated with error code) error_message (optional detailed message) error_code (alias for errno) error_desc (alias for strerror) certverifyerror derived from nsprerror, extends with: usages (bitmask of returned usages) log (certverifylog object) expose error lookup to sibling modules use macros for bitmask_to...
... exception error messages now include pr error text if available.
Index
97 jserrorformatstring jsapi reference, reference, référence(2), spidermonkey jserrorformatstring is a struct to represent error message and type, returned by js_reporterrornumber function.
...first it builds an error message from the given sprintf-style format string and any additional arguments passed after it.
... the resulting error message is passed to the context's jserrorreporter callback, if any.
... 434 js_reporterrornumber jsapi reference, needscontent, spidermonkey these functions create a jserrorreport, populate it with an error message obtained from the given jserrorcallback, and either report it to the current error reporter callback or create an error object and set it as the pending exception.
JS_ReportErrorNumber
errorcallback jserrorcallback callback to fetch the error message.
.../ const char16_t ** additional arguments for the error message.
... the number of additional arguments required depends on the error message, which is determined by the errorcallback.
... description these functions create a jserrorreport, populate it with an error message obtained from the given jserrorcallback, and either report it to the current error reporter callback or create an error object and set it as the pending exception.
Shell global objects
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 ...
... help([name ...]) display usage and help messages.
...if present, options may have properties saying how the code should be compiled: 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 element if present with value v, convert v to an object o and mark the source as being attached to the dom element o.
... crash([message]) crashes the process with a moz_crash.
nsIDOMEvent
method overview boolean deserialize(in constipcmessageptr amsg, out voidptr aiter); violates the xpcom interface guidelines void duplicateprivatedata(); native code only!
...reventdefault(); deprecated since gecko 16.0 void initevent(in domstring eventtypearg, in boolean canbubblearg, in boolean cancelablearg); boolean isdispatchstopped(); violates the xpcom interface guidelines void preventbubble(); obsolete since gecko 24 void preventcapture(); obsolete since gecko 24 void preventdefault(); void serialize(in ipcmessageptr amsg, in boolean aserializeinterfacetype); violates the xpcom interface guidelines void settarget(in nsidomeventtarget atarget); native code only!
... forward 0x08000000 help 0x10000000 back 0x20000000 text 0x40000000 alt_mask 0x00000001 control_mask 0x00000002 shift_mask 0x00000004 meta_mask 0x00000008 methods violates the xpcom interface guidelines deserialize() boolean deserialize( in constipcmessageptr amsg, out voidptr aiter ); parameters amsg aiter return value native code only!duplicateprivatedata void duplicateprivatedata(); parameters none.
... violates the xpcom interface guidelines serialize() void serialize( in ipcmessageptr amsg, in boolean aserializeinterfacetype ); parameters amsg aserializeinterfacetype native code only!settarget void settarget( in nsidomeventtarget atarget ); parameters atarget native code only!settrusted void settrusted( in boolean atrusted ); parameters atrusted stopimmediatepropagation() prevents other event listeners from being triggered and,...
nsIDownloadProgressListener
uritychange(in nsiwebprogress awebprogress, in nsirequest arequest, in unsigned long astate, in nsidownload adownload); void onstatechange(in nsiwebprogress awebprogress, in nsirequest arequest, in unsigned long astateflags, in nsresult astatus, in nsidownload adownload); void onstatuschange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage, in nsidownload adownload); obsolete since gecko 1.9.1 attributes attribute type description document nsidomdocument document the document of the download manager frontend.
...the received status message is intended to be displayed visibly to the user.
... void onstatuschange( in nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage, in nsidownload adownload ); parameters awebprogress the nsiwebprogress instance used by the download manager to monitor downloads.
... amessage a user-readable status message intended to be displayed visibly on the screen.
nsIMsgFilterCustomAction
* @param actionfolder folder in the filter list * @param filtertype filter type (manual, offlinemail, etc.) * * @return errormessage a localized message to display if invalid * set to null if the actionvalue is valid */ autf8string validateactionvalue(in autf8string actionvalue, in nsimsgfolder actionfolder, in nsmsgfiltertypetype filtertype); /* allow duplicate actions in the same filter list?
...otherwise, be careful * that the action does correct notifications to maintain counts, and correct * manipulations of both imap and local non-database storage of message * metadata.
... */ /** * apply the custom action to an array of messages * * @param msghdrs array of nsimsgdbhdr objects of messages * @param actionvalue user-set value to use in the action * @param copylistener calling method (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?
... */ readonly attribute boolean isasync; /// does this action need the message body?
nsIScriptError2
method overview void initwithwindowid(in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid); attributes attribute type description innerwindowid unsigned long long the inner window id with which the error is associated.
... timestamp long long elapsed time, in milliseconds, from a platform-specific zero time to the time the message was created.
... methods initwithwindowid() void init( in wstring message, in wstring sourcename, in wstring sourceline, in pruint32 linenumber, in pruint32 columnnumber, in pruint32 flags, in string category, in unsigned long long innerwindowid ); parameters message the text of the message to add to the log.
... category a string indicating what kind of code caused the message.
nsIUpdatePrompt
showupdateavailable() shows a message advising the user that an update is available to be downloaded and installed.
... 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.
... showupdateerror() displays an error message telling the user about an update failure, such as a failure to successfully apply a patch.
... showupdateinstalled() shows a message detailing the update that was just installed successfully.
nsIWorker
method overview void postmessage(in domstring amessage, [optional] in nsiworkermessageport amessageport); attributes attribute type description onmessage nsidomeventlistener an object to receive notifications when messages are received on the worker's message port.
... methods postmessage() used to allow the worker to send a message back to the web application that created it.
... void postmessage( in domstring amessage, in nsiworkermessageport amessageport optional ); parameters amessage the message the worker wishes to post back to its creator.
... amessageport a message port on which to post the message; if not specified, the default message port is used.
nsIXPCException
inherits from: nsiexception last changed in gecko 1.9.2 (firefox 3.6 / thunderbird 3.1 / fennec 1.0) method overview void initialize(in string amessage, in nsresult aresult, in string aname, in nsistackframe alocation, in nsisupports adata, in nsiexception ainner); xpcexjsval stealjsval(); native code only!
... methods initialize() void initialize( in string amessage, in nsresult aresult, in string aname, in nsistackframe alocation, in nsisupports adata, in nsiexception ainner ); parameters amessage aresult aname alocation adata ainner native code only!stealjsval xpcexjsval stealjsval(); parameters none.
...the call signature of the constructor is: components.exception(message, result, stack, data, inner) all parameters are optional and the appropriate placeholder is 'unknown'.
... message - a custom message set by the thrower (defaults to 'exception') result - the nsresult associated with this exception (defaults to components.results.ns_error_failure) stack - the stack chain (defaults to the current stack) data - additional data object of your choice (defaults to null) inner - an inner exception that triggered this, if available ...
Events
compose-send-message a message gets sent compose-window-close a compose window gets closed compose-window-init a compose window has been opened compose-window-reopen a cached compose window has been reopened.
... msgcreatedbview onactivecreatedview onactivemessagesloaded the active messages in the folder have been loaded oncreatedview a folder view has been created, but not yet shown.
... ondisplayingfolder a folder gets displayed onfolderloading a folder is being loaded onleavingfolder a folder is being unloaded, includes deletion onloadingfolder a folder is being loaded onmakeactive a folderdisplaywidget becomes active onmessagecountschanged the counts of the messages changed onmessagesloaded the messages in the folder have been loaded onmessagesremovalfailed removing some messages from the current folder failed onmessagesremoved some messages of the current message list have been removed onsearching a folder view derived from a search is being loaded...
...saved searches, virtual folders, a quicksearch onsortchanged the sort method in the messages list has been changed ...
MailNews fakeserver
an example of such a manipulation is adding a folder or adding messages.
...it will also properly queue all messages sent in pipelining mode and will present lines without any eol characters.
...the following comprises the api of the news fakeserver itself: nntpdaemon api name arguments returns notes [constructor] daemon flags n/a flags are defined below addgroup group name (string), is postable nothing adds the group (resetting if it exists) addarticle newsarticle object nothing adds the message to all groups in the article's group list addarticletogroup newsarticle object, group (string), integral key for group nothing adds the message to the specified group with the specified key getgroup group name group object group is a map key->article, with the additional properties: flags, keys (array of keys), nextkey (next key to use for new articles) getgroupstats group name array of [si...
... getarticle message id newsarticle object pretty self-explanatory newsarticle api name arguments returns notes [constructor] text (as a string) n/a initializes all fields headers (property) map of header (lower-case) -> value body (property) text of body messageid (property) message id fulltext (property) full text as message without modification except added headers.
Activity Manager examples
lder.prettiestname, null); // note that we don't define a custom icon, default process icon // will be used process.contexttype = "account"; // group this activity by account process.contextobj = folder.server; // account in question gactivitymanager.addactivity(process); // step 2: showing some progress let percent = 50; process.setprogress(percent, "junk processing 25 of 50 messages", 25, 50); // step 3: removing the process and adding an event 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", ...
...contractid); initiator->setasisupports(reinterpret_cast<nsisupports*>(copyservice)); // subject of the delete operation is the imap folder // wrap it in a nsvariant 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); //////////////////////////////////////////////////////////////// //// ad...
...as a result, all junk processing activities (assuming that we process accounts in parallel) dealing with messages coming from the same sender will be grouped together.
...} sendercontextdisplayhelper.prototype = { getcontextdisplaytext: function(contexttype, contextobj) { // in this particular example we know that contexttype is "sender" // since we also pass the contexttype along with the contextobject // in some cases, one helper can be registered for a group of context types // we know that the context object is the author of the message // localization is omitted return "messages coming from " + contextobj.surname + ", " + contextobj.firstname; } } // step 2: register the helper for this context type gactivitymanager.registercontextdisplayhelper("sender", new sendercontextdisplayhelper()); // step 3: create the process ...
Source map errors - Firefox Developer Tools
general source map error reporting if you do see a problem, a message will appear in the webconsole.
... this message will show an error message, the resource url, and the source map url: here, the resource url tells us that bundle.js mentions a source map, and the source map url tells us where to find the source map data (in this case, relative to the resource).
...typical error messages here are: syntaxerror: json.parse: unexpected character at line 1 column 1 of the json data error: "version" is a required argument original source missing an original source may be missing.
...the message looks a little different in this case: in this case, the error will also be displayed in the source tab in the debugger: networkerror when attempting to fetch resource a bug in firefox prevents it from loading source maps for web extensions.
Debugger - Firefox Developer Tools
if the uncaught exception hook itself throws an exception,uncaught-hook-exception, spidermonkey throws a new error object,confess-to-debuggee-exception, to the debuggee whose message blames the debugger, and includes textual descriptions ofuncaught-hook-exception and the originaldebugger-exception.
... if uncaughtexceptionhook’s value is null, spidermonkey throws an exception to the debuggee whose message blames the debugger, and includes a textual description ofdebugger-exception.
... onerror(frame,report) spidermonkey is about to report an error inframe.report is an object describing the error, with the following properties: message the fully formatted error message.
... arguments an array of strings, representing the arguments substituted into the error message.
Network request list - Firefox Developer Tools
transferred: the number of bytes that were actually transferred to load the resource, or a message about why the resource was not transferred.
... if the resource was blocked, the message indicates why it was blocked.
... when you refresh the page, that specific url will be blocked and a message will be added to the item in the list indicating that it has been blocked by the devtools.
...you can filter by plain text (in which case the text is used to find partial matches; entering "for" will match any message that contains the word "for") or—as of firefox 75—using regular expressions (by writing the regexp bracketed within slashes; "/.+corp.*/" will look for any occurrence of "corp" which has at least one character before it and may or may not have any characters after it, for example).
Intensive JavaScript - Firefox Developer Tools
the main thread code would look something like this: const iterations = 50; const multiplier = 1000000000; var worker = new worker("js/calculate.js"); function dopointlesscomputationsinworker() { function handleworkercompletion(message) { if (message.data.command == "done") { pointlesscomputationsbutton.disabled = false; console.log(message.data.primes); worker.removeeventlistener("message", handleworkercompletion); } } worker.addeventlistener("message", handleworkercompletion, false); worker.postmessage({ "multiplier": multiplier, "iterations": iterations }); } the main difference h...
...ere, compared with the original, is that we need to: create a worker send it a message when we are ready to calculate listen for a message called "done", which indicates that the worker has finished.
... then we need a new file "calculate.js", that looks like this: self.addeventlistener("message", go); function go(message) { var iterations = message.data.iterations; var multiplier = message.data.multiplier; primes = calculateprimes(iterations, multiplier); self.postmessage({ "command":"done", "primes": primes }); } function calculateprimes(iterations, multiplier) { var primes = []; for (var i = 0; i < iterations; 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 li...
...sten for a message telling us to start, and send a "done" message back when we are done.
AudioWorkletNode.port - Web APIs
the read-only port property of the audioworkletnode interface returns the associated messageport.
... syntax audioworkletnodeinstance.port; value the messageport object that is connecting the audioworkletnode and its associated audioworkletprocessor.
... // ping-pong-processor.js class pingpongprocessor extends audioworkletprocessor { constructor (...args) { super(...args) this.port.onmessage = (e) => { console.log(e.data) this.port.postmessage('pong') } } process (inputs, outputs, parameters) { return true } } registerprocessor('ping-pong-processor', pingpongprocessor) now in our main scripts file we'll load the processor, create an instance of audioworkletnode passing the name of the processor, and connect the node to an audio graph.
... const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('ping-pong-processor.js') const pingpongnode = new audioworkletnode(audiocontext, 'ping-pong-processor') // send the message containing 'ping' string // to the audioworkletprocessor from the audioworkletnode every second setinterval(() => pingpongnode.port.postmessage('ping'), 1000) pingpongnode.port.onmessage = (e) => console.log(e.data) pingpongnode.connect(audiocontext.destination) this will output "ping" and "pong" strings to the console every second.
AudioWorkletProcessor.port - Web APIs
the read-only port property of the audioworkletprocessor interface returns the associated messageport.
... syntax audioworkletprocessorinstance.port; value the messageport object that is connecting the audioworkletprocessor and the associated audioworkletnode.
... // ping-pong-processor.js class pingpongprocessor extends audioworkletprocessor { constructor (...args) { super(...args) this.port.onmessage = (e) => { console.log(e.data) this.port.postmessage('pong') } } process (inputs, outputs, parameters) { return true } } registerprocessor('ping-pong-processor', pingpongprocessor) now in our main scripts file we'll load the processor, create an instance of audioworkletnode passing the name of the processor, and connect the node to an audio graph.
... const audiocontext = new audiocontext() await audiocontext.audioworklet.addmodule('ping-pong-processor.js') const pingpongnode = new audioworkletnode(audiocontext, 'ping-pong-processor') // send the message containing 'ping' string // to the audioworkletprocessor from the audioworkletnode every second setinterval(() => pingpongnode.port.postmessage('ping'), 1000) pingpongnode.port.onmessage = (e) => console.log(e.data) pingpongnode.connect(audiocontext.destination) this will output "ping" and "pong" strings to the console every second.
DirectoryReaderSync - Web APIs
window.resolvelocalfilesystemurl = window.resolvelocalfilesystemurl || window.webkitresolvelocalfilesystemurl; // create web workers var worker = new worker('worker.js'); worker.onmessage = function(e) { var urls = e.data.entries; urls.foreach(function(url, i) { window.resolvelocalfilesystemurl(url, function(fileentry) { // print out file's name.
... console.log(fileentry.name); }); }); }; worker.postmessage({'cmd': 'list'}); the following is worker.js code that gets the contents of the directory.
...function onerror(e) { postmessage('error: ' + e.tostring()); } self.onmessage = function(e) { var data = e.data; // ignore everything else except our 'list' command.
... if (!data.cmd || data.cmd != 'list') { return; } try { var fs = requestfilesystemsync(temporary, 1024*1024 /*1mb*/); getallentries(fs.root.createreader()); self.postmessage({entries: paths}); } catch (e) { onerror(e); } }; method overview entrysync readentries () raises (fileexception); method readentries() returns a lost of entries from a specific directory.
HTMLBodyElement - Web APIs
windoweventhandlers.onmessage is an eventhandler called whenever an object receives a message event.
... windoweventhandlers.onmessageerror is an eventhandler called whenever an object receives a messageerror event.
... living standard technically, the event-related properties onafterprint, onbeforeprint, onbeforeunload, onblur, onerror, onfocus, onhashchange, onlanguagechange, onload, onmessage, onoffline, ononline, onpopstate, onresize, onstorage, and onunload, have been moved to windoweventhandlers.
... the following properties have been added: onafterprint, onbeforeprint, onbeforeunload, onblur, onerror, onfocus, onhashchange, onload, onmessage, onoffline, ononline, onpopstate, onresize, onstorage, and onunload.
HTMLFieldSetElement - Web APIs
htmlfieldsetelement.validationmessage a domstring representing a localized message that describes the validation constraints that the element does not satisfy (if any).
... htmlfieldsetelement.setcustomvalidity() sets a custom validity message for the field set.
... if this message is not the empty string, then the field set is suffering from a custom validity error, and does not validate.
... recommendation the following properties have been added: disabled, elements, name, type, valdiationmessage, validity, and willvalidate.
HTMLInputElement - Web APIs
validationmessage read only string: returns a localized message that describes the validation constraints that the control does not satisfy (if any).
... setcustomvalidity() sets a custom validity message for the element.
... if this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.
... 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.
HTMLTextAreaElement - Web APIs
validationmessage read only string: returns a localized message that describes the validation constraints that the control does not satisfy (if any).
... setcustomvalidity(domstring) sets a custom validity message for the element.
... if this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.
... the following attributes have been added: autofocus, placeholder, dirname, wrap, maxlength, required, textlength, labels, selectionstart, selectionend, selectiondirection, validity, validationmessage, and willvalidate.
NDEFWriter.write() - Web APIs
WebAPINDEFWriterwrite
the write() method of ndefwriter interface writes a specified message to a compatiable nfc tag.
... syntax var sessionpromise = ndefwriter.write(message, options); parameters message the message to be written, either domstring or buffersource or ndefmessageinit.
... return value a promise that resolves with undefined when and if the message transfer is successfully completed.
... notsupportederror there is no nfc adapter compatible with web nfc, or the available nfc adapter does not support pushing messages, or connection can not be established.
PaymentValidationErrors - Web APIs
when validation of the paymentresponse returned by the paymentrequest.show() or paymentresponse.retry() methods fails, your code creates a paymentvalidationerrors object to pass into retry() so that the user agent knows what needs to be fixed and what if any error messages to display to the user.
...error can be provided all by itself to provide only a generic error message, or in concert with the other properties to serve as an overview while other properties' values gude the user to errors in specific fields in the payment form.
... payer optional a payererrors compliant object which provides appropriate error messages for any of the fields describing the payer which failed validation.
... shippingaddress optional an addresserrors object which contains error messages for any of the fields in the shipping address that failed validation.
PushSubscription.getKey() - Web APIs
the getkey() method of the pushsubscription interface returns an arraybuffer representing a client public key, which can then be sent to a server and used in encrypting push message data.
... auth: an authentication secret, as described in message encryption for web push.
... example reg.pushmanager.getsubscription() .then(function(subscription) { // enable any ui which subscribes / unsubscribes from // push messages.
... subbtn.disabled = false; if (!subscription) { console.log('not yet subscribed to push') // we aren't subscribed to push, so set ui // to allow the user to enable push return; } // set your ui to show they have subscribed for // push messages subbtn.textcontent = 'unsubscribe from push messaging'; ispushenabled = true; // initialize status, which includes setting ui elements for subscribed status // and updating subscribers list via push var endpoint = subscription.endpoint; var key = subscription.getkey('p256dh'); var auth = subscription.getkey('auth'); ...
RTCDataChannel.bufferedAmount - Web APIs
as messages are actually sent, this value is reduced accordingly.
... closing the data channel doesn't reset this count, even though the user agent purges the queued messages.
... however, even after closing the channel, attempts to send messages continue to add to the bufferedamount value, even though the messages are neither sent nor buffered.
...this event may be used, for example, to implement code which queues more messages to be sent whenever there's room to buffer them.
RTCDataChannel: error event - Web APIs
", "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 "idp-load-failure": console.error(" identity provider load failure: http error ", err.httprequeststatuscode); break; case "sctp-failure": if (err.sctpcausecod...
...the error's name is rtcerror and the message is an error string specified by the webrtc layer.
...the message string is always output, as is information about the source file's name, line number, and column number at which the error occurred.
...for example, an sdp syntax error displays the line number of the error within the sdp, and an sctp error displays a message corresponding to the sctp cause code.
RTCIceCandidate.usernameFragment - Web APIs
usage notes ice uses the usernamefragment and password to ensure message integrity.
... 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.
... when the web app receives a message from the signaling server that includes a candidate to be added to the rtcpeerconnection, you can (and generally should) simply call addicecandidate().
...the function below, ssnewcandidate(), is called when a message, signalmsg, arrives from the signaling server that contains an ice candidate to be added to the rtcpeerconnection.
Service Worker API - Web APIs
reacting to push messages: start up a service worker to send users a message to tell them new content is available.
... extendablemessageevent the event object of a message event fired on a service worker (when a channel message is received on the serviceworkerglobalscope from another context) — extends the lifetime of such events.
... serviceworkermessageevent represents a message sent to a serviceworkerglobalscope.
...service worker messages will now use the messageevent interface, for consistency with other web messaging features.
SharedWorkerGlobalScope: connect event - Web APIs
bubbles no cancelable no interface messageevent event handler property sharedworkerglobalscope.onconnect examples this example shows a shared worker file — when a connection to the worker occurs from a main thread via a messageport, the onconnect event handler fires.
... the event object is a messageevent.
... the connecting port can be referenced through the event object's ports parameter; this reference can have an onmessage handler attached to it to handle messages coming in through the port, and its postmessage() method can be used to send messages back to the main thread using the worker.
... 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(workerresult); } }); specifications specification status html living standardthe definition of 'connect event' in that specification.
Using writable streams - Web APIs
this takes a given message and writes it into a writable stream, displaying each chunk on the ui as it is written to the stream and also displaying the whole message on the ui when writing has finished.
...w = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, queuingstrategy); the write() method contains a promise including code that decodes each written chunk into a format that can be written to the ui.
... writing to actually write content to the stream we call the sendmessage() function, passing it a message to be written and the stream to write to: sendmessage("hello, world.", writablestream); the sendmessage() definition looks like so: function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.for...
... we also create a new textencoder instance using the relevant constructor to encode the message into chunks to be put into the stream.
SubtleCrypto.decrypt() - Web APIs
function decryptmessage(privatekey, ciphertext) { return window.crypto.subtle.decrypt( { name: "rsa-oaep" }, privatekey, ciphertext ); } aes-ctr this code decrypts ciphertext using aes in ctr mode.
... function decryptmessage(key, ciphertext) { return window.crypto.subtle.decrypt( { name: "aes-ctr", counter, length: 64 }, key, ciphertext ); } aes-cbc this code decrypts ciphertext using aes in cbc mode.
... function decryptmessage(key, ciphertext) { return window.crypto.subtle.decrypt( { name: "aes-cbc", iv: iv }, key, ciphertext ); } aes-gcm this code decrypts ciphertext using aes in gcm mode.
... function decryptmessage(key, ciphertext) { return window.crypto.subtle.decrypt( { name: "aes-gcm", iv: iv }, key, ciphertext ); } specifications specification status comment web cryptography apithe definition of 'subtlecrypto.decrypt()' in that specification.
SubtleCrypto.digest() - Web APIs
hint: if you are looking here for how to create an keyed-hash message authentication code (hmac), you need to use the subtlecrypto.sign() instead.
... examples basic example this example encodes a message, then calculates its sha-256 digest and logs the digest length: const text = 'an obscure body in the s-k system, your majesty.
... the inhabitants refer to it as the planet earth.'; async function digestmessage(message) { const encoder = new textencoder(); const data = encoder.encode(message); const hash = await crypto.subtle.digest('sha-256', data); return hash; } const digestbuffer = await digestmessage(text); console.log(digestbuffer.bytelength); converting a digest to a hex string the digest is returned as an arraybuffer, but for comparison and display digests are often represented as hex strings.
...the inhabitants refer to it as the planet earth.'; async function digestmessage(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 ...
Using DTMF with WebRTC - Web APIs
eringstatechange = handlecallergatheringstatechangeevent; receiverpc = new rtcpeerconnection(); receiverpc.onicecandidate = handlereceivericeevent; if (hasaddtrack) { receiverpc.ontrack = handlereceivertrackevent; } else { receiverpc.onaddstream = handlereceiveraddstreamevent; } navigator.mediadevices.getusermedia(mediaconstraints) .then(gotstream) .catch(err => log(err.message)); } after creating the rtcpeerconnection for the caller (callerpc), we look to see if it has an addtrack() method.
... return receiverpc.createanswer(); }) .then(function(answer) { log("setting receiver's local description to " + answer.sdp); return receiverpc.setlocaldescription(answer); }) .then(function() { log("setting caller's remote description to match"); return callerpc.setremotedescription(receiverpc.localdescription); }) .catch(err => log("error during negotiation: " + err.message)); } since the various methods involved in negotiating the connection return promises, we can chain them together like this: call callerpc.createoffer() to get an offer.
... if at any time an error occurs, the catch() clause outputs an error message to the log.
...when you click the "dial" button, you should see a series of logging messages output, then the dialing will begin.
WebSocket - Web APIs
WebAPIWebSocket
websocket.onmessage an event listener to be called when a message is received from the server.
... message fired when data is received through a websocket.
... also available via the onmessage property.
...const socket = new websocket('ws://localhost:8080'); // connection opened socket.addeventlistener('open', function (event) { socket.send('hello server!'); }); // listen for messages socket.addeventlistener('message', function (event) { console.log('message from server ', event.data); }); specifications specification status html living standardthe definition of 'websocket' in that specification.
<input type="search"> - HTML: Hypertext Markup Language
WebHTMLElementinputsearch
it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message.
...ss="validity"></span> </div> </form> input { margin-right: 10px; } input:invalid ~ span:after { content: '✖'; padding-left: 5px; position: absolute; } input:valid ~ span:after { content: '✓'; padding-left: 5px; position: absolute; } this renders like so: in addition, if you try to submit the form with no search term entered into it, the browser will show a message.
... the following example is from firefox: different messages will be shown when you try to submit the form with different types of invalid data contained inside the inputs; see the below examples.
...span class="validity"></span> </div> </form> input { margin-right: 10px; } input:invalid ~ span:after { content: '✖'; padding-left: 5px; position: absolute; } input:valid ~ span:after { content: '✓'; padding-left: 5px; position: absolute; } this renders like so: if you try to submit the form with less than 4 characters, you'll be given an appropriate error message (which differs between browsers).
200 OK - HTTP
WebHTTPStatus200
the meaning of a success depends on the http request method: get: the resource has been fetched and is transmitted in the message body.
... head: the entity headers are in the message body.
... post: the resource describing the result of the action is transmitted in the message body.
... trace: the message body contains the request message as received by the server.
HTTP
WebHTTP
though often based on a tcp/ip layer, it can be used on any reliable transport layer, that is, a protocol that doesn't lose messages silently like udp does.
... http messages describes the type and structure of the different kind of messages of http/1.x and http/2.
... http headers http message headers are used to describe a resource, or the behavior of the server or the client.
...iana also maintains a registry of proposed new http message headers.
Closures - JavaScript
no matter what field you focus on, the message about your age will be displayed.
... consider the following case: function myobject(name, message) { this.name = name.tostring(); this.message = message.tostring(); this.getname = function() { return this.name; }; this.getmessage = function() { return this.message; }; } because the previous code does not take advantage of the benefits of using closures in this particular instance, we could instead rewrite it to avoid using closure as follows: function myobject(name, me...
...ssage) { this.name = name.tostring(); this.message = message.tostring(); } myobject.prototype = { getname: function() { return this.name; }, getmessage: function() { return this.message; } }; however, redefining the prototype is not recommended.
... the following example instead appends to the existing prototype: function myobject(name, message) { this.name = name.tostring(); this.message = message.tostring(); } myobject.prototype.getname = function() { return this.name; }; myobject.prototype.getmessage = function() { return this.message; }; in the two previous examples, the inherited prototype can be shared by all objects and the method definitions need not occur at every object creation.
constructor - JavaScript
if your class is a base class, the default constructor is empty: constructor() {} if your class is a derived class, the default constructor calls the parent constructor, passing along any arguments that were provided: constructor(...args) { super(...args); } that enables code like this to work: class validationerror extends error { printcustomermessage() { return `validation failed :-( (details: ${this.message})`; } } try { throw new validationerror("not a valid phone number"); } catch (error) { if (error instanceof validationerror) { console.log(error.name); // this is error instead of validationerror!
... console.log(error.printcustomermessage()); } else { console.log('unknown error', error); throw error; } } the validationerror class doesn't need an explicit constructor, because it doesn't need to do any custom initialization.
...for example: class validationerror extends error { constructor(message) { super(message); // call parent class constructor this.name = 'validationerror'; this.code = '42'; } printcustomermessage() { return `validation failed :-( (details: ${this.message}, code: ${this.code})`; } } try { throw new validationerror("not a valid phone number"); } catch (error) { if (error instanceof validationerror) { console.log(error.name); // now this is validationerror!
... console.log(error.printcustomermessage()); } else { console.log('unknown error', error); throw error; } } there can be only one special method with the name "constructor" in a class.
ReferenceError - JavaScript
instance properties referenceerror.prototype.message error message.
... although ecma-262 specifies that referenceerror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
... examples catching a referenceerror try { let a = undefinedvariable } catch (e) { console.log(e instanceof referenceerror) // true console.log(e.message) // "undefinedvariable is not defined" console.log(e.name) // "referenceerror" console.log(e.filename) // "scratchpad/1" console.log(e.linenumber) // 2 console.log(e.columnnumber) // 6 console.log(e.stack) // "@scratchpad/2:2:7\n" } creating a referenceerror try { throw new...
... referenceerror('hello', 'somefile.js', 10) } catch (e) { console.log(e instanceof referenceerror) // true console.log(e.message) // "hello" console.log(e.name) // "referenceerror" console.log(e.filename) // "somefile.js" console.log(e.linenumber) // 10 console.log(e.columnnumber) // 0 console.log(e.stack) // "@scratchpad/2:2:9\n" } specifications specification ecmascript (ecma-262)the definition of 'referenceerror' in that specification.
TypeError - JavaScript
instance properties typeerror.prototype.message error message.
... although ecma-262 specifies that typeerror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
... examples catching a typeerror try { null.f() } catch (e) { console.log(e instanceof typeerror) // true console.log(e.message) // "null has no properties" console.log(e.name) // "typeerror" console.log(e.filename) // "scratchpad/1" console.log(e.linenumber) // 2 console.log(e.columnnumber) // 2 console.log(e.stack) // "@scratchpad/2:2:3\n" } creating a typeerror try { throw new typeerror('hello', "somefile.js", 10) } catch (e)...
... { console.log(e instanceof typeerror) // true console.log(e.message) // "hello" console.log(e.name) // "typeerror" console.log(e.filename) // "somefile.js" console.log(e.linenumber) // 10 console.log(e.columnnumber) // 0 console.log(e.stack) // "@scratchpad/2:2:9\n" } specifications specification ecmascript (ecma-262)the definition of 'typeerror' in that specification.
URIError - JavaScript
instance properties urierror.prototype.message error message.
... although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
... examples catching an urierror try { decodeuricomponent('%') } catch (e) { console.log(e instanceof urierror) // true console.log(e.message) // "malformed uri sequence" console.log(e.name) // "urierror" console.log(e.filename) // "scratchpad/1" console.log(e.linenumber) // 2 console.log(e.columnnumber) // 2 console.log(e.stack) // "@scratchpad/2:2:3\n" } creating an urierror try { throw new urierror('hello', 'somefile.js', 10) } catch (e) { con...
...sole.log(e instanceof urierror) // true console.log(e.message) // "hello" console.log(e.name) // "urierror" console.log(e.filename) // "somefile.js" console.log(e.linenumber) // 10 console.log(e.columnnumber) // 0 console.log(e.stack) // "@scratchpad/2:2:9\n" } specifications specification ecmascript (ecma-262)the definition of 'urierror' in that specification.
WebAssembly.instantiate() - JavaScript
this module can be instantiated again, shared via postmessage() or cached in indexeddb.
... second overload example the following example (see our index-compile.html demo on github, and view it live also) compiles the loaded simple.wasm byte code using the webassembly.compilestreaming() method and then sends it to a worker using postmessage().
... var worker = new worker("wasm_worker.js"); webassembly.compilestreaming(fetch('simple.wasm')) .then(mod => worker.postmessage(mod) ); in the worker (see wasm_worker.js) we define an import object for the module to use, then set up an event handler to receive the module from the main thread.
... var importobject = { imports: { imported_func: function(arg) { console.log(arg); } } }; onmessage = function(e) { console.log('module received from main thread'); var mod = e.data; webassembly.instantiate(mod, importobject).then(function(instance) { instance.exports.exported_func(); }); }; specifications specification webassembly javascript interfacethe definition of 'instantiate()' in that specification.
throw - JavaScript
each of the following throws an exception: throw 'error2'; // generates an exception with a string value throw 42; // generates an exception with the value 42 throw true; // generates an exception with the value true throw new error('required'); // generates an error object with the message of required also note that the throw statement is affected by automatic semicolon insertion (asi) as no line terminator between the throw keyword and the expression is allowed.
... function userexception(message) { this.message = message; this.name = 'userexception'; } function getmonthname(mo) { mo = mo - 1; // adjust month number for array index (1 = jan, 12 = dec) var months = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec']; if (months[mo] !== undefined) { return months[mo]; } else { throw new userexception('invalidmonthno'); } } try { // statements to try var mymonth = 15; // 15 is out of bound to raise the exception var monthname = getmonthn...
...ame(mymonth); } catch (e) { monthname = 'unknown'; console.error(e.message, e.name); // pass exception object to err handler } another example of throwing an object the following example tests an input string for a u.s.
...t(zip)) { // zip code value will be the first match in the string this.value = zip.match(pattern)[0]; this.valueof = function() { return this.value }; this.tostring = function() { return string(this.value) }; } else { throw new zipcodeformatexception(zip); } } function zipcodeformatexception(value) { this.value = value; this.message = 'does not conform to the expected format for a zip code'; this.tostring = function() { return this.value + this.message; }; } /* * this could be in a script that validates address data * for us addresses.
<maction> - MathML
possible values are: statusline: if there is a click on the expression or the reader moves the pointer over it, the message is sent to the browser's status line.
... the syntax is: <maction actiontype="statusline"> expression message </maction>.
... tooltip: when the pointer moves over the expression, a tooltip box with a message is displayed near the expression.
... the syntax is: <maction actiontype="tooltip"> expression message </maction>.
Porting the Library Detector - Archive of obsolete content
ll just run when it's loaded, collect the array of library names, and post it back to main.js: function testlibraries() { var win = unsafewindow; var librarylist = []; for(var i in ld_tests) { var passed = ld_tests[i].test(win); if (passed) { var libraryinfo = { name: i, version: passed.version }; librarylist.push(libraryinfo); } } self.postmessage(librarylist); } testlibraries(); main.js responds to that message by fetching the tab corresponding to that worker using worker.tab, and adding the array of library names to that tab's libraries property: pagemod.pagemod({ include: "*", contentscriptwhen: 'end', contentscriptfile: (data.url('library-detector.js')), onattach: function(worker) { worker.on('message', function(library...
...this means we'll need two additional content scripts: one in the widget's context, which listens for icon mouseover events and sends a message to main.js containing the name of the corresponding library: function setlibraryinfo(element) { self.port.emit('setlibraryinfo', element.target.title); } var elements = document.getelementsbytagname('img'); for (var i = 0; i &lt; elements.length; i++) { elements[i].addeventlistener('mouseover', setlibraryinfo, false); } one in the panel, which updates the panel's content with the libr...
...ary information: self.on("message", function(libraryinfo) { window.document.body.innerhtml = libraryinfo; }); finally main.js relays the library information from the widget to the panel: widget.port.on('setlibraryinfo', function(libraryinfo) { widget.panel.postmessage(libraryinfo); }); ...
tabs - Archive of obsolete content
scripts in a tab you can attach a content script to the page hosted in a tab, and use that to access and manipulate the page's content (see the modifying the page hosted by a tab tutorial): var tabs = require("sdk/tabs"); tabs.on('activate', function(tab) { var worker = tab.attach({ contentscript: 'self.port.emit("html", document.body.innerhtml);' }); worker.port.on("html", function(message) { console.log(message) }) }); note that tab.attach is tab-centric: if the user navigates to a new page in the same tab, then the worker and content scripts will be reattached to the new page.
...le: // main.js const tabs = require("sdk/tabs"); tabs.open({ url: "./page.html", onready: function(tab) { tab.attach({ contentscriptfile: "./content-script.js", contentscriptoptions: { a: "blah" } }); } }); the values are accessible to content scripts via the self.options property: // content-script.js alert(self.options.a); onmessage function a function called when the content worker receives a message from content scripts.
... listeners are passed a single argument, the message posted from the content script.
jpm - Archive of obsolete content
jpm usage is: jpm [command] [options] jpm supports the following global options: -h, --help - show a help message and exit -v, --version - print the jpm version number --addon-dir - directory for your source code, defaulting to the current directory installation jpm is distributed with the node package manager npm.
... to test your installation, run: /usr/bin/env node -v if you get an error message saying /usr/bin/env: node: no such file or directory and you have installed nodejs through a package manager, nodejs may have been installed under a different executable name.
...this means that if you want to see the output from console.log() messages, you have to tweak a setting.
Implementing the widget - Archive of obsolete content
because the widget's click event does not distinguish left and right mouse clicks, we'll use a content script to capture the click events and send the corresponding message back to our add-on.
... the widget's content script the widget's content script just listens for left- and right- mouse clicks and posts the corresponding message to the add-on code: this.addeventlistener('click', function(event) { if(event.button == 0 && event.shiftkey == false) self.port.emit('left-click'); if(event.button == 2 || (event.button == 0 && event.shiftkey == true)) self.port.emit('right-click'); event.preventdefault(); }, true); save this in your data/widget directory as widget.js.
...it creates the widget and responds to messages from the widget's content script by toggling its activation state.
On page load - Archive of obsolete content
application uri to overlay firefox chrome://browser/content/browser.xul thunderbird chrome://messenger/content/messenger.xul navigator from seamonkey chrome://navigator/content/navigator.xul attaching a script attach a script to your overlay (see "attaching a script to an overlay") that adds a load event listener to appcontent element (browsers) or messagepane (mail): window.addeventlistener("load", function load(event){ window.removeeventlistener("load", load, false); //remove listener, no longer needed myextension.init(); },false); var myextension = { init: function() { var appcontent = document.getelementbyid("appcontent"); // browser if(appcontent){ appcontent.addeventlistener("domcontentloaded", myextension.onpagelo...
...ad, true); } var messagepane = document.getelementbyid("messagepane"); // mail if(messagepane){ messagepane.addeventlistener("load", function(event) { myextension.onpageload(event); }, true); } }, onpageload: function(aevent) { var doc = aevent.originaltarget; // doc is document that triggered "onload" event // do something with the loaded page.
...to attach to the unload event in above example you can use the "pagehide" event like this: appcontent.addeventlistener("pagehide", myextension.onpageunload, false); for appcontent and similarly for messagepane messagepane.addeventlistener("pagehide", myextension.onpageunload, false); and add your code to onpageunload method.
Preferences - Archive of obsolete content
let's say you want to make the default value for the extensions.myext.welcomemessage preference localizable.
... you should do the following: add this line to some .properties file (for all of your locales), say to chrome://myext/locale/defaults.properties: extensions.myext.welcomemessage=localized default value add the default value for extensions.myext.welcomemessage, pointing to that properties file, by adding the following line to your file with default preferences (see below).
... pref("extensions.myext.welcomemessage", "chrome://myext/locale/defaults.properties"); read the preference with getcomplexvalue, passing nsipreflocalizedstring as atype: var prefs = components.classes["@mozilla.org/preferences-service;1"] .getservice(components.interfaces.nsiprefservice); var branch = prefs.getbranch("extensions.myext."); var value = branch.getcomplexvalue("welcomemessage", components.interfaces.nsipreflocalizedstring).data; the code in step 3 will read the default value from chrome://myext/locale/defaults.properties when no user value is set, and will behave exactly the same as if nsisupportsstring was passed as atype otherwise.
Adding windows and dialogs - Archive of obsolete content
all it does is display a text message that the user can read and then click the ok button to dismiss it.
... we have been using the window.alert function to open alert messages in our examples so far, but that's not the right way to do it.
... if you use window.alert, the alert window will have the title [javascript application], indicating that the source of the message is not well defined.
Index of archived content - Archive of obsolete content
oznotification add-ons add-on sdk builder guides content scripts communicating with other scripts communicating using "port" communicating using "postmessage" cross-domain content scripts interacting with page scripts loading content scripts reddit example port self contributor's guide classes and inheritance content processes getting...
... ui selection jspage statusbar statusbar litmus tests mac os x build prerequisites/fink makefile.mozextension.2 message summary database metro browser chrome tests microsummary topics microsummary xml grammar reference migrate apps from internet explorer to mozilla modularization techniques monitoring downloads mozilla application framework mozilla application f...
... developing mozilla xforms implementation status mozilla xforms specials mozilla xforms user interface xforms alert element xforms group element xforms help element xforms hint element xforms input element xforms label element xforms message element xforms output element xforms range element xforms repeat element xforms secret element xforms select element xforms select1 element xforms submit element xforms switch module xforms textarea element xforms trigger element xforms upload e...
Adding the structure - Archive of obsolete content
statusbarpanel> <statusbarpanel class="statusbarpanel-iconic" id="tinderbox-status" status="none"/> <statusbarpanel class="statusbarpanel-iconic" id="offline-status"/> <statusbarpanel class="statusbarpanel-iconic" id="security-button" onclick="browserpageinfo(null, 'securitytab')"/> </statusbar> the statusbar xul element defines a horizontal status bar where informative messages about an application's state can be displayed.
... it can contain both text messages (i.e.
... "done" in mozilla when a document finishes loading) and graphical messages (f.e.
Basics - Archive of obsolete content
log(stringstring)this method writes a notification message to the console.
... stringthe message to add to the consolestring console.log("hello world!"); arn()this method does stuff.
... titlethe head of the notification message.string bodythe messagestringfalse iconthe url of an .ico file.string jetpack.notifications.show("hello world");var mybody = " my first message body on jetpack";var myicon = "http://www.mozilla.com/favicon.ico";jetpack.notifications.show({title: "my first message on jetpack", body: mybody, icon: myicon}); class tabs in this class you can find information about the tabs in your firefox window.
Frequently Asked Questions - Archive of obsolete content
why does mozilla show an "xml parsing error" message instead of svg?
... this is an xml debugging message to help xml authors correct errors in their xml documents.
... mozilla will show this message when there's an xml well formedness error in the file it tried to load.
Using cross commit - Archive of obsolete content
using the script quick overview there are a couple of common ways to use cross-commit: land something simultaneously on the trunk and mozilla_1_8_branch # modify the files (probably by applying the patch) patch -p0 < ~/caret.patch # commit on trunk and branch at once # make sure to use -m "commit message" when doing so tools/cross-commit -m "fix some sort of security bug" layout/base/nscaret.h land something on two other branches that has already landed on the trunk # update to the first branch you want to land on cvs update -rmozilla_1_8_branch layout/base/nscaret.h # modify the files (probably by applying the patch) patch -p0 < ~/caret.patch # commit on all the branches at once # ma...
...ke sure to use -m "commit message" when doing so tools/cross-commit --moz18 --branch mozilla_1_8_0_branch -m "fix some sort of security bug" layout/base/nscaret.h notes note that you must use a -m option with a cvs checkin message.
... otherwise cross-commit will end up waiting forever for you to type a cvs checkin message in an editor that it never shows you!
alert - Archive of obsolete content
summary the alert function displays a modal dialog box with a message representing the input.
... method of install object syntax void alert ( string message ); parameters the message parameter is displayed as a string in the dialog box.
... if message is not a string, then it is converted into one and displayed.
Index - Archive of obsolete content
ArchiveMozillaXULIndex
this element is often used with a short label or icon to indicate status, for instance whether the user is online or whether there are new messages.
... 906 message-icon xul reference, xul_style_classes no summary!
... 1144 notification xul elements, xul reference the notification is used to display an informative message.
Mozilla release FAQ - Archive of obsolete content
regarding shells, i would like to recommend the following: if you are using unix, use bash-family shells for the build because of the better control over redirection (in case you want to log errors and messages) if you are using win32, using the default shell cmd.exe (as opposed to 4dos or 4nt) will probably yield better results.
...has (at least) the following new features: xml support a highly configurable appearance (courtesy of xul) publicly available source code :) http compression exists on more platforms mathml support (somewhat limited at the moment) a significantly faster rendering engine better html support (css 1 and partial css 2, dom 1 and partial dom 2) plug-in jvm support tabbed browsing message filtering an irc client why is the animated icon different?
...you can find the binaries at mozilla.org's binaries page on win32, it fails to build, with the message '.\win32' unexpected you didn't properly set the environment variables -- you must not include a space at the end of the set statements (be careful if you are cut'n'pasting).
NPAPI plugin developer guide - Archive of obsolete content
using the appropriate attributes using the embed element for plug-in display using custom embed attributes plug-in references plug-in development overview writing plug-ins registering plug-ins ms windows unix mac os x drawing a plug-in instance handling memory sending and receiving streams working with urls getting version and ui information displaying messages on the status line making plug-ins scriptable building plug-ins building, platforms, and compilers building carbonized plug-ins for mac os x type libraries installing plug-ins native installers xpi plug-ins installations plug-in installation and the windows registry initialization and destruction initialization instance creation instance destruction shu...
...n initialize and shutdown example drawing and event handling the npwindow structure drawing plug-ins printing the plug-in setting the window getting information windowed plug-ins mac os windows unix event handling for windowed plug-ins windowless plug-ins specifying that a plug-in is windowless invalidating the drawing area forcing a paint message making a plug-in opaque making a plug-in transparent creating pop-up menus and dialog boxes event handling for windowless plug-ins streams receiving a stream telling the plug-in when a stream is created telling the plug-in when a stream is deleted finding out how much data the plug-in can accept writing the stream to the plug-in sending the stream in random-access mode ...
...e stream deleting the stream example of sending a stream urls getting urls getting the url and displaying the page posting urls posting data to an http server uploading files to an ftp server sending mail memory allocating and freeing memory mac os flushing memory (mac os only) version, ui, and status information displaying a status line message getting agent information getting the current version finding out if a feature exists reloading a plug-in ...
NPN_InvalidateRect - Archive of obsolete content
npn_invalidaterect() causes the npp_handleevent() method to pass an update event or a paint message to the plug-in.
... after calling this method, the plug-in receives a paint message asynchronously.
...to immediately send a paint message, the plug-in can call npn_forceredraw() after calling this method.
NPN_InvalidateRegion - Archive of obsolete content
npn_invalidateregion() causes the npp_handleevent() method to pass an update event or a paint message to the plug-in.
... if a plug-in calls this method, it receives a paint message later.
...to force a paint message, the plug-in can call npn_forceredraw() after calling this method.
Encryption and Decryption - Archive of obsolete content
thus, as long as the symmetric key is kept secret by the two parties using it to encrypt communications, each party can be sure that it is communicating with the other as long as the decrypted messages continue to make sense.
...a person with an unauthorized symmetric key not only can decrypt messages sent with that key, but can encrypt new messages and send them as if they came from one of the two parties who were originally using the key.
...client software such as firefox can then use your public key to confirm that the message was signed with your private key and that it hasn't been tampered with since being signed.
Vulnerabilities - Archive of obsolete content
for example, email client software may contain a feature that renders html content in email messages.
... an attacker could craft a fraudulent email message that contains hyperlinks that, when rendered in html, appear to the recipient to be benign but actually take the recipient to a malicious web site when they are clicked on.
...however, an attacker could generate false arp messages to poison a system’s arp table and thereby launch a denial-of-service or a man-in-the-middle attack.
Error.number - Archive of obsolete content
var x = y; } catch(e) { document.write ("error code: "); document.write (e.number & 0xffff) document.write ("<br />"); document.write ("facility code: ") document.write(e.number>>16 & 0x1fff) document.write ("<br />"); document.write ("error message: ") document.write (e.message) } example the output of this code is as follows.
... error code: 5009 facility code: 10 error message: 'y' is undefined requirements supported in the following document modes: quirks, internet explorer 6 standards, internet explorer 7 standards, internet explorer 8 standards, internet explorer 9 standards, internet explorer 10 standards, internet explorer 11 standards.
... applies to: error object see also description property (error) message property (error) name property (error) ...
LiveConnect Overview - Archive of obsolete content
the javascript interpreter generates an error message that is converted into an instance of jsexception.
...the interpreter generates an error message, the java handler catches the message, and the doit method returns an instance of netscape.javascript.jsexception.
...backward compatibility in javascript 1.3 and earlier versions, the jsexception class had three public constructors which optionally took a string argument, specifying the detail message or other information for the exception.
XForms Hint Element - Archive of obsolete content
the message of the hint element can exist in instance data, in a remote document, or as inline text.
... if more than one source of message is specified in this element, the order of precedence is: single node binding attributes, linking attributes, inline text.
... representations is represented by a tooltip window that contains the hint element's message.
Desktop gamepad controls - Game development
var message = 'gamepad connected!
... press y for controls'; var textgamepad = this.add.text(message, ...); textgamepad.visible = false; } in the update() function, which is executed every frame, we can wait until the controller is actually connected, so the proper text can be shown.
... 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() { // ...
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.
... when the number of available lives reaches zero, the game is over and the game over alert message will be shown.
...in our case, on every outofbounds event the ballleavescreen will be executed, but when the ball leaves the screen we only want to remove the message from the screen once.
Cryptographic hash function - MDN Web Docs Glossary: Definitions of Web-related terms
a cryptographic hash function, also sometimes called a digest function, is a cryptographic primitive transforming a message of arbitrary size into a message of fixed size, called a digest.
... cryptographic hash functions are used for authentication, digital signatures, and message authentication codes.
... to be used for cryptography, a hash function must have these qualities: quick to compute (because they are generated frequently) not invertible (each digest could come from a very large number of messages, and only brute-force can generate a message that leads to a given digest) tamper-resistant (any change to a message leads to a different digest) collision-resistant (it should be impossible to find two different messages that produce the same digest) cryptographic hash functions such as md5 and sha-1 are considered broken, as attacks have been found that significantly reduce their collision resistance.
Digest - MDN Web Docs Glossary: Definitions of Web-related terms
a digest is a small value generated by a hash function from a whole message.
... ideally, a digest is quick to calculate, irreversible, and unpredictable, and therefore indicates whether someone has tampered with a given message.
... a digest can be used to perform several tasks: in non-cryptographic applications (e.g., the index of hash tables, or a fingerprint used to detect duplicate data or to uniquely identify files) verify message integrity (a tampered message will have a different hash) store passwords so that they can't be retrieved, but can still be checked (to do this securely, you also need to salt the password.) generate pseudo-random numbers generate keys it is critical to choose the proper hash function for your use case to avoid collisions and predictability.
Public-key cryptography - MDN Web Docs Glossary: Definitions of Web-related terms
anyone could encrypt a message to the owner of the private key, but only the owner of the private key could decrypt it.
... however, they are typically much slower than symmetric algorithms and the size of message they can encrypt is proportional to the size of the key, so they do not scale well for long messages.
... as a result, it's common for an encryption system to use a symmetric algorithm to encrypt the message, then a public-key system to encrypt the symmetric key.
Signature (security) - MDN Web Docs Glossary: Definitions of Web-related terms
a signature, or digital signature, is a protocol showing that a message is authentic.
... from the hash of a given message, the signing process first generates a digital signature linked to the signing entity, using the entity's private key.
... on receiving the message, the verification process authenticates the sender - uses the sender's public key to decrypt the signature and recover the hash, which can only be created with the sender's private key, and checks message integrity - compares the hash with a newly calculated one from the received document (the two hashes will differ if the document has been tampered with) the system fails if the private key is compromised or the recipient is deceitfully given the wrong public key.
TCP handshake - MDN Web Docs Glossary: Definitions of Web-related terms
tcp uses a three-way handshake (aka tcp-handshake, three message handshake, and/or syn-syn-ack) to set up a tcp/ip connection over an ip based network.
... 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.
... the three message mechanism is designed so that two computers that want to pass information back and forth to each other can negotiate the parameters of the connection before transmitting data such as http browser requests.
Transmission Control Protocol (TCP) - MDN Web Docs Glossary: Definitions of Web-related terms
tcp handshake the tcp three-way handshake, also called the tcp-handshake, three message handshake, and/or syn-syn-ack, is the method used by tcp to set up a tcp/ip connection over an ip-based network.
... 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.
... the three message mechanism is designed for the two computers that want to pass information back and forth and can negotiate the parameters of the connection before transmitting data such as http browser requests.
Hash - MDN Web Docs Glossary: Definitions of Web-related terms
the hash function takes a variable length message input and produces a fixed-length hash output.
... it is commonly in the form of a 128-bit "fingerprint" or "message digest".
...this provides the basis for hmac's, which provide message authentication.
CSS and JavaScript accessibility best practices - Learn web development
here you'll see a simple form; when you try to submit the form with one or both fields left empty, the submit fails, and an error message box appears to tell you what is wrong.
...orm.onsubmit = validate; function validate(e) { errorlist.innerhtml = ''; for(let i = 0; i < formitems.length; i++) { const testitem = formitems[i]; if(testitem.input.value === '') { errorfield.style.left = '360px'; createlink(testitem); } } if(errorlist.innerhtml !== '') { e.preventdefault(); } } note: in this example, we are hiding and showing the error message box using absolute positioning rather than another method such as visibility or display, because it doesn't interfere with the screen reader being able to read content from it.
...if there are errors (if(errorlist.innerhtml !== '')) then we stop the form submitting (using preventdefault()), and display any error messages that have been created (see below).
WAI-ARIA basics - Learn web development
at the end of this section we showed that we have included some aria attributes on the error message box that displays any validation errors when you try to submit the form: <div class="errors" role="alert" aria-relevant="all"> <ul> </ul> </div> role="alert" automatically turns the element it is applied to into a live region, so changes to it are read out; it also semantically identifies it as an alert message (important time/context sensitive information), and represents a better, more ...
...wai-aria does include aria-valuemin and aria-valuemax properties to specify min and max values, but these currently don't seem very well supported; a better supported feature is the html5 placeholder attribute, which can contain a message that is shown in the input when no value is entered, and is read out by a number of screenreaders.
...make a local copy of fake-div-buttons.html, and add role="button" to each button <div>, for example: <div data-message="this is from the first button" tabindex="0" role="button">click me!</div> now when you try this using a screenreader, you'll have buttons be reported using phrases like "click me!, button" — much better.
Test your skills: Form validation - Learn web development
try submitting your form — it should refuse to submit until the above constaints are followed, and give suitable error messages.
...we would like you to use the constraint validation api, plus some form validation attributes, to program some custom error messages.
...if it doesn't look like an email address or is too short, provide the user with appropriate custom error messages.
Making asynchronous programming easier with async and await - Learn web development
status: ${response.status}`); } else { return response.blob(); } }) .then(myblob => { let objecturl = url.createobjecturl(myblob); let image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); }) .catch(e => { console.log('there has been a problem with your fetch operation: ' + e.message); }); by now, you should have a reasonable understanding of promises and how they work, but let's convert this to use async/await to see how much simpler it makes things: async function myfetch() { let response = await fetch('coffee.jpg'); if (!response.ok) { throw new error(`http error!
... status: ${response.status}`); } else { let myblob = await response.blob(); let objecturl = url.createobjecturl(myblob); let image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); } } myfetch() .catch(e => { console.log('there has been a problem with your fetch operation: ' + e.message); }); it makes code much simpler and easier to understand — no more .then() blocks everywhere!
...ob = await response.blob(); let objecturl = url.createobjecturl(myblob); let image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); } } catch(e) { console.log(e); } } myfetch(); the catch() {} block is passed an error object, which we've called e; we can now log that to the console, and it will give us a detailed error message showing where in the code the error was thrown.
Choosing the right approach - Learn web development
single delayed operation repeating operation multiple sequential operations multiple simultaneous operations yes yes (recursive timeouts) yes (nested timeouts) no code example here the browser will wait two seconds before executing the anonymous function, then will display the alert message (see it running live, and see the source code): let mygreeting = settimeout(function() { alert('hello, mr.
...splays it inside an <img> element; see it live also, and see also the source code: fetch('coffee.jpg') .then(response => response.blob()) .then(myblob => { let objecturl = url.createobjecturl(myblob); let image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); }) .catch(e => { console.log('there has been a problem with your fetch operation: ' + e.message); }); pitfalls promise chains can be complex and hard to parse.
...the function return fetch(url).then(response => { // depending on what type of file is being fetched, use the relevant function to decode its contents if(type === 'blob') { return response.blob(); } else if(type === 'text') { return response.text(); } }) .catch(e => { console.log(`there has been a problem with your fetch operation for resource "${url}": ` + e.message); }); } // call the fetchanddecode() method to fetch the images and the text, and store their promises in variables let coffee = fetchanddecode('coffee.jpg', 'blob'); let tea = fetchanddecode('tea.jpg', 'blob'); let description = fetchanddecode('description.txt', 'text'); // use promise.all() to run code only when all three function calls have resolved promise.all([coffee, tea, description]).
Cooperative asynchronous JavaScript: Timeouts and intervals - Learn web development
in the following example, the browser will wait two seconds before executing the anonymous function, then will display the alert message (see it running live, and see the source code): let mygreeting = settimeout(function() { alert('hello, mr.
...after that time, a message will appear saying "players go!!" — once this happens, the first player to press their control button will win the game.
... when e.key is "a", display a message to say that player 1 won, and when e.key is "l", display a message to say player 2 won.
Storing the information you need — Variables - Learn web development
the second line displays a welcome message that includes their name, taken from the variable value.
... you may not fully understand the syntax we are using (yet!), but you should be able to get the idea — if we didn't have variables available, we'd have to implement a giant code block that checked what the entered name was, and then display the appropriate message for any name.
...if they don't exist, you'll get an error message — try typing in scoobydoo; note: don't confuse a variable that exists but has no defined value with a variable that doesn't exist at all — they are very different things.
Introduction to the server side - Learn web development
web servers wait for client request messages, process them when they arrive, and reply to the web browser with an http response message.
... a few examples include: facebook and twitter send emails and sms messages to notify you of new communications.
... a web server might send warning messages to site administrators alerting them to low memory on the server, or suspicious user activity.
Adding a new event
add event messages you need to add event messages which are stored by widgetevent::message.
... all messages are defined by macro in "messages" section of basicevents.h.
... eventnamelist.h defines mapping between dom event name, internal event message, event handler attribute owner and internal event class.
Chrome registration
each line is parsed individually; if the line is parsable the chrome registry takes the action identified by that line, otherwise the chrome registry ignores that line (and prints a warning message in the runtime error console).
...if the above example had a packagename of camelcasepackage, you would get an error message similar to "no chrome registered for chrome://camelcasepackage/path/to/files".
...if not, you would get a message in the error console that the appversion flag was not recognized.
Command line options
each message option follows the syntax field=value, for example: to=foo@nowhere.net subject=cool page attachment=www.mozilla.org attachment='file:///c:/test.txt' body=check this page or also in thunderbird 52 and newer: body=c:\path\to\file.txt separate multiple message options by comma (,), for example: "to=foo@nowhere.net,subject=cool page" .
... -compose message_options start with mail composer.
... miscellaneous -attach-console write messages for the debugging console into the window which launched the application instead of opening a new window for the debugging messages.
Creating a Language Pack
$ make wget-en-us en_us_binary_url=http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-aurora if you're building on mac 64 bit, you'll need to change the command slightly: $ make wget-en-us en_us_binary_url=http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-mozilla-aurora moz_pkg_platform=mac at some point, you should see the following success message: downloaded http://ftp.mozilla.org/pub/mozilla.o....en-us.mac.dmg to /users/your_id/mozilla/vc/firefox/browser/locales/../../dist/firefox-3.6b5pre.en-us.mac.dmg the en-us binary has been downloaded.
... at the end of the process, you should see the following success message.
... $ make merge-x-testing locale_mergedir=$(pwd)/mergedir $ make installers-x-testing locale_mergedir=$(pwd)/mergedir at the end of the process, you should see the following success message.
Eclipse CDT
it also used to be necessary to add the following two lines to your mozconfig to make the compiler output errors all on a single line, but that may not be needed anymore: export cflags="-fmessage-length=0" export cppflags="-fmessage-length=0" debugging to create a debug configuration, open the project properties window, and select "run/debug settings" on the left.
... problem occurred (java heap space) if eclipse becomes glacially slow or hangs and then you get this error message, see the increasing memory limits section above.
... resource is out of sync with the file system if you get the message "resource is out of sync with the file system", then you didn't set the "refresh" options above in the initial workspace preferences section.
Listening to events on all tabs
the status message is intended to be displayed to the user (e.g., in the status bar of the browser).
... void onstatuschange( nsidomxulelement abrowser, nsiwebprogress awebprogress, nsirequest arequest, nsresult astatus, prunichar *amessage ); parameters abrowser the browser that fired the notification.
... amessage localized text corresponding to astatus.
Limitations of frame scripts
examples of apis add-on authors should avoid in frame scripts: nsifileinputstream nsifileoutputstream constructing a file from a string or nsifile (but file objects can be sent via message manager) htmlinputelement.mozsetfilenamearray (alternative: mozsetfilearray) xul and browser ui anything that tries to touch the browser ui or anything to do with xul is likely to not work in the content process.
... if you want a chrome window: send a message from the content process using the message manager.
... the target property of the object passed into the message handler in the chrome process is the xul <browser> receiving the message, and you can get the chrome window from that (note: i'm not really sure how...).
Limitations of frame scripts
for example: nsifileinputstream nsifileoutputstream constructing a file from a string or nsifile (but file objects can be sent via message manager) htmlinputelement.mozsetfilenamearray (alternative: mozsetfilearray) file: uris, see bug 1187099 <...> xul and browser ui anything that tries to touch the browser ui or anything to do with xul is likely not to work in the content process.
... if you want a chrome window: send a message from the content process using the message manager.
... the target property of the object passed into the message handler in the chrome process is the xul <browser> receiving the message, and you can get the chrome window from that (i'm not sure how).
IPDL Type Serialization
types are serialized and deserialized from an ipc::message type declared in ipc_message.h.
... each type specializes ipc::paramtraits as follows: namespace ipc { template <> struct paramtraits<mytype> { typedef mytype paramtype; static void write(message* amsg, const paramtype& aparam) { // implement serialization here } static bool read(const message* amsg, void** aiter, paramtype* aresult) { // implement deserialization here.
...most structures can be serialized in this manner: struct examplestruct { int i; nscstring j; int k[4]; }; namespace ipc { template <> struct paramtraits<examplestruct> { typedef examplestruct paramtype; static void write(message* amsg, const paramtype& aparam) { writeparam(amsg, aparam.i); writeparam(amsg, aparam.j); for (int i = 0; i < 4; ++i) writeparam(amsg, aparam.k[i]); } static bool read(const message* amsg, void** aiter, paramtype* aresult) { if (!readparam(amsg, aiter, &(aresult->i)) || !readparam(amsg, aiter, &(aresult->j))) return false; for (int i = 0; i < 4; +...
Log.jsm
the log.jsm javascript code module (formerly named log4moz.js) provides a log4j style api for logging log messages to various endpoints, such as the browser console or a file on disk.
...log.addappender(new log.dumpappender(new log.basicformatter())); // log some messages log.error("oh noes!!
... dumpappender(); length: 1 keys of prototype: doappend(); fileappender(); length: 2 keys of prototype: doappend(); reset(); formatter(); length: 0 keys of prototype: format(); logmessage(); length: 4 keys of prototype: leveldesc logger(); length: 2 keys of prototype: addappender(); level logstructured(); name parent removeappender(); updateappenders(); ...
NetUtil.jsm
exceptions thrown this method throws an exception with the message "must have a source and a sink" if either asource or asink is null.
... exceptions thrown this method throws an exception with the message "must have a source and a callback" if either asource or acallback is null.
... exceptions thrown this method throws an exception with the message "must have a non-null string spec or nsifile object" and result code ns_error_invalid_arg if aspec is null.
Webapps.jsm
amanifest, adestapp) appkind: function(aapp, amanifest) updatepermissionsforapp: function(aid, aispreinstalled) updateofflinecacheforapp: function(aid) installpreinstalledapp: function installpreinstalledapp(aid) removeifhttpsduplicate: function(aid) installsystemapps: function() loadandupdateapps: function() updatedatastore: function(aid, aorigin, amanifesturl, amanifest) _registersystemmessagesforentrypoint: function(amanifest, aapp, aentrypoint) _registerinterappconnectionsforentrypoint: function(amanifest, aapp,) _registersystemmessages: function(amanifest, aapp) _registerinterappconnections: function(amanifest, aapp) _createactivitiestoregister: function(amanifest, aapp, aentrypoint, arunupdate) _registeractivitiesforapps: function(aappstoregister, arunupdate) _registeractivit...
...ies: function(amanifest, aapp, arunupdate) _createactivitiestounregister: function(amanifest, aapp, aentrypoint) _unregisteractivitiesforapps: function(aappstounregister) _unregisteractivities: function(amanifest, aapp) _processmanifestforids: function(aids, arunupdate) observe: function(asubject, atopic, adata) addmessagelistener: function(amsgnames, aapp, amm) removemessagelistener: function(amsgnames, amm) formatmessage: function(adata) receivemessage: function(amessage) getappinfo: function getappinfo(aappid) broadcastmessage: function broadcastmessage(amsgname, acontent) registerupdatehandler: function(ahandler) unregisterupdatehandler: function(ahandler) notifyupdatehandlers: function(aapp, amanifest, azippath) _getappdir: function(aid) _writefile: function(apath, adata) do...
...calidbystoreid: function(astoreid) getappbylocalid: function(alocalid) getmanifesturlbylocalid: function(alocalid) getapplocalidbymanifesturl: function(amanifesturl) getcoreappsbasepath: function() getwebappsbasepath: function() _islaunchable: function(aapp) _notifycategoryandobservers: function(subject, topic, data, msg) registerbrowserelementparentforapp: function(amsg, amn) receiveappmessage: function(appid, message) _clearprivatedata: function(appid, browseronly, msg) _sendprogressevent: function() updatestatechanged: function appobs_update(aupdate, astate) applicationcacheavailable: function appobs_cacheavail(aapplicationcache) ...
Localization Use Cases
in order to construct a grammatically-correct and naturally-sounding message, we must know the gender of the subject.
...<brandshortname "boot2gecko" _gender:"neutral"> now we can translate crash-banner-os2 into polish without sounding like a robot: <crashbanneros2[brandshortname::_gender] { masculine: "{{ brandshortname }} uległ awarii", feminine: "{{ brandshortname }} uległa awarii", neutral: "{{ brandshortname }} uległo awarii" }> this will give us, depending on the current branding, the following messages: firefox os uległ awarii boot2gecko uległo awarii isolation let's look at how the settings app formats sizes.
... in the javascript code, the developer needs to pass sizeinfo.unit instead of a localized value: function showformatedsize(element, l10nid, size) { // … element.textcontent = document.l10n.get(l10nid, { size: sizeinfo.size, unit: sizeinfo.unit }); } and then use the $unit variable verbatim in the english message: <availablesize "{{ $size }} {{ $unit }} available"> in french, the localizer can then use the value of $unit to match it against a translated abbreviation, like so: <_unitedemesure { b: "o", kb: "ko", mb: "mo", gb: "go", tb: "to" }> <availablesize "il reste {{ $size }} {{ _unitedemesure[unit] }}"> similarly, other local variables could be used to provide better and more natural...
MailNews automated testing
message synthesis: create messages by specifying what properties the messages should have.
... message injection: inject synthesized messages via local or imap (using a fake server).
... message manipulation: mark messages as read, tag them, untag them, move them to other folders, trash them, etc.
NSS_3.12_release_notes.html
bug 406647: libpkix does not use user defined revocation checkers bug 407064: pkix_pl_ldapcertstore_buildcrllist should not fail if a crl fails to be decoded bug 421216: libpkix test nss_thread leaks a test certificate bug 301259: signtool usage message is unhelpful bug 389781: nss should be built size-optimized in browser builds on linux, windows, and mac bug 90426: use of obsolete typedefs in public nss headers bug 113323: the first argument to pk11_findcertfromnickname should be const.
...917: crlutil should init nss read-only for some options bug 350948: freebl macro change can give 1% improvement in rsa performance on amd64 bug 352439: reference leaks in modutil bug 369144: certutil needs option to generate subjectkeyid extension bug 391771: pk11_config_name and pk11_config_strings leaked on shutdown bug 401194: crash in lg_findobjects on win64 bug 405652: in the tls clienthello message the gmt_unix_time is incorrect bug 424917: performance regression with studio 12 compiler bug 391770: ocsp_global.monitor is leaked on shutdown bug 403687: move pkix functions to certvfypkix.c, turn off ev_test_hack bug 428105: cert_setocsptimeout is not defined in any public header file bug 213359: enhance pk12util to extract certs from p12 file bug 329067: nss encodes cert distinguished name at...
...s -v -u option bug 175741: strict aliasing bugs in mozilla/dbm bug 210584: cert_asciitoname doesn't accept all valid values bug 298540: vfychain usage option should be improved and documented bug 323570: make dbck debug mode work with softoken bug 371470: vfychain needs option to verify for specific date bug 387621: certutil's random noise generator isn't very efficient bug 390185: signtool error message wrongly uses the term database bug 391651: need config.mk file for windows vista bug 396322: fix secutil's code and nss tools that print public keys bug 417641: miscellaneous minor nss bugs bug 334914: hopefully useless null check of out it in jar_find_next bug 95323: ckfw should support cipher operations.
NSS Sample Code Sample_1_Hashing
this program illustrates the use of nss message apis.
..._fprintf(out, "%02x:", data[i]); column += 3; } else { pr_fprintf(out, "%02x", data[i]); column += 2; break; } if (column > 76 || (i % 16 == limit)) { newline(out); column = level; limit = i % 16; } } if (column != level) { newline(out); } } /* * prints a usage message and exits */ static void usage(const char *progname) { int htype; int hash_algtotal = sizeof(hash_names) / sizeof(hash_names[0]); fprintf(stderr, "usage: %s -t type [ < input ] [ > output ]\n", progname); fprintf(stderr, "%-20s specify the digest method (must be one of\n", "-t type"); fprintf(stderr, "%-20s ", ""); for (htype = 0; htype < hash_algtotal; htyp...
...it illustrates the use of nss message * apis.
Hashing - sample 1
the nss same code below computes the hash of a file and saves it to another file, this illustrates the use of nss message apis.
...fprintf(out, "%02x:", data[i]); column += 3; } else { pr_fprintf(out, "%02x", data[i]); column += 2; break; } if (column > 76 || (i % 16 == limit)) { newline(out); column = level; limit = i % 16; } } if (column != level) { newline(out); } } /* * prints a usage message and exits */ static void usage(const char *progname) { int htype; int hash_algtotal = sizeof(hash_names) / sizeof(hash_names[0]); fprintf(stderr, "usage: %s -t type [ < input ] [ > output ]\n", progname); fprintf(stderr, "%-20s specify the digest method (must be one of\n", "-t type"); fprintf(stderr, "%-20s ", ""); for (htype = 0; htype < hash_algtotal; htyp...
...it illustrates the use of nss message * apis.
NSS Tools
source, documentation, tasks/plans cmsutil 1.0 performs basic cms operations such as encrypting, decrypting, and signing messages.
... source, documentation, tasks/plans sslstrength ssl strength documentation ssltap 3.2 proxy requests for an ssl server and display the contents of the messages exchanged between the client and server.
... the ssltap tool does not decrypt data, but it shows things like the type of ssl message (clienthello, serverhello, etc) and connection data (protocol version, cipher suite, etc).
NSS Tools ssltap
the tool cannot and does not decrypt any encrypted message data.
... type = 14 (server_hello_done) length = 0 (0x000000) }}]--> [sslrecord { 0: 16 03 00 00 44 |....d type = 22 (handshake) version = { 3,0 } length = 68 (0x44) handshake { 0: 10 00 00 40 |...@ type = 16 (client_key_exchange) length = 64 (0x000040) clientkeyexchange { message = {...} } }}]--> [sslrecord { 0: 14 03 00 00 01 |.....
...rt.001' } } } type = 12 (server_key_exchange) length = 202 (0x0000ca) type = 14 (server_hello_done) length = 0 (0x000000) }}]--> [sslrecord { type = 22 (handshake) version = { 3,0 } length = 68 (0x44) handshake { type = 16 (client_key_exchange) length = 64 (0x000040) clientkeyexchange { message = {...} } }}]--> [sslrecord { type = 20 (change_cipher_spec) version = { 3,0 } length = 1 (0x1)}sslrecord { type = 22 (handshake) version = { 3,0 } length = 56 (0x38) < encrypted >}]<-- [sslrecord { type = 20 (change_cipher_spec) version = { 3,0 } length = 1 (0x1)}]<-- [sslrecord { type = 22 (handshake) version = { 3,0 } length = ...
NSS tools : signtool
note that versions 1.1 and later of netscape signing tool correctly recognizes the codebase attribute, allows paths to be expressed for the class and src attributes instead of filenames only, processes link tags and parses html correctly, and offers clearer error messages.
...a value of -1 suppresses most messages, but not error messages.
... outfile name of a file to which output and error messages will be redirected.
SpiderMonkey Internals
a look at the places where jsshell.msg is used in js.cpp shows how error messages can be handled in jsapi applications.
... these messages can be localized at compile time by replacing the .msg file; or, with a little modification to the source, at run time.
... js.msg spidermonkey error messages.
Introduction to the JavaScript shell
-w, --warnings enables warning messages.
... -w, --nowarnings disables warning messages.
...for example, if you want to display a message when line 6 of a function, dosomething() is executed, you can enter the following: trap(dosomething, line2pc(dosomething, 6), "print('line 6!\n')"); note: when a trap is set, the corresponding bytecode in the program is replaced with a trap bytecode until you use untrap() to remove the trap.
JSErrorFormatString
this article covers features introduced in spidermonkey 17 represent error message and type.
... argcount uint16_t the number of arguments to expand in the formatted error message.
... description jserrorformatstring is a struct to represent error message and type, returned by js_reporterrornumber function.
JS_SetErrorReporter
callback syntax typedef void (* jserrorreporter)(jscontext *cx, const char *message, jserrorreport *report); name type description cx jscontext * the context in which the error happened.
... message const char * an error message.
...tted: class myrequest { public: void execute() { auto rt = js_newruntime(memlimit); js_setruntimeprivate(rt, this); js_seterrorreporter(rt, &myrequest::dispatcherror); // execute js } void onerror(const std::string& error) { // handle error } static void dispatcherror( jscontext* ctx, const char* message, jserrorreport* report) { auto rt = js_getruntime(ctx); auto rt_userdata = js_getruntimeprivate(rt); if (rt_userdata) { auto req = static_cast<myrequest*>(rt_userdata); req->onerror(message); } } }; see also mxr id search for js_geterrorreporter mxr id search for js_seterrorreporter bug 1277278 - js_seterrorreporter...
WebReplayRoadmap
seeing messages in the console provides a simple and intuitive view into the order in which events have happened.
... in a recording tab, however, this will update the console with messages for every time the location has ever been hit.
... these messages will show up on the timeline and can be seeked to in the same way as other console messages.
XForms Accessibility
alert this message will be shown when the form control cannot properly bind to instance data or when the instance data value is invalid or out of the specified range of selectable values (see the spec, the docs).
... message used in combination with event listeners to display a message to the user when the specified event occurs (see the spec, the docs).
... the message element has role_alert role.
nsIAlertsService
1.0 66 introduced gecko 1.7 inherits from: nsisupports last changed in gecko 22 (firefox 22 / thunderbird 22 / seamonkey 2.19) by default a message is displayed in a small window that slides up from the bottom of the screen, holds there for a few seconds, then slides down.
...ice); try { alertsservice.showalertnotification("chrome://mozapps/skin/downloads/downloadicon.png", "alert title", "alert text goes here.", false, "", null, ""); } catch (e) { // this can fail on mac os x } listening for callbacks you can be notified when the notification window disappears or the user clicks on the message by passing an object implementing nsiobserver as the alertlistener parameter: var listener = { observe: function(subject, topic, data) { alert("subject=" + subject + ", topic=" + topic + ", data=" + data); } } var alertsservice = components.classes["@mozilla.org/alerts-service;1"].
...strecentwindow('navigator:firefox'), 'focus firefox', 'will now focus fireox and then focus the tab'); } else if (atopic == 'alertshow') { console.log('just showed notification'); } else if (atopic == 'alertfinished') { console.log('just alertfinished') } } }; as.showalertnotification('chrome://branding/content/icon64.png', 'stackoverflow - new messages', 'there are ## new messages.
nsIAuthPrompt
text the text of the prompt message dialog box.
... text the text of the prompt message dialog box.
... text the text of the prompt message dialog box.
nsIConsoleListener
xpcom/base/nsiconsolelistener.idlscriptable this interface allows you to listen for messages sent to the console.
... inherits from: nsisupports last changed in gecko 1.7 method overview void observe(in nsiconsolemessage amessage); methods observe() called by the nsiconsoleservice when a message is posted to the console.
... listeners must first be attached to the service using nsiconsoleservice.registerlistener() void observe( in nsiconsolemessage amessage ); parameters amessage the nsiconsolemessage being posted.
nsIDBFolderInfo
as a service: var dbfolderinfo = components.classes["@mozilla.org/????????????????????????????"] .createinstance(components.interfaces.nsidbfolderinfo); method overview long andflags(in long flags); void changeexpungedbytes(in long delta); void changenummessages(in long delta); void changenumunreadmessages(in long delta); boolean getbooleanproperty(in string propertyname, in boolean defaultvalue); void getcharacterset(out acstring charset, out boolean overriden); void getcharactersetoverride(out boolean charactersetoverride); obsolete since gecko 1.8 string getcharptrcharact...
...key expungedbytes long flags long folderdate unsigned long foldername string foldersize unsigned long highwater nsmsgkey imaphierarchyseparator wchar imaptotalpendingmessages long imapuidvalidity long imapunreadpendingmessages long knownartsset string locale astring mailboxname astring nummessages long numunreadmessages long sortorde...
...gs() long andflags( in long flags ); parameters flags missing description return value missing description exceptions thrown missing exception missing description changeexpungedbytes() void changeexpungedbytes( in long delta ); parameters delta missing description exceptions thrown missing exception missing description changenummessages() void changenummessages( in long delta ); parameters delta missing description exceptions thrown missing exception missing description changenumunreadmessages() void changenumunreadmessages( in long delta ); parameters delta missing description exceptions thrown missing exception missing description getbooleanproperty() boole...
nsIDocShell
void setcurrenturi(in nsiuri auri); void suspendrefreshuris(); void tabtotreeowner(in boolean forward, out boolean tookfocus); attributes attribute type description allowauth boolean certain dochshells (like the message pane) should not throw up auth dialogs because it can act as a password trojan.
... app_type_mail 1 this is the value of the apptype attribute used by thunderbird and seamonkey to indicate that email messages are displayed in this window.
... app_type_editor 2 this is the value of the apptype attribute used by thunderbird and seamonkey to indicate that email messages or web pages are composed in this window.
nsIFaviconService
this might be done at any time on a timer, so you should not let the message loop run between calls or your icon may get deleted.
...this will make the notifications more efficient since the icon will already have data when the set favicon observer messages goes out.
...this will make the notifications more efficient since the icon will already have data when the set favicon observer messages goes out.
nsIMsgCompFields
« xpcom api reference summary the nsimsgcompfields interface provides properties for an composition of an outgoing message.
...(bug 68784) messageid char * needtocheckcharset prbool indicates whether we need to check if the current documentcharset can represent all the characters in the message body.
... header methods void setheader(char* name, char* value); references this interface is the type of the following properties: nsimsgcompose.compfields, nsimsgcomposeparams.composefields this interface is passed as an argument to the following methods: nsimsgcomposesecure.begincryptoencapsulation, nsimsgcomposesecure.requirescryptoencapsulation, nsimsgsend.createandsendmessage, nsimsgsend.sendmessagefile, nsismimejshelper.getnocertaddresses, nsismimejshelper.getrecipientcertsinfo ...
nsIToolkit
widget/public/nsitoolkit.idlnot scriptable this interface is used to initialize a message pump.
...void init( in prthread athread ); parameters athread the thread passed in runs the message pump.
... null can be passed in, in which case a new thread gets created and a message pump will run in that thread.
nsIWebSocketChannel
received messages are fed to the socket listener as they arrive.
... sendbinarymsg() sends a binary message to the websocket peer.
... sendmsg() sends a text message to the websocket peer.
nsMsgFolderFlagType
const nsmsgfolderflagtype sentmail = 0x00000200; /// whether this is the folder in which unfinised, unsent messages are saved for later editing.
... const nsmsgfolderflagtype drafts = 0x00000400; /// whether this is the folder in which messages are queued for later delivery.
...flagtype createdoffline = 0x02000000; /// this imap folder cannot have children :-( const nsmsgfolderflagtype imapnoinferiors = 0x04000000; /// this folder configured for offline use const nsmsgfolderflagtype offline = 0x08000000; /// this folder has offline events to play back const nsmsgfolderflagtype offlineevents = 0x10000000; /// this folder is checked for new messages const nsmsgfolderflagtype checknew = 0x20000000; /// this folder is for spam messages const nsmsgfolderflagtype junk = 0x40000000; /// this folder is in favorites view const nsmsgfolderflagtype favorite = 0x80000000; /// special-use folders const nsmsgfolderflagtype specialuse = inbox|drafts|trash|sentmail| t...
nsPIPromptService
this is the message text of the dialog.
...etitlemessage the value is 3.
... this is the heading of the message.
Weak reference
after all, the observable must send messages to each observer, notifying it of the appropriate state changes.
... nsresult addobserver( nsiobserver* ); nsresult notifyobservers( nsimessage* ); // ...
... nsresult nsobservable::addobserver( nsiobserver* aobserver ) { mobserver = getter_addrefs( ns_getweakreference(aobserver) ); // ...or append this to the list of observers return ns_ok; } nsresult nsobservable::notifyobservers( nsimessage* amessage ) { nscomptr<nsiobserver> observer = do_queryreferent(mobserver); if ( observer ) observer->noticemessage(amessage); else mobserver = 0; // or remove this observer from the list, he's gone away return ns_ok; } // ...
MailNews Protocols
imap,pop3, and nntp are "incoming" protocols, i.e., we retrieve messages from a server, and represent them as folders to the user.
...the service classes usually have their own interface, but they also implement nsimsgmessageservice.
...the message search code also has protocol-specific code to handle searching on the server, or local mailbox.
Main Windows
its main focus is on handling the folderpane, threadpane, and the message preview sections shown above.
... mailoverlay.xul a really small overlay that only adds a few “new message” and “new card” commands to the menus, along with their associated javascript.
... messagewindow.xul messagewindow.xul is shown when a message is opened.
Styling the Folder Pane
hasunreadmessages-true afolder.getnumunread(false) > 0 indicates that the folder (but not subfolders) has unread messages.
... biffstate-biffstate afolder.biffstate == nsimsgfolder.nsmsgbiffstate_<name> indicates whether or not the folder has new messages.
... newmessages-true afolder.hasnewmessages subfoldershaveunreadmessages-true afolder.getnumunread(true) > afolder.getnumunread(false) indicates whether or not subfolders have unread messages.
Set a logpoint - Firefox Developer Tools
logpoints print a message to the console panel instead of pausing code execution.
... when execution hits a logpoint, the message you have defined is logged to the console.
... you can make it easier to see the message by opening a split console under the debugger.
Migrating from Firebug - Firefox Developer Tools
filter log messages firebug offers two ways to filter log messages, via the options menu and via the filter buttons within the toolbar.
... persist logs in firebug you can click the persist button within the toolbar to keep the logged messages between page navigations and reloads.
... server logs firebug extensions like firephp allow to log server-side messages to the firebug console.
Network request details - Firefox Developer Tools
the tabs at the top of this pane enable you to switch between the following pages: headers messages (only for websocket items) cookies params response cache timings security (only for secure pages) stack trace (only when the request has a stack trace, e.g.
...(see referrer-policy for a description of possible values) blocking: if the request is to a site that is associated with a known tracker, an icon and a message are shown; otherwise, this field is not shown.
...if the response is html, js, or css, it will be shown as text: if the response is json, it will be shown as an inspectable object: if the response is an image, the tab displays a preview: for network responses that are initiated by a websocket connection, the details pane shows any associated messages.
Work with animations - Firefox Developer Tools
you'll get a message of "all animation properties are optimized." the expanded animation information now includes a lightning bolt icon next to the properties whose animation has been optimized via the compositor.
...you'll get a message of "some animation properties are optimized." properties whose animation is not being optimized, but could be if you improved your code, are now given a dotted underline — see transform in the screenshot below.
...in this case, the message is "animations of 'transform' cannot be run on the compositor when geometric properties are animated on the same element at the same time." edit @keyframes any @keyframes rules associated with the currently selected element are displayed in the rules view and are editable: edit timing functions when you create a css animation you can specify a timing function: this determines the rate at which the animation progresses.
AbstractWorker - Web APIs
this code snippet demonstrates the creation of a new worker using the worker() constructor; it also shows how to then send a message to the worker.
... var myworker = new worker('worker.js'); first.onchange = function() { myworker.postmessage([first.value, second.value]); console.log('message posted to worker'); } the worker's code is loaded from the file "worker.js".
... this code assumes that there's an <input> element represented by first; an event handler for the change event is established so that when the user changes the value of first, a message is posted to the worker to let it know.
Using the Beacon API - Web APIs
this code snippet is for the global context: function worker_send(url, data) { // create the worker object var myworker = new worker("worker-using.js"); // send the worker the url and data to beacon myworker.postmessage([url, data]); // set up a message handler to receive the success/fail message from the worker myworker.onmessage = function(event) { var msg = event.data; // log worker's send status console.log("worker reply: sendbeacon() status = " + msg); }; } this code snippet is for the worker (worker-using.js): onmessage = function(event) { var msg = event.data; // split the url an...
...d data from the message var url = msg[0]; var data = msg[1]; // if the browser supports worker sendbeacon(), then send the beacon; otherwise // return failure message to the global context if (self.navigator.sendbeacon) { var status = self.navigator.sendbeacon(url, data); postmessage(status ?
... "success" : "fail"); } else { postmessage("worker: self.navigator.sendbeacon is unsupported"); } } see also beacon api (overview) beacon standard beacon caniuse data ...
CloseEvent - Web APIs
1007 invalid frame payload data the endpoint is terminating the connection because a message was received that contained inconsistent data (e.g., non-utf-8 data within a text message).
... 1008 policy violation the endpoint is terminating the connection because it received a message that violates its policy.
... 1009 message too big the endpoint is terminating the connection because a data frame was received that is too large.
console.assert() - Web APIs
WebAPIConsoleassert
the console.assert() method writes an error message to the console if the assertion is false.
... syntax console.assert(assertion, obj1 [, obj2, ..., objn]); console.assert(assertion, msg [, subst1, ..., substn]); // c-like message formatting parameters assertion any boolean expression.
... if the assertion is false, the message is written to the console.
CryptoKey - Web APIs
WebAPICryptoKey
possible values for array elements are: "encrypt": the key may be used to encrypt messages.
... "decrypt": the key may be used to decrypt messages.
... "sign": the key may be used to sign messages.
Element.innerHTML - Web APIs
WebAPIElementinnerHTML
example this example uses innerhtml to create a mechanism for logging messages into a box on a web page.
... { var logelem = document.queryselector(".log"); var time = new date(); var timestr = time.tolocaletimestring(); logelem.innerhtml += timestr + ": " + msg + "<br/>"; } log("logging mouse events inside this container..."); the log() function creates the log output by getting the current time from a date object using tolocaletimestring(), and building a string with the timestamp and the message text.
... then the message is appended to the box with the class "log".
GlobalEventHandlers.onerror - Web APIs
window.onerror window.onerror = function(message, source, lineno, colno, error) { ...
... }; function parameters: message: error message (string).
... window.onerror = function (msg, url, lineno, columnno, error) { var string = msg.tolowercase(); var substring = "script error"; if (string.indexof(substring) > -1){ alert('script error: see browser console for detail'); } else { var message = [ 'message: ' + msg, 'url: ' + url, 'line: ' + lineno, 'column: ' + columnno, 'error object: ' + json.stringify(error) ].join(' - '); alert(message); } return false; }; when using the inline html markup (<body onerror="alert('an error occurred')">), the html specification requires arguments passed to onerror to be named event, source, lineno, colno, ...
HTMLKeygenElement - Web APIs
validationmessage read only is a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any).
... setcustomvalidity(in domstring error) void sets a custom validity message for the element.
... if this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.
HTMLOutputElement - Web APIs
htmloutputelement.validationmessageread only a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any).
... htmloutputelement.setcustomvalidity() sets a custom validity message for the element.
... if this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.
HTMLSelectElement - Web APIs
htmlselectelement.validationmessageread only a domstring representing a localized message that describes the validation constraints that the control does not satisfy (if any).
... htmlselectelement.setcustomvalidity() sets the custom validity message for the selection element to the specified message.
... it adds the autofocus, form, required, labels, selectedoptions, willvalidate, validity and validationmessage properties.
Checking when a deadline is due - Web APIs
if not, we drop a message into our developer notifications pane (see the bottom left of the app ui) to tell the user what is going on, and exit out of the function.
...the next few lines open the database transaction and provide messages to notify the user if this was successful or failed.then an objectstore is created into which the new item is added.
... request.onsuccess = function(event) { note.innerhtml += '<li>new item added to database.</li>'; title.value = ''; hours.value = null; minutes.value = null; day.value = 01; month.value = 'january'; year.value = 2020; }; } this next section creates a log message to say the new item addition is successful, and resets the form so it's ready for the next task to be entered.
InterventionReportBody - Web APIs
message a string containing a human-readable description of the intervention, including information such how the intervention could be avoided.
... this typically matches the message a browser will display in its devtools console when an intervention is imposed, if one is available.
... examples let options = { types: ['intervention'], buffered: true } let observer = new reportingobserver(function(reports, observer) { let firstreport = reports[0]; console.log(firstreport.type); // intervention console.log(firstreport.body.id); console.log(firstreport.body.message); console.log(firstreport.body.sourcefile); console.log(firstreport.body.linenumber); console.log(firstreport.body.columnnumber); }, options); specifications specification status comment reporting apithe definition of 'interventionreportbody' in that specification.
MediaDevices.getUserMedia() - Web APIs
the error is an object of type overconstrainederror, and has a constraint property whose string value is the name of a constraint which was impossible to meet, and a message property containing a human-readable string explaining the problem.
...var constraints = { audio: true, video: { width: 1280, height: 720 } }; navigator.mediadevices.getusermedia(constraints) .then(function(mediastream) { var video = document.queryselector('video'); video.srcobject = mediastream; video.onloadedmetadata = function(e) { video.play(); }; }) .catch(function(err) { console.log(err.name + ": " + err.message); }); // always check for errors at the end.
... video.src = window.url.createobjecturl(stream); } video.onloadedmetadata = function(e) { video.play(); }; }) .catch(function(err) { console.log(err.name + ": " + err.message); }); frame rate lower frame-rates may be desirable in some cases, like webrtc transmissions with bandwidth restrictions.
MediaKeySession - Web APIs
the mediakeysession interface of the encryptedmediaextensions api represents a context for message exchange with a content decryption module (cdm).
... mediakeysession.onmessage sets the eventhandler called when the content decryption module has generated a message for the session.
... mediakeysession.update() returns a promise after loading messages and licenses to the cdm.
PaymentDetailsUpdate - Web APIs
error optional a domstring specifying an error message to present to the user.
... when calling updatewith(), including error in the updated data causes the user agent to display the text as a general error message.
... shippingaddresserrors optional an addresserrors object which includes an error message for each property of the shipping address that could not be validated.
PaymentRequestUpdateEvent.updateWith() - Web APIs
error optional a domstring specifying an error message to present to the user.
... when calling updatewith(), including error in the updated data causes the user agent to display the text as a general error message.
... shippingaddresserrors optional an addresserrors object which includes an error message for each property of the shipping address that could not be validated.
PaymentResponse.retry() - Web APIs
error can be provided all by itself to provide only a generic error message, or in concert with the other properties to serve as an overview while other properties' values gude the user to errors in specific fields in the payment form.
... payer optional a payererrors compliant object which provides appropriate error messages for any of the fields describing the payer which failed validation.
... shippingaddress optional an addresserrors object which contains error messages for any of the fields in the shipping address that failed validation.
PushEvent.data - Web APIs
WebAPIPushEventdata
the data read-only property of the pushevent interface returns a reference to a pushmessagedata object containing data sent to the pushsubscription.
... syntax var mypushdata = pushevent.data; value a pushmessagedata object.
... self.addeventlistener('push', function(event) { if (!(self.notification && self.notification.permission === 'granted')) { return; } var data = {}; if (event.data) { data = event.data.json(); } var title = data.title || "something has happened"; var message = data.message || "here's something you might want to check out."; var icon = "images/new-notification.png"; var notification = new notification(title, { body: message, tag: 'simple-push-demo-notification', icon: icon }); notification.addeventlistener('click', function() { if (clients.openwindow) { clients.openwindow('https://example.blog.com/2015/03/04/something-new.html')...
PushEvent - Web APIs
WebAPIPushEvent
the pushevent interface of the push api represents a push message that has been received.
...additional properties: pushevent.data read only returns a reference to a pushmessagedata object containing data sent to the pushsubscription.
... self.addeventlistener('push', function(event) { if (!(self.notification && self.notification.permission === 'granted')) { return; } var data = {}; if (event.data) { data = event.data.json(); } var title = data.title || "something has happened"; var message = data.message || "here's something you might want to check out."; var icon = "images/new-notification.png"; var notification = new self.notification(title, { body: message, tag: 'simple-push-demo-notification', icon: icon }); notification.addeventlistener('click', function() { if (clients.openwindow) { clients.openwindow('https://example.blog.com/2015/03/04/someth...
PushManager.getSubscription() - Web APIs
(no live demo is available.) // we need the service worker registration to check for a subscription navigator.serviceworker.ready.then(function(serviceworkerregistration) { // do we already have a push message subscription?
... serviceworkerregistration.pushmanager.getsubscription() .then(function(subscription) { // enable any ui which subscribes / unsubscribes from // push messages.
...ed = false; if (!subscription) { // we aren’t subscribed to push, so set ui // to allow the user to enable push return; } // keep your server in sync with the latest subscriptionid sendsubscriptiontoserver(subscription); showcurlcommand(subscription); // set your ui to show they have subscribed for // push messages pushbutton.textcontent = 'disable push messages'; ispushenabled = true; }) .catch(function(err) { window.demo.debug.log('error during getsubscription()', err); }); }); specifications specification status comment push apithe definition of 'getsubscription()' in that specification.
RTCDataChannel.maxPacketLifeTime - Web APIs
the read-only rtcdatachannel property maxpacketlifetime returns the amount of time, in milliseconds, the browser is allowed to take to attempt to transmit a message, as set when the data channel was created, or null.
... this limits how long the browser can continue to attempt to transmit and retransmit the message before giving up.
... syntax var lifetime = adatachannel.maxpacketlifetime; value the number of milliseconds over which the browser may continue to attempt to transmit the message until it either succeeds or gives up.
RTCDataChannel.onopen - Web APIs
the rtcdatachannel.onopen property is an eventhandler which specifies a function to be called when the open event is fired; this is a simple event which is sent when the data channel's underlying data transport—the link over which the rtcdatachannel's messages flow—is established or re-established.
...it then establishes an open event handler which updates some user interface elements to prepare them for being used to send messages over the data channel.
... let dc = mypeerconnection.createdatachannel("message channel"); dc.onopen = function(event) { let messagebox = document.getelementbyid("messagebox"); let sendbutton = document.getelementbyid("sendbutton"); messagebox.disabled = false; messagebox.focus(); sendbutton.disabled = false; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.onopen' in that specification.
RTCError - Web APIs
WebAPIRTCError
constructor rtcerror() creates and returns a new rtcerror object initialized with the properties of the provided rtcerrorinit dictionary and, optionally, a string to use as the value of the error's message property.
... datachannel.addeventlistener("error", (event) => { let error = event.error; if (error.errordetail === "sdp-syntax-error") { let errline = error.sdplinenumber; let errmessage = error.message; let alertmessage = `a syntax error occurred interpreting line ${errline} of the sdp: ${errmessage}`; showmyalertmessage("data channel error", alertmessage); } else { terminatemyconnection(); } }); if the error is an sdp syntax error—indicated by its errordetail property being sdp-syntax-error—, a message string is constructed to present the error message an...
...this message is then displayed using a function called showmyalertmessage(), which stands in for whatever output mechanism this code might use.
RTCPeerConnection: icecandidate event - Web APIs
this is a more reliable approach than looking at the individual ice messages for one indicating that the ice session is finished.
... examples this example creates a simple handler for the icecandidate event that uses a function called sendmessage() to create and send a reply to the remote peer through the signaling server.
... first, an example using addeventlistener(): pc.addeventlistener("icecandidate", ev => { if (ev.candidate) { sendmessage({ type: "new-ice-candidate", candidate: event.candidate }); } }, false); you can also set the onicecandidate event handler property directly: pc.onicecandidate = ev => { if (ev.candidate) { sendmessage({ type: "new-ice-candidate", candidate: event.candidate }); } }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'icecandidate' in that specification.
RTCPeerConnection: negotiationneeded event - Web APIs
pc.addeventlistener("negotiationneeded", ev => { pc.createoffer() .then(offer => return pc.setlocaldescription(offer)) .then(() => sendsignalingmessage({ type: "video-offer", sdp: pc.localdescription })) .catch(err => { /* handle error */ ); }, false); after creating the offer, the local end is configured by calling rtcpeerconnection.setlocaldescription(); then a signaling message is created and sent to the remote peer through the signaling server, to share that offer with the other peer.
... the other peer should recognize this message and follow up by creating its own rtcpeerconnection, setting the remote description with setremotedescription(), and then creating an answer to send back to the offering peer.
... you can also set an event handler for the negotiationneeded 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.
ServiceWorkerGlobalScope.onpush - Web APIs
the serviceworkerglobalscope.onpush event of the serviceworkerglobalscope interface is fired whenever a push message is received by a service worker via a push server.
...the data payload of the push message is available in the event object's data property (pushevent.data, which contains a pushmessagedata object.) self.addeventlistener('push', function(event) { if (!(self.notification && self.notification.permission === 'granted')) { return; } var data = {}; if (event.data) { data = event.data.json(); } var title = data.title || "something has happened"; var message = data.message || "here's something you might want to check out."; var icon = "images/new-notification.png"; var notification = ...
...new notification(title, { body: message, tag: 'simple-push-demo-notification', icon: icon }); notification.addeventlistener('click', function() { if (clients.openwindow) { clients.openwindow('https://example.blog.com/2015/03/04/something-new.html'); } }); }); specifications specification status comment push apithe definition of 'onpush' in that specification.
ServiceWorkerGlobalScope: push event - Web APIs
the push event is sent to a service worker's global scope (represented by the serviceworkerglobalscope interface) when the service worker has received a push message.
... bubbles no cancelable no interface pushevent event handler property onpush example this example sets up a handler for push events that takes json data, parses it, and dispatches the message for handling based on information contained within the message.
... self.addeventlistener("push", event => { let message = event.data.json(); switch(message.type) { case "init": doinit(); break; case "shutdown": doshutdown(); break; } }, false); specifications specification status comment push apithe definition of 'push' in that specification.
SharedWorker.port - Web APIs
WebAPISharedWorkerport
the port property of the sharedworker interface returns a messageport object used to communicate and control the shared worker.
... syntax myworker.port; value a messageport object.
...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.
SpeechRecognitionError - Web APIs
the speechrecognitionerror interface of the web speech api represents error messages from the recognition service.
... speechrecognitionerror.message read only returns a message describing the error in more detail.
... examples var recognition = new speechrecognition(); recognition.onerror = function(event) { console.log('speech recognition error detected: ' + event.error); console.log('additional information: ' + event.message); } ...
SpeechRecognitionErrorEvent - Web APIs
the speechrecognitionerrorevent interface of the web speech api represents error messages from the recognition service.
... speechrecognitionerrorevent.message read only returns a message describing the error in more detail.
... examples var recognition = new speechrecognition(); recognition.onerror = function(event) { console.log('speech recognition error detected: ' + event.error); console.log('additional information: ' + event.message); } specifications specification status comment web speech apithe definition of 'speechrecognitionerrorevent' in that specification.
SubtleCrypto.generateKey() - Web APIs
possible values for array elements are: encrypt: the key may be used to encrypt messages.
... decrypt: the key may be used to decrypt messages.
... sign: the key may be used to sign messages.
SubtleCrypto.importKey() - Web APIs
possible array values are: encrypt: the key may be used to encrypt messages.
... decrypt: the key may be used to decrypt messages.
... sign: the key may be used to sign messages.
SubtleCrypto.unwrapKey() - Web APIs
possible values of the array are: encrypt: the key may be used to encrypt messages.
... decrypt: the key may be used to decrypt messages.
... sign: the key may be used to sign messages.
WebGLRenderingContext.getShaderInfoLog() - Web APIs
return value a domstring that contains diagnostic messages, warning messages, and other information about the last compile operation.
... examples checking compilation messages /* load shader source code.
...*/ gl.compileshader(shader); var message = gl.getshaderinfolog(shader); if (message.length > 0) { /* message may be an error or a warning */ throw message; } specifications specification status comment webgl 1.0the definition of 'getshaderinfolog' in that specification.
WebRTC API - Web APIs
message a message has been received on the data channel.
... the event is of type messageevent.
... see also mediadevices mediastreamevent mediastreamconstraints mediastreamtrack messageevent mediastream media capture and streams api firefox multistream and renegotiation for jitsi videobridge peering through the webrtc fog with socketpeer inside the party bus: building a web app with multiple live video streams + interactive graphics web media technologies ...
Window.setImmediate() - Web APIs
the feature can be emulated in a few different ways: postmessage can be used to trigger an immediate but yielding callback.
... do note that internet explorer 8 includes a synchronous version of postmessage, which means it cannot be used as a fallback.
... messagechannel can be used reliably inside of web workers whereas the semantics of postmessage mean it cannot be used there.
WorkerGlobalScope.dump() - Web APIs
the dump() method of the workerglobalscope interface allows you to write a message to stdout — i.e.
... syntax dump('my message\n'); parameters a domstring containing the message you want to send.
... next, run a worker containing the following line: dump('test\n'); this should result in a "test" message being output to the terminal.
WritableStream.WritableStream() - Web APIs
it then calls a function called sendmessage(), passing the newly created stream and a string.
... const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sin...
...w = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, queuingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example.
WritableStream.getWriter() - Web APIs
it then calls a function called sendmessage(), passing the newly created stream and a string.
... const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sin...
...w = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, queuingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example.
WritableStream - Web APIs
it then calls a function called sendmessage(), passing the newly created stream and a string.
... const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sin...
...w = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, queuingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example.
WritableStreamDefaultWriter.WritableStreamDefaultWriter() - Web APIs
it then calls a function called sendmessage(), passing the newly created stream and a string.
... const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sin...
...w = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, queuingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example.
WritableStreamDefaultWriter.close() - Web APIs
it then calls a function called sendmessage(), passing the newly created stream and a string.
... const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sin...
...w = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, queuingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example.
WritableStreamDefaultWriter.write() - Web APIs
it then calls a function called sendmessage(), passing the newly created stream and a string.
... const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chunk written to sin...
...w = new uint16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, queuingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example.
WritableStreamDefaultWriter - Web APIs
it then calls a function called sendmessage(), passing the newly created stream and a string.
... const list = document.queryselector('ul'); function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter const defaultwriter = writablestream.getwriter(); const encoder = new textencoder(); const encoded = encoder.encode(message, { stream: true }); encoded.foreach((chunk) => { defaultwriter.ready .then(() => { return defaultwriter.write(chunk); }) .then(() => { console.log("chun...
...16array(buffer); view[0] = chunk; var decoded = decoder.decode(view, { stream: true }); var listitem = document.createelement('li'); listitem.textcontent = "chunk decoded: " + decoded; list.appendchild(listitem); result += decoded; resolve(); }); }, close() { var listitem = document.createelement('li'); listitem.textcontent = "[message received] " + result; list.appendchild(listitem); }, abort(err) { console.log("sink error:", err); } }, queuingstrategy); sendmessage("hello, world.", writablestream); you can find the full code in our simple writer example.
Alerts - Accessibility
tact details</legend> <label for="name">your name (required):</label> <input name="name" id="name" aria-required="true"/> <br /> <label for="email">e-mail address (required):</label> <input name="email" id="email" aria-required="true"/> <br /> <label for="website">website (optional):</label> <input name="website" id="website"/> </fieldset> <label for="message">please enter your message (required):</label> <br /> <textarea name="message" id="message" rows="5" cols="80" aria-required="true"></textarea> <br /> <input type="submit" name="submit" value="send message"/> <input type="reset" name="reset" value="reset form"/> </form> checking for validity and notifying the user form validations consists of several steps: chec...
...this method takes three parameters: the id of the input that is to be validated, the term to search for to ensure validity, and the error message to be inserted into the alert.
... it will call the addalert function to add the alert with the provided error message.
Understandable - Accessibility
when an error is detected, an intuitive error message should be shown next to the form input that is at fault to help the user correct their inputs.
...such suggestions should be displayed usefully in context, just like error messages (see 3.3.1).
... checking data — as covered in 3.3.1, a combination of client-side and server-side validation should be used to detect errors and display helpful messages to the user to allow them to correct their inputs.
font - CSS: Cascading Style Sheets
WebCSSfont
if font is specified as a system keyword, it must be one of: caption, icon, menu, message-box, small-caption, status-bar.
... message-box the system font used in dialog boxes.
...<'font-family'> ] | caption | icon | menu | message-box | small-caption | status-barwhere <font-variant-css21> = [ normal | small-caps ] examples setting font properties /* set the font size to 12px and the line height to 14px.
<input type="text"> - HTML: Hypertext Markup Language
WebHTMLElementinputtext
it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message.
...n> </div> </form> div { margin-bottom: 10px; position: relative; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } this renders like so: if you try to submit the form with no search term entered into it, the browser will show an error message.
...ton> </div> </form> div { margin-bottom: 10px; position: relative; } input + span { padding-right: 30px; } input:invalid+span:after { position: absolute; content: '✖'; padding-left: 5px; } input:valid+span:after { position: absolute; content: '✓'; padding-left: 5px; } this renders like so: if you try to submit the form with less than 4 characters, you'll be given an appropriate error message (which differs between browsers).
Basics of HTTP - HTTP
http is an extensible protocol that relies on concepts like resources and uniform resource identifiers (uris), simple message structure, and client-server communication flow.
... http messages http messages transmitted during requests or responses have a very clear structure.
... frame and message structure in http/2 http/2 encapsulates and represents http/1.x messages in a binary frame.
Connection management in HTTP/1.x - HTTP
several messages must be exchanged between the client and the server.
...without knowing these, important messages may be delayed behind unimportant ones.
...theoretically, performance could also be improved if two http requests were to be packed into the same tcp message.
Expect - HTTP
WebHTTPHeadersExpect
expect: 100-continue directives 100-continue informs recipients that the client is about to send a (presumably large) message body in this request and wishes to receive a 100 (continue) interim response.
... examples large message body a client sends a request with a expect header and waits for the server to respond before sending the message body.
... put /somewhere/fun http/1.1 host: origin.example.com content-type: video/h264 content-length: 1234567890987 expect: 100-continue the server now checks the request headers and may respond with a 100 (continue) response to instruct the client to go ahead and send the message body, or it will send a 417 (expectation failed) status if any of the expectations cannot be met.
Host - HTTP
WebHTTPHeadersHost
a host header field must be sent in all http/1.1 request messages.
... a 400 (bad request) status code may be sent to any http/1.1 request message that lacks a host header field or that contains more than one.
... examples host: developer.cdn.mozilla.net specifications specification title rfc 7230, section 5.4: host hypertext transfer protocol (http/1.1): message syntax and routing ...
Transfer-Encoding - HTTP
transfer-encoding is a hop-by-hop header, that is applied to a message between two nodes, not to a resource itself.
... when present on a response to a head request that has no body, it indicates the value that would have applied to the corresponding get message.
...a chunked response looks like this: http/1.1 200 ok content-type: text/plain transfer-encoding: chunked 7\r\n mozilla\r\n 9\r\n developer\r\n 7\r\n network\r\n 0\r\n \r\n specifications specification title rfc 7230, section 3.3.1: transfer-encoding hypertext transfer protocol (http/1.1): message syntax and routing ...
AggregateError() constructor - JavaScript
syntax new aggregateerror(errors[, message]) parameters errors an iterable of errors, may not actually be error instances.
... messageoptional an optional human-readable description of the aggregate error.
... examples creating an aggregateerror try { throw new aggregateerror([ new error("some error"), ], 'hello'); } catch (e) { console.log(e instanceof aggregateerror); // true console.log(e.message); // "hello" console.log(e.name); // "aggregateerror" console.log(e.errors); // [ error: "some error" ] } specifications specification promise.anythe definition of 'aggregateerror()' in that specification.
EvalError - JavaScript
instance properties evalerror.prototype.message error message.
... although ecma-262 specifies that evalerror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
... creating an evalerror try { throw new evalerror('hello', 'somefile.js', 10); } catch (e) { console.log(e instanceof evalerror); // true console.log(e.message); // "hello" console.log(e.name); // "evalerror" console.log(e.filename); // "somefile.js" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // "@scratchpad/2:2:9\n" } specifications specification ecmascript (ecma-262)the definition of 'evalerror' in that...
Promise.prototype.then() - JavaScript
print helpful messages about how the code in this section will be run // before the string is actually processed by the mocked asynchronous code in the // previous then block.
... promise.resolve() .then(() => { // makes .then() return a rejected promise throw new error('oh no!'); }) .then(() => { console.log('not called.'); }, error => { console.error('onrejected function called: ' + error.message); }); in all other cases, a resolving promise is returned.
... promise.resolve() .then(() => { // makes .then() return a rejected promise throw new error('oh no!'); }) .catch(error => { console.error('onrejected function called: ' + error.message); }) .then(() => { console.log("i am always called even if the prior then's promise rejects"); }); you can also use chaining to implement one function with a promise-based api on top of another such function.
Promise - JavaScript
}, 250) }) myfirstpromise.then((successmessage) => { // successmessage is whatever we passed in the resolve(...) function above.
... // it doesn't have to be a string, but if it is only a succeed message, it probably will be.
..." + successmessage) }); example with diverse situations this example shows diverse techniques for using promise capabilities, and diverse situations that can occur.
Proxy - JavaScript
for example, this code defines a simple target with just two properties, and an even simpler handler with no properties: const target = { message1: "hello", message2: "everyone" }; const handler1 = {}; const proxy1 = new proxy(target, handler1); because the handler is empty, this proxy behaves just like the original target: console.log(proxy1.message1); // hello console.log(proxy1.message2); // everyone to customise the proxy, we define functions on the handler object: const target = { message1: "hello", message2: "everyone" ...
...the very simple trap in handler2 above redefines all property accessors: console.log(proxy2.message1); // world console.log(proxy2.message2); // world with the help of the reflect class we can give some accessors the original behavior and redefine others: const target = { message1: "hello", message2: "everyone" }; const handler3 = { get: function (target, prop, receiver) { if (prop === "message2") { return "world"; } return reflect.get(...arguments); }, }; const pr...
...oxy3 = new proxy(target, handler3); console.log(proxy3.message1); // hello console.log(proxy3.message2); // world constructor proxy() creates a new proxy object.
ReferenceError() constructor - JavaScript
syntax new referenceerror([message[, filename[, linenumber]]]) parameters message optional optional.
... examples catching a referenceerror try { let a = undefinedvariable } catch (e) { console.log(e instanceof referenceerror) // true console.log(e.message) // "undefinedvariable is not defined" console.log(e.name) // "referenceerror" console.log(e.filename) // "scratchpad/1" console.log(e.linenumber) // 2 console.log(e.columnnumber) // 6 console.log(e.stack) // "@scratchpad/2:2:7\n" } creating a referenceerror try { throw new referenceerror('h...
...ello', 'somefile.js', 10) } catch (e) { console.log(e instanceof referenceerror) // true console.log(e.message) // "hello" console.log(e.name) // "referenceerror" console.log(e.filename) // "somefile.js" console.log(e.linenumber) // 10 console.log(e.columnnumber) // 0 console.log(e.stack) // "@scratchpad/2:2:9\n" } specifications specification ecmascript (ecma-262)the definition of 'nativeerror constructor' in that specification.
SharedArrayBuffer - JavaScript
description allocating and sharing memory to share memory using sharedarraybuffer objects from one agent in the cluster to another (an agent is either the web page’s main program or one of its web workers), postmessage and structured cloning is used.
... var sab = new sharedarraybuffer(1024); worker.postmessage(sab); updating and synchronizing shared memory with atomic operations shared memory can be created and updated simultaneously in workers or the main thread.
...with a few security measures, postmessage() will no longer throw for sharedarraybuffer objects and shared memory across threads will be available: as a baseline requirement, your document needs to be in a secure context.
SyntaxError - JavaScript
instance properties syntaxerror.prototype.message error message.
... although ecma-262 specifies that syntaxerror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
... examples catching a syntaxerror try { eval('hoo bar'); } catch (e) { console.error(e instanceof syntaxerror); console.error(e.message); console.error(e.name); console.error(e.filename); console.error(e.linenumber); console.error(e.columnnumber); console.error(e.stack); } creating a syntaxerror try { throw new syntaxerror('hello', 'somefile.js', 10); } catch (e) { console.error(e instanceof syntaxerror); // true console.error(e.message); // hello console.error(e.name); // syn...
TypeError() constructor - JavaScript
syntax new typeerror([message[, filename[, linenumber]]]) parameters message optional optional.
...the line number of the code that caused the exception examples catching a typeerror try { null.f() } catch (e) { console.log(e instanceof typeerror) // true console.log(e.message) // "null has no properties" console.log(e.name) // "typeerror" console.log(e.filename) // "scratchpad/1" console.log(e.linenumber) // 2 console.log(e.columnnumber) // 2 console.log(e.stack) // "@scratchpad/2:2:3\n" } creating a typeerror try { throw new typeerror('hello', "somefile.js", 10) } catch (e) { console.log(e instanceof typeerror) // tru...
...e console.log(e.message) // "hello" console.log(e.name) // "typeerror" console.log(e.filename) // "somefile.js" console.log(e.linenumber) // 10 console.log(e.columnnumber) // 0 console.log(e.stack) // "@scratchpad/2:2:9\n" } specifications specification ecmascript (ecma-262)the definition of 'nativeerror constructor' in that specification.
URIError() constructor - JavaScript
syntax new urierror([message[, filename[, linenumber]]]) parameters message optional optional.
... examples catching an urierror try { decodeuricomponent('%') } catch (e) { console.log(e instanceof urierror) // true console.log(e.message) // "malformed uri sequence" console.log(e.name) // "urierror" console.log(e.filename) // "scratchpad/1" console.log(e.linenumber) // 2 console.log(e.columnnumber) // 2 console.log(e.stack) // "@scratchpad/2:2:3\n" } creating an urierror try { throw new urierror('hello', 'somefile.js', 10) } catch (e) { console.log(e instanceof urierro...
...r) // true console.log(e.message) // "hello" console.log(e.name) // "urierror" console.log(e.filename) // "somefile.js" console.log(e.linenumber) // 10 console.log(e.columnnumber) // 0 console.log(e.stack) // "@scratchpad/2:2:9\n" } specifications specification ecmascript (ecma-262)the definition of 'nativeerror constructor' in that specification.
WebAssembly.CompileError - JavaScript
instance properties webassembly.compileerror.prototype.message error message.
... although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
... examples creating a new compileerror instance the following snippet creates a new compileerror instance, and logs its details to the console: try { throw new webassembly.compileerror('hello', 'somefile', 10); } catch (e) { console.log(e instanceof compileerror); // true console.log(e.message); // "hello" console.log(e.name); // "compileerror" console.log(e.filename); // "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } specifications specification webassembly jav...
WebAssembly.LinkError - JavaScript
instance properties webassembly.linkerror.prototype.message error message.
... although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
... examples creating a new linkerror instance the following snippet creates a new linkerror instance, and logs its details to the console: try { throw new webassembly.linkerror('hello', 'somefile', 10); } catch (e) { console.log(e instanceof linkerror); // true console.log(e.message); // "hello" console.log(e.name); // "linkerror" console.log(e.filename); // "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } specifications specification webassembly javasc...
WebAssembly.Module.exports() - JavaScript
examples using exports the following example (see our index-compile.html demo on github, and view it live also) compiles the loaded simple.wasm byte code using the webassembly.compilestreaming() method and then sends it to a worker using postmessage().
... var worker = new worker("wasm_worker.js"); webassembly.compilestreaming(fetch('simple.wasm')) .then(mod => worker.postmessage(mod) ); in the worker (see wasm_worker.js) we define an import object for the module to use, then set up an event handler to receive the module from the main thread.
... var importobject = { imports: { imported_func: function(arg) { console.log(arg); } } }; onmessage = function(e) { console.log('module received from main thread'); var mod = e.data; webassembly.instantiate(mod, importobject).then(function(instance) { instance.exports.exported_func(); }); var exports = webassembly.module.exports(mod); console.log(exports[0]); }; the exports[0] output looks like this: { name: "exported_func", kind: "function" } specifications specification webassemb...
WebAssembly.Module - JavaScript
examples sending a compiled module to a worker the following example (see our index-compile.html demo on github, and view it live also) compiles the loaded simple.wasm byte code using the webassembly.compilestreaming() method and then sends the resulting module instance to a worker using postmessage().
... var worker = new worker("wasm_worker.js"); webassembly.compilestreaming(fetch('simple.wasm')) .then(mod => worker.postmessage(mod) ); in the worker (see wasm_worker.js) we define an import object for the module to use, then set up an event handler to receive the module from the main thread.
... var importobject = { imports: { imported_func: function(arg) { console.log(arg); } } }; onmessage = function(e) { console.log('module received from main thread'); var mod = e.data; webassembly.instantiate(mod, importobject).then(function(instance) { instance.exports.exported_func(); }); }; specifications specification webassembly javascript interfacethe definition of 'webassembly.module()' in that specification.
WebAssembly.RuntimeError - JavaScript
instance properties webassembly.runtimeerror.prototype.message error message.
... although ecma-262 specifies that urierror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
... examples creating a new runtimeerror instance the following snippet creates a new runtimeerror instance, and logs its details to the console: try { throw new webassembly.runtimeerror('hello', 'somefile', 10); } catch (e) { console.log(e instanceof runtimeerror); // true console.log(e.message); // "hello" console.log(e.name); // "runtimeerror" console.log(e.filename); // "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } specifications specification webassembly jav...
switch - JavaScript
take a look at this example: const action = 'say_hello'; switch (action) { case 'say_hello': let message = 'hello'; console.log(message); break; case 'say_hi': let message = 'hi'; console.log(message); break; default: console.log('empty action received.'); break; } this example will output the error uncaught syntaxerror: identifier 'message' has already been declared which you were not probably expecting.
... this is because the first let message = 'hello'; conflicts with second let statement let message = 'hi'; even they're within their own separate case clauses case 'say_hello': and case 'say_hi':.
... we can easily fix this by wrapping our case clauses with brackets: const action = 'say_hello'; switch (action) { case 'say_hello': { // added brackets let message = 'hello'; console.log(message); break; } // added brackets case 'say_hi': { // added brackets let message = 'hi'; console.log(message); break; } // added brackets default: { // added brackets console.log('empty action received.'); break; } // added brackets } this code will now output hello in the console as it should, without any errors at all.
try...catch - JavaScript
openmyfile(); try { // tie up a resource writemyfile(thedata); } finally { closemyfile(); // always close the resource } examples nested try-blocks first, let's see what happens with this: try { try { throw new error('oops'); } finally { console.log('finally'); } } catch (ex) { console.error('outer', ex.message); } // output: // "finally" // "outer" "oops" now, if we already caught the exception in the inner try-block by adding a catch-block try { try { throw new error('oops'); } catch (ex) { console.error('inner', ex.message); } finally { console.log('finally'); } } catch (ex) { console.error('outer', ex.message); } // output: // "inner" "oops" // "finally" and now, let...
... try { try { throw new error('oops'); } catch (ex) { console.error('inner', ex.message); throw ex; } finally { console.log('finally'); } } catch (ex) { console.error('outer', ex.message); } // output: // "inner" "oops" // "finally" // "outer" "oops" any given exception will be caught only once by the nearest enclosing catch-block unless it is rethrown.
...this includes exceptions thrown inside of the catch-block: (function() { try { try { throw new error('oops'); } catch (ex) { console.error('inner', ex.message); throw ex; } finally { console.log('finally'); return; } } catch (ex) { console.error('outer', ex.message); } })(); // output: // "inner" "oops" // "finally" the outer "oops" is not thrown because of the return in the finally-block.
ui - Archive of obsolete content
this document can refer to bundled css and javascript files, and your main add-on can communicate with a frame script using message passing.
...this document can refer to bundled css and javascript files, and your main add-on can communicate with a frame script using message passing.
content/symbiont - Archive of obsolete content
usage a symbiont loads the specified contenturl and content scripts into a frame, and sets up an asynchronous channel between the content scripts and the add-on code, enabling them to exchange messages using the port or postmessage apis.
...it inherits functions to load and configure content scripts from the loader, and functions to exchange messages between content scripts and the main add-on code from the worker.
platform/xpcom - Archive of obsolete content
this example implements a logging service that just appends a timestamp to all logged messages.
..., xpcom users can access the service using the getservice() api: var { class } = require('sdk/core/heritage'); var { unknown, service } = require('sdk/platform/xpcom'); var { cc, ci } = require('chrome'); var contractid = '@me.org/timestampedlogger'; // implement the service by subclassing unknown var timestampedlogger = class({ extends: unknown, get wrappedjsobject() this, log: function(message) { console.log(new date().gettime() + ' : ' + message); } }); // register the service using the contract id var service = service({ contract: contractid, component: timestampedlogger }); // access the service using getservice() var wrapper = cc[contractid].getservice(ci.nsisupports); var logger = wrapper.wrappedjsobject; logger.log('a timestamped message'); by default, services are r...
Getting started (cfx) - Archive of obsolete content
to build an xpi, just execute the command cfx xpi from the add-on's directory: cfx xpi you should see a message like: exporting extension to my-addon.xpi.
...this means that if you want to see output from console.log() messages, you'll have to tweak a setting.
Alerts and Notifications - Archive of obsolete content
var message = 'another pop-up blocked'; var box = gbrowser.getnotificationbox(); var notification = box.getnotificationwithvalue('popup-blocked'); if (notification) { notification.label = message; } else { var buttons = [{ label: 'button', accesskey: 'b', popup: 'blockedpopupoptions', callback: null }]; let priority = box.priority_warning_medium; box.appen...
...dnotification(message, 'popup-blocked', 'chrome://browser/skin/info.png', priority, buttons); } ...
Examples and demos from articles - Archive of obsolete content
do something if current document has changed since last visit here is a possible example of how to show an alert message when current document changes.
... do something if an external page has changed since last visit here is a possible example of how to show an alert message when an external page changes.
JavaScript Debugger Service - Archive of obsolete content
jsd.scripthook = { onscriptcreated: function(script) { // your function here }, onscriptdestroyed: function(script) { // your function here } }; jsd.errorhook = { onerror: function(message, filename, lineno, colno, flags, errnum, exc) { // your function here } }; // triggered when jsd.errorhook[onerror] returns false jsd.debughook = { onexecute: function(frame, type, rv) { // your function here } }; jsd.enumeratescripts({ // the enumeratescript method will be called once for every script jsd knows about enumeratescript: function(script) { // your function here } })...
... jsd.errorhook = { onerror: function(message, filename, lineno, colno, flags, errnum, exc) { dump(message + "@" + filename + "@" + lineno + "@" + colno + "@" + errnum + "\n"); // check message type var jsdierrorhook = components.interfaces.jsdierrorhook; var messagetype; if (flags & jsdierrorhook.report_error) messagetype = "error"; if (flags & jsdierrorhook.report_warning) messagetype = "warning"; if (flags & jsdierrorhook.report_exception) messagetype = "uncaught-exception"; if (flags & jsdierrorhook.report_strict) messagetype += "-strict"; dump(messagetype + "\n"); return false; // trigger debugho...
Miscellaneous - Archive of obsolete content
these properties can be accessed from javascript in the following manner: var common = { _bundle: components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice) .createbundle("chrome://myext/locale/myext.properties"), getlocalizedmessage: function(msg) { return this._bundle.getstringfromname(msg); } }; alert(common.getlocalizedmessage("invalid.url")) another similar alternative (using both getstringfromname and formatstringfromname), is: var fcbundle = components.classes["@mozilla.org/intl/stringbundle;1"] .getservice(components.interfaces.nsistringbundleservice) .createbu...
...ndle("chrome://myext/locale/myext.properties"); function getstr(msg, args){ //get localised message if (args){ args = array.prototype.slice.call(arguments, 1); return fcbundle.formatstringfromname(msg,args,args.length); } else { return fcbundle.getstringfromname(msg); } } /* usage */ alert(getstr("invalid.url", "http://bad/url/", "3")); //for message with parameters alert(getstr("invalid.url")); //for message without parameters getting postdata of a webpage first, you need to get the browser you want, and its historysession.
How to convert an overlay extension to restartless - Archive of obsolete content
st = components.constructor("@mozilla.org/xmlextras/xmlhttprequest;1", "nsixmlhttprequest"); here's how to load a file using it: function loadfile(url,type,returnresult) { var request = new xmlhttprequest(); request.open("get", url, true); // async=true request.responsetype = type; request.onerror = function(event) { logerrormessage("error attempting to load: " + url); returnresult(null); }; request.onload = function(event) { if (request.response) returnresult(request.response); else request.onerror(event); }; request.send(); } loadfile("chrome://myaddon/content/filename.ext",datatype,function(data) { /* do stuff with data */ }); note: when using xmlhttpreq...
...even though it says that the default type is "text", firefox will attempt to autodetect and fail, resulting in an error message in the console.
Install Manifests - Archive of obsolete content
if any value matches the application's build parameters, it will be installed; if not, the user will get an appropriate error message.
...if the add-on specified by the <em:id> tag is not installed or has an incompatible version, the extension manager will disable your extension and show the message "requires additional items".
Appendix D: Loading Scripts - Archive of obsolete content
chromeworkers also have access to ctypes and a limited number of thread safe xpcom classes, but are otherwise limited to simple computation based on data passed via messages and xmlhttprequests.
... disadvantages limited scoping: as data from the main thread may only be accessed via json message passing, there are significant difficulties in performing many operations in worker scopes.
Local Storage - Archive of obsolete content
and then logging is done with any of the following methods, depending on the kind of message being logged: this._logger.fatal("this is a fatal message."); this._logger.error("this is an error message."); this._logger.warn("this is a warning message."); this._logger.info("this is an info message."); this._logger.config("this is a config message."); this._logger.debug("this is a debug message."); this._logger.trace("this is a trace message."); you can filter the output of the global log...
...this impacts performance and fills the log with useless messages.
Observer Notifications - Archive of obsolete content
« previousnext » sometimes you need your code to send a message to other parts of your code.
...but given that chrome is window-dependent and non-chrome objects are not, it's tricky to send a message to the chrome.
XPCOM Objects - Archive of obsolete content
keeps track of how many times the * hello world message has been shown.
... if (!this._singletonobj) { this._singletonobj = messagecounter; } return this._singletonobj.queryinterface(aiid); } }; if we wanted a class that can be instantiated, instead of a singleton service, the factory would look like this: var counterfactory = { createinstance: function(aouter, aiid) { if (aouter != null) { throw cr.ns_error_no_aggregation; } return (new counter()).queryinterface(aiid); } }; the ins...
Session store API - Archive of obsolete content
ata when tabs are restored, you can install a listener like this: function myextensionhandlerestore(aevent) { var tab = event.originaltarget; /* the tab being restored */ var uri = tab.linkedbrowser.contentdocument.location; /* the tab's uri */ components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice) .logstringmessage("restoring tab: " + uri); }; document.addeventlistener("sstabrestoring", myextensionhandlerestore, false); simply replace the contents of the function myextensionhandlerestore() with whatever you need to do when the tab is restored.
... in this example, nsiconsoleservice is used to display a message to the console.
Promises - Archive of obsolete content
a task example like the following: components.utils.import("resource://gre/modules/task.jsm"); task.spawn(function* () { var response = yield request("login", { username: user, password: password }); if (response.messages) { try { yield publish({ username: user, messages: response.messages }); } catch (e) { self.reporterror("publication failed", e); } } }); can be converted to a pure promise-based equivalent as such: request("login", { username: user, password: password }) .then(response => { if (response.messages) return publis...
...h({ username: user, messages: response.messages }); }) .then(null, (e) => { self.reporterror("publication failed", e); }); file io file io in add-ons should be done via the os.file api, which provides a simple, but powerful, interface for reading, writing, and manipulating both text and binary files.
Install.js - Archive of obsolete content
['classic', 'modern'] extpostinstallmessage: null, // set to null for no post-install message // --- editable items end --- profileinstall: true, silentinstall: false, install: function() { var jarname = this.extshortname + '.jar'; var profiledir = install.getfolder('profile', 'chrome'); // parse http arguments this.parsearguments(); // check if extension is already installed in profile if (file.exists(install.ge...
... // register skins for (var skin in this.extskinnames) { var regpath = 'skin/' + this.extskinnames[skin] + '/' + this.extshortname + '/'; install.registerchrome(install.skin | installtype, jarpath, regpath); } // perform install var err = install.performinstall(); if (err == install.success || err == install.reboot_needed) { if (!this.silentinstall && this.extpostinstallmessage) { install.alert(this.extpostinstallmessage); } } else { this.handleerror(err); return; } }, parsearguments: function() { // can't use string handling in install, so use if statement instead var args = install.arguments; if (args == 'p=0') { this.profileinstall = false; this.silentinstall = true; } else if (args == 'p=1') { this.profileinstall =...
Source code directories overview - Archive of obsolete content
it includes all the code for managing mail, reading newsgroup messages, importing other mail formats, composing new messages and so on.
...for example, if this code determines that the content is a mail message, it looks up the appropriate listener (probably netscape messenger) and passes the mail message to it for display.
Dehydra Function Reference - Archive of obsolete content
require() example require({strict:true, gczeal:2}) if (require().werror) print("werror is set") warning([code,] msg [, loc]) print a warning message using the gcc warning mechanism.
... error(msg [, loc]) print an error message using the gcc error mechanism.
Error Console - Archive of obsolete content
it reports javascript-related errors and warnings, css errors and arbitrary messages from chrome code.
... message very similar to warning, used very rarely.
popChallengeResponse - Archive of obsolete content
resultstring = crypto.popchallengeresponse("challengestring"); argument description "challengestring" a base-64 encoded cmmf popodeckeychallcontent message.
... the resultstring will either be a base-64 encoded popodeckeyrespcontent message, or one of the following error strings: error string description "error:invalidparameter:xxx" the parameter xxx was an invalid value.
Migrate apps from Internet Explorer to Mozilla - Archive of obsolete content
javascript console the javascript console can show the full log list or just errors, warnings, and messages.
... the error message in figure 1 says that at aol.com, line 95 tries to access an undefined variable called is_ns70.
Mozilla Crypto FAQ - Archive of obsolete content
also note that the nss developers are creating code for support of s/mime secure messages; however full s/mime support within mozilla will require further development, and may not be available until after the mozilla 1.0 release.
... as noted above, the psm code implements ssl and (in the future) s/mime support for mozilla by taking advantage of generic high-level mozilla public apis used to add new protocols and message formats.
New Security Model for Web Services - Archive of obsolete content
using a soap header for verification soap messages have a distinct processing model allowing a header to be added that the recipient is required to understand and accept, which identifies the untrusted source of a script making a request.
... unfortunately, this does not prevent soap messages from being sent to non-soap addresses, which is a big enough problem that the verification cannot stand alone to guarantee that untrusted service requests are always properly rejected by services that should be firewall-protected.
RDF Datasource How-To - Archive of obsolete content
an "imap datasource" would use the imap protocol to translate your mail server's inbox as a collection of statements like "message number 126's subject is 'make money fast on the internet'" and "message number 126 was sent by 'spammer128@hotmail.com'".
...by combining statements from the imap datasource and address book datasource, above, we'd be able to identify the sender of "message 126" as an "important friend".
Tamarin mercurial commit hook - Archive of obsolete content
if you choose to abort the commit, the commit message will be saved to .hg/commit.save.
... this allows you to reuse the commit message after fixing the issue by using the -l (--logfile) option: hg commit -l /reporoot/.hg/commit.save notes at the moment this is a local-only hook and is not enforced on the server.
Venkman Introduction - Archive of obsolete content
for these lines, the interactive session view will display an error message explaining why the breakpoint could not be set.
...if no loaded files match the file pattern or line number, an error message is printed to the console and the command fails.
Methods - Archive of obsolete content
alert displays an alert dialog box with a message and an ok button.
... confirm displays a confirm dialog box with the specified message and ok and cancel buttons.
statustext - Archive of obsolete content
example <!-- sets the status message when mouse is over buttons --> <button label="connect" statustext="connect to remote server" onmouseover="setstatusmessage(this)" onmouseout="clearstatusmessage()"/> <button label="ping" statustext="ping the server" onmouseover="setstatusmessage(this)" onmouseout="clearstatusmessage()"/> <statusbar> <statusbarpanel id="mystatuspanel" label="" flex="1"/> <spacer flex="1"/> </statu...
...sbar> <script> function setstatusmessage(obj){ document.getelementbyid('mystatuspanel').label = obj.getattribute('statustext'); } function clearstatusmessage(obj){ document.getelementbyid('mystatuspanel').label = ''; } </script> see also statusbar and statusbarpanel ...
Template Logging - Archive of obsolete content
for references, the value of the template's id and ref attributes are provided in each logged message.
...to summarize, the following forms of message may be logged: new active result for query 1 matching rule 2 a new data result has been added.
Complete - Archive of obsolete content
the problem with this approach is that when changes in an application do make the extension fail, users might have bad experiences ranging from error messages that they cannot understand to crashes and data loss.
...how a text sting gets localized when you press button 1 you see an message in english or french, depending on your application's locale.
Broadcasters and Observers - Archive of obsolete content
first, the button changes to have red text and, second, an alert box appears with the message 'color changed'.
...this results in an alert message appearing.
Cross Package Overlays - Archive of obsolete content
for example, if mail is not installed, there will be no new message command.
... however, if mail is installed, an overlay will be applied to the menu to add the new message command.
Document Object Model - Archive of obsolete content
for example, the following code will display the text 'message' in an alert twice.
... function gettext(){ return "message"; } alert(gettext()); alert(window.gettext()); thus, if you want to access variables or call a function declared in a script used by another window, you just need to access it using the other window's window object.
Introduction to RDF - Archive of obsolete content
resource description framework we can use the tree elements to display a set of data, such as bookmarks or mail messages.
...this is how mozilla works when it reads data such as bookmarks, the history or mail messages.
Trees - Archive of obsolete content
ArchiveMozillaXULTutorialTrees
some examples of trees include the list of messages in a mail application, or the bookmarks window in mozilla.
...this could be used to create a list of mail messages.
The Implementation of the Application Object Model - Archive of obsolete content
for example, the traditional bookmarks tree view could contain anything from mail messages to local files to maps of other sites.
...(example: deletion of an imap message causing the icon to change to a red x in the tree view.) some change has been made in the composite data source that is the equivalent of a local annotation to the xul file.
XUL Event Propagation - Archive of obsolete content
this button responds to the user action by raising an event, a message meant to travel from one element within the interface to another.
... the click event is just a message.
image - Archive of obsolete content
ArchiveMozillaXULimage
attributes onerror, onload, src, validate properties accessibletype, src style classes alert-icon, error-icon, message-icon, question-icon examples <image src='firefoxlogo.png' width='135' height='130'/> attributes onerror type: script code this event is sent to an image element when an error occurs loading the image.
... message-icon class that adds a message box icon.
2006-10-27 - Archive of obsolete content
calling tb with a specific message to be displayed there's a new question by guenter about calling tb from an external program (eg.
... firefox) to display a message.
NPEvent - Archive of obsolete content
syntax microsoft windows typedef struct _npevent { uint16 event; uint32 wparam; uint32 lparam; } npevent; mac os typedef eventrecord npevent; type eventrecord = record { what: integer; message: longint; when: longint; where: point; modifiers: integer; end; xwindows typedef xevent npevent; fields npevent on microsoft windows the data structure has the following fields: event one of the following event types: wm_paint wm_lbuttondown wm_lbuttonup wm_lbuttondblclk wm_rbuttondown wm_rbuttonup wm_rbuttondblclk wm_mbuttondown wm_mbuttonup wm_mbuttondblclk wm_mousemove wm...
...message longint.
NPN_ForceRedraw - Archive of obsolete content
description once a region of a windowless plugin has been invalidated with npn_invalidaterect() or npn_invalidateregion(), a plug-in can call npn_forceredraw() to force a paint message.
... this causes a synchronous update event or paint message for the plug-in.
NPN_SetException - Archive of obsolete content
syntax #include <npruntime.h> void npn_setexception(npobject *npobj, const nputf8 *message); parameters the function has the following parameters: <tt>npobj</tt> the object on which the exception occurred.
... <tt>message</tt> a utf-8 string describing the error that occurred.
Common Firefox theme issues and solutions - Archive of obsolete content
source file: chrome://global/skin/media/videocontrols.css the solution to this issue is to add the following name space to the second line of the file right after, and in addition to, the existing @namespace: @namespace html url("http://www.w3.org/1999/xhtml"); you can generate the error console message by going to mozilla's mission page.
... if you are using the extension console² you can easily filter out content related messages to see just chrome issues.
Implementation Status - Archive of obsolete content
297083; 343443; 8.3.4 help supported 8.3.5 hint partial problems with hints in xul-hosted documents and ephemeral message positioning 349667; 8.3.6 alert supported 9.
...32231; 10.12 refresh partial is dispatching events instead of calling directly 332231; 10.13 reset supported 10.14 load partial no xforms-link-error generated if @src invalid 333782; 10.15 send supported 10.16 message partial output inside message doesn't work correctly 366886; 10.17 conditional execution of xforms actions supported 10.18 iteration of xforms actions supported 11.
Mozilla XForms User Interface - Archive of obsolete content
alert this message will be shown when the form control cannot properly bind to instance data or when the instance data value is invalid or out of the specified range of selectable values (see the spec).
... message used in combination with event listeners to display a message to the user when the specified event occurs (see the spec).
WebRTC data channels - Game development
reliable channels guarantee that messages you send arrive at the other peer and in the same order in which they're sent.
... unreliable channels make no such guarantees; messages aren't guaranteed to arrive in any particular order and, in fact, aren't guaranteed to arrive at all.
Track the score and win - Game development
.x+brickwidth && y > b.y && y < b.y+brickheight) { dy = -dy; b.status = 0; score++; } } } } } calling drawscore() from the draw() function keeps the score up to date with every new frame — add the following line inside draw(), just below the drawpaddle() call: drawscore(); displaying a winning message when all bricks have been destroyed collecting the points works well, but you won't be adding them forever — what about when all the bricks have been destroyed?
... it's the main purpose of the game after all, so you should display a winning message if all available points have been collected.
Block cipher mode of operation - MDN Web Docs Glossary: Definitions of Web-related terms
a block cipher mode of operation, usually just called a "mode" in context, specifies how a block cipher should be used to encrypt or decrypt messages that are longer than the block size.
...block ciphers are always used with a mode, which specifies how to securely encrypt messages that are longer than the block size.
Cipher - MDN Web Docs Glossary: Definitions of Web-related terms
they also are classified according to how their keys are handled: symmetric key algorithms use the same key to encode and decode a message.
... the key also must be sent securely if the message is to stay confidential.
Cipher suite - MDN Web Docs Glossary: Definitions of Web-related terms
a cipher suite is a combination of a key exchange algorithm, authentication method, bulk encryption cipher, and message authentication code.
... a typical cipher suite looks like ecdhe_rsa_with_aes_128_gcm_sha256 or ecdhe-rsa-aes128-gcm-sha256, indicating: ecdhe (elliptic curve diffie-hellman ephemeral) for key exchange rsa for authentication aes-128 as the cipher, with galois/counter mode (gcm) as the block cipher mode of operation sha-256 as the hash-based message authentication code (hmac) learn more mozilla recommended cipher suite choices for tls ...
Cryptography - MDN Web Docs Glossary: Definitions of Web-related terms
cryptography, or cryptology, is the science that studies how to encode and transmit messages securely.
... cryptography designs and studies algorithms used to encode and decode messages in an insecure environment, and their applications.
First-class Function - MDN Web Docs Glossary: Definitions of Web-related terms
example | pass a function as an argument javascript function sayhello() { return "hello, "; } function greeting(hellomessage, name) { console.log(hellomessage() + name); } // pass `sayhello` as an argument to `greeting` function greeting(sayhello, "javascript!"); we are passing our sayhello() function as an argument to the greeting() function, this explains how we are treating the function as a value.
...message.
HTTP header - MDN Web Docs Glossary: Definitions of Web-related terms
an http header is a field of an http request or response that passes additional information, altering or precising the semantics of the message or of the body.
...the value finish at the next crlf or at the end of the message.
IRC - MDN Web Docs Glossary: Definitions of Web-related terms
irc (internet relay chat) is a worldwide chat system requiring an internet connection and an irc client, which sends and receives messages via the irc server.
...the irc server broadcasts messages to everyone connected to one of many irc channels (each with their own id).
Key - MDN Web Docs Glossary: Definitions of Web-related terms
encrypted messages should remain secure even if everything about the cryptosystem, except for the key, is public knowledge.
...the public key is able to encrypt messages that only the corresponding private key is able to decrypt, and vice versa.
Request header - MDN Web Docs Glossary: Definitions of Web-related terms
a request header is an http header that can be used in an http request, and that doesn't relate to the content of the message.
...for example, the content-length appearing in a post request is actually an entity header referring to the size of the body of the request message.
Response header - MDN Web Docs Glossary: Definitions of Web-related terms
a response header is an http header that can be used in an http response and that doesn't relate to the content of the message.
...for example, the content-length header is an entity header referring to the size of the body of the response message.
How do you upload your files to a web server? - Learn web development
respectively, these are a log of messages showing the connection status between your computer and the sftp server, and a live log of every interaction between your sftp client and the server.
...a basic command looks like so: rsync [-options] source user@x.x.x.x:destination -options is a dash followed by a one or more letters, for example -v for verbose error messages, and -b to make backups.
What is a web server? - Learn web development
the web server must answer every http request, at least with an error message.
... if neither process is possible, the web server returns an error message to the browser, most commonly 404 not found.
Styling web forms - Learn web development
<form> <h1>to: mozilla</h1> <div id="from"> <label for="name">from:</label> <input type="text" id="name" name="user_name"> </div> <div id="reply"> <label for="mail">reply:</label> <input type="email" id="mail" name="user_email"> </div> <div id="message"> <label for="msg">your message:</label> <textarea id="msg" name="user_message"></textarea> </div> <div class="button"> <button type="submit">send your message</button> </div> </form> add the above code into the body of your html.
...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.
Creating hyperlinks - Learn web development
e-mail links it's possible to create links or buttons that, when clicked, open a new outgoing email message rather than linking to a resource or page.
...the most commonly used of these are "subject", "cc", and "body" (which is not a true header field, but allows you to specify a short content message for the new email).
General asynchronous programming concepts - Learn web development
new date(); mydate = date } console.log(mydate); let pelem = document.createelement('p'); pelem.textcontent = 'this is a newly-added paragraph.'; document.body.appendchild(pelem); }); when running the example, open your javascript console then click the button — you'll notice that the paragraph does not appear until after the dates have finished being calculated and the console message has been logged.
... a "click me for alert" button that when clicked shows an alert message.
Function return values - Learn web development
(in these cases, our reference pages list the return value as void or undefined.) for example, in the displaymessage() function we built in the previous article, no specific value is returned when the function is invoked.
...if the entered value is not a number, an error message is printed to the paragraph.
Handling text — strings in JavaScript - Learn web development
html provides structure and meaning to our text, css allows us to precisely style it, and javascript contains a number of features for manipulating strings, creating custom welcome messages and prompts, showing the right text labels when needed, sorting terms into the desired order, and much more.
... the fourth one includes uses a ternary operator to check whether the score is above a certain mark and print a pass or fail message depending on the result.
Website security - Learn web development
dos defenses usually work by identifying and blocking "bad" traffic while allowing legitimate messages through.
... a few key messages almost all of the security exploits in the previous sections are successful when the web application trusts data from the browser.
Learn web development
if you have questions regarding topics you'd like to see covered or feel are missing, drop us a message on our discourse forum.
...for example, if you were in the parent directory: cd learning-area update the repository using the following command: git pull contact us if you want to get in touch with us about anything, the best way is to drop us a message on our discourse forum.
Gecko info for Windows accessibility vendors
in addition, if it is a role_alert, a screen reader should treat it as a message box -- that is, to read the entire contents.
...ent_menuend role_scrollbar not supported n/a role_grip not supported n/a role_sound not supported n/a role_cursor not supported n/a role_caret supported for caret fires event_show, event_hide, event_locationchange role_alert xul: <browsermessage> dhtml: role="wairole:alert" fires event_alert role_window supported automatically by ms windows role_client xul: <browser> html: <frame> or <iframe> role_menupopup dhtml: role="wairole:menu" fires event_menupopupstart, event_menupopupend ...
Debugging OpenGL
if an opengl error occurred when executing the call, an error message is output.
...with this enabled, messages are printed before and after every opengl call.
HTTP logging
use 'sync' if your browser crashes or hangs by default, http logging buffers messages and only periodically writes them to disk (this is more efficient and also makes logging less likely to interfere with race conditions, etc).
... this will cause each log message to be immediately written (and fflush()'d), which is likely to give us more information about your crash.
Eclipse CDT Manual Setup
select "general > workspace" and select "refresh using native hooks or polling" and "refresh on access" to prevent eclipse giving you annoying "resource is out of sync" messages when files change from under it due to mercurial or other external activity.
...click on the little green button beside this message to open the "progress" tab, and keep an eye on the "refreshing workspace" item as you continue with the steps below.
Reviewer Checklist
compatibility version files, databases, messages tag messages with ids to disambiguate callers.
... documentation the commit message should describe what the patch is changing (not be a copy of the bug summary).
Multiprocess Firefox
this page is an informal index of leftovers, mostly revolving around the message manager and the related cross process object wrappers.
... message manager a complete guide to the objects used to communicate between chrome code and web content.
Blocked: All storage access requests
message firefox: cookieblockedall=request to access cookies or storage on “x” was blocked because we are blocking all storage access requests.
... the permission can be changed or removed by: going to preferences > content blocking in the custom content blocking section, selecting a value other than all cookies for the cookies item if the resource that is being blocked doesn't need authentication, you can fix the warning message by adding a crossorigin="anonymous" attribute to your element.
Blocked: All third-party storage access requests
message firefox: cookieblockedforeign=request to access cookies or storage on “x” was blocked because we are blocking all third-party storage access requests and content blocking is enabled.
... the permission can be changed or removed by: going to preferences > content blocking and either adding an exception with the manage exceptions… button choosing the custom content blocking and unchecking the cookies checkbox if the resource that is being blocked doesn't need authentication, you can fix the warning message by adding a crossorigin="anonymous" attribute to the relevant element.
Blocked: Storage access requests from trackers
message firefox: cookieblockedtracker=request to access cookies or storage on “x” was blocked because it came from a tracker and content blocking is enabled.
... the permission can be changed or removed by: going to preferences > content blocking and either adding an exception with the manage exceptions… button choosing the custom content blocking and unchecking the tracker checkbox if the blocked resource doesn't need authentication, you can fix the warning message by adding a crossorigin="anonymous" attribute to the relevant element.
mozbrowsershowmodalprompt
message a domstring representing the value passed to the window.alert(), window.confirm(), or window.prompt() methods within the browser <iframe>'s content.
... obsolete properties of details msg_name a string representing the type of message.
ChromeWorker
to use a postmessage with callback version of chromeworker that features promises, see promiseworker.
... promiseworker github :: promiseworker - shows how to uses promises as an twist on postmessage feature of chromeworker ...
Embedding Tips
hint, add a native message processing loop after the call to saveuri that terminates when onstatechange indicates persistence has finished..
... how do i display my own message, alert and prompt boxes?
Creating a New Protocol
building the new protocol to build the new protocol declaration and generate headers, make in ipc/ipdl: make -c objdir/ipc/ipdl if there are any protocol-level errors, the ipdl compiler will print the relevant error messages and stop.
...it must implement abstract methods for receiving the appropriate messages on each side.
IPC Protocol Definition Language (IPDL)
ipdl, short for "ipc (inter-process communication) protocol definition language", is a mozilla-specific language allowing c++ code to pass messages between processes or threads in an organized and secure way.
... all messages for multi-process plugins and tabs in firefox are declared in the ipdl language.
Services.jsm
ervice cache nsicacheservice cache service cache2 nsicachestorageservice cache storage service clipboard nsiclipboard clipboard console nsiconsoleservice error console service contentprefs nsicontentprefservice content preferences service cookies nsicookiemanager2 cookie manager 2 service cpmm nsimessagesender child process message manager4 crashmanager crashmanager.jsm dirsvc nsidirectoryservice nsiproperties directory service domstoragemanager nsidomstoragemanager dom storage manager domrequest nsidomrequestservice domrequest service downloads nsidownloadmanager download manager droppedlinkhandler ns...
...sieventlistenerservice event listener service etld nsieffectivetldservice effectivetld service focus nsifocusmanager focus manager io nsiioservice nsiioservice2 i/o service locale nsilocaleservice locale service logins nsiloginmanager password manager service metro nsiwinmetroutils 2 mm nsimessagebroadcaster nsiframescriptloader global frame message manager3 obs nsiobserverservice observer service perms nsipermissionmanager permission manager service ppmm nsimessagebroadcaster nsiprocessscriptloader global parent process message manager3 prefs nsiprefbranch nsiprefbranch2 nsiprefservice preferences service ...
Sqlite.jsm
each object has the properties result and message.
... result is a numeric error code and message is a string description of the problem.
Application Translation with Mercurial
we also create a commit message which will describe the changes in the patch and later get used when the patched gets checked in ('added') to the official repository with the localized files.
... for the commit message, we have to use the -m command line flag, hg qref -m "firefox 29: localize missing string in aboutprivatebrowsing.dtd" you can change the commit message in the mercurial queue every time by calling hg qref again.
Index
for instance, in php the default keyword for regular messages is gettext() and _().
... for messages with plural support, the default keyword is ngettext().
Release phase
next, try issuing the following command: $ ssh hg.mozilla.org if ssh is working fine, you should see the following message: no interactive shells allowed here!
... if you don't see this message, try running the same command in a more verbose mode (with the debugging information): $ ssh -vvv hg.mozilla.org this should tell you why your connection is not succeeding.
SVN for Localizers
make you sure you're checking out the repository with https:// make sure you're adding a commit message when running svn commit.
... commits with an empty message will be rejected.
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.
...defined profile, see below): common/mailnewstestprefs.js python scripts (used to set up the profile and run the test): bloat/setupbloattest.py bloat/runtest.py common/setupcommonmailnews.py pre-defined profile initial setup: one pop3 account (mails tbd) one identity one smtp server defined (not used) future requirements/possibilities: one address book where pab has ~1000 entries large message folders imap nntp server and subscribed newsgroup.
NSPR LOG MODULES
level is a numeric value between 0 and 5, with the values having the following meanings: 0 = pr_log_none: nothing should be logged 1 = pr_log_always: important; intended to always be logged 2 = pr_log_error: errors 3 = pr_log_warning: warnings 4 = pr_log_debug: debug messages, notices 5: everything!
... this ensures that all log messages are flushed to the operating system as they are written, but may slow the program down.
An overview of NSS Internals
when dealing with certificates (x.509), file formats such as pkcs#12 (certificates and keys), pkcs#7 (signed data), and message formats as cms, we should mention asn.1, which is a syntax for storing structured data in a very efficient (small sized) presentation.
...there are tools for managing nss databases, for dumping or verifying certificates, for registering pkcs#11 modules with a database, for processing cms encrypted/signed messages, etc.
NSS 3.52 release notes
bug 1623374 - support new pkcs #11 v3.0 message interface for aes-gcm and chachapoly.
... bug 1623374 - support new pkcs #11 v3.0 message interface for aes-gcm and chachapoly.
NSS API Guidelines
high cert lib/certhigh ocsp.h, ocspt.h crmf provides functions, and data types, to handle certificate management message format (cmmf) and certificate request message format (crmf, see rfc 2511) data.
...for example, pkcs #7 is used to encrypt certificate data to exchange between applications, or to encrypt s/mime message data.
NSS Sample Code Sample1
we will add message protection (encryption and macing) examples to this program in the future.
... the adminstrator // may do this by checking that the key was received in a signed email // message, or by checking a digest value with the adminstrator of the // secondary host.
EncDecMAC using token object - sample 3
encdecmac using token object example: <h2 id="nss_sample_code_3_hashing.">nss sample code 3: enc/dec/mac using token object id.</h2> <p class="summary">computes the hash of a file and saves it to another file, illustrates the use of nss message apis.</p> <pre class="brush: cpp"> /* this source code form is subject to the terms of the mozilla public * license, v.
...aid-----" #define iv_header "-----begin iv-----" #define iv_trailer "-----end iv-----" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* * print usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -i -o \n\n", progname); fprintf(stderr, "%-20s specify 'a' for encrypt operation\n\n", "-c "); fprintf(stderr, "%-20s specify 'b' for decrypt operation\n\n", " "); fprintf(stderr, "%-20s specify db directory path\n\n", "-d "); fprintf(stderr, "%-20s specify db password [optional]\n\n", "-p...
sample1
02x:", data[i]); column += 3; } else { pr_fprintf(out, "%02x", data[i]); column += 2; break; } if (column > 76 || (i % 16 == limit)) { newline(out); column = level; limit = i % 16; } } if (column != level) { newline(out); } } /* prints a usage message and exits */ static void usage(const char *progname) { int htype; int hash_algtotal = sizeof(hash_names) / sizeof(hash_names[0]); fprintf(stderr, "usage: %s -t type [ < input ] [ > output ]\n", progname); fprintf(stderr, "%-20s specify the digest method (must be one of\n", "-t type"); fprintf(stderr, "%-20s ", ""); for (htype = 0; htype < hash_algt...
...it illustrates the use of nss message apis.
PKCS11 FAQ
MozillaProjectsNSSPKCS11FAQ
for instance if you are decrypting an s/mime message and you have unwrapped the des key with the private key provided by a given token, nss attempts to use that token to provide the des encryption.
...if you do this, nss applications display an appropriate error message for the user.
PKCS11 Implement
signing tokens include a signing certificate and are used to sign objects or messages or to perform ssl authentication.
... they cannot be used for encrypted s/mime, because they can't decrypt messages.
FC_Digest
pusdigestlen [in, out] pointer to the maximum size of the output buffer, replaced by the length of the message digest if the operation is successful.
... description fc_digest digests a message in a single operation according to the attributes of the previous call to fc_digestinit.
FC_DigestInit
name fc_digestinit - initialize a message-digest operation.
... description fc_digestinit initializes a message-digest operation.
FC_DigestUpdate
one or more blocks may be part of the message digest operation.
... the digest for the entire message is returned by a call to fc_digestfinal.
NSS functions
nss_cmsencrypteddata_getcontentinfo mxr 3.2 and later nss_cmsenvelopeddata_addrecipient mxr 3.2 and later nss_cmsenvelopeddata_create mxr 3.2 and later nss_cmsenvelopeddata_destroy mxr 3.2 and later nss_cmsenvelopeddata_getcontentinfo mxr 3.2 and later nss_cmsmessage_contentlevel mxr 3.2 and later nss_cmsmessage_contentlevelcount mxr 3.2 and later nss_cmsmessage_copy mxr 3.2 and later nss_cmsmessage_create mxr 3.2 and later nss_cmsmessage_createfromder mxr 3.2 and later nss_cmsmessage_destroy mxr 3.2 and later...
... nss_cmsmessage_getcontent mxr 3.2 and later nss_cmsmessage_getcontentinfo mxr 3.2 and later nss_cmsmessage_isencrypted mxr 3.4.1 and later nss_cmsmessage_issigned mxr 3.4 and later nss_cmsrecipientinfo_create mxr 3.2 and later nss_cmsrecipientinfo_createfromder mxr 3.8 and later nss_cmsrecipientinfo_createnew mxr 3.8 and later nss_cmsrecipientinfo_createwithsubjkeyid mxr 3.7 and later nss_cmsrecipientinfo_createwithsubjkeyidfromcert mxr 3.7 and later nss_cmsrecipientinfo_destroy mxr 3.2 and later nss_cmsr...
NSS tools : ssltab
type = 14 (server_hello_done) length = 0 (0x000000) } } ] --> [ sslrecord { 0: 16 03 00 00 44 |....d type = 22 (handshake) version = { 3,0 } length = 68 (0x44) handshake { 0: 10 00 00 40 |...@ type = 16 (client_key_exchange) length = 64 (0x000040) clientkeyexchange { message = {...} } } } ] --> [ sslrecord { 0: 14 03 00 00 01 |.....
...) certificatechain { chainlength = 706 (0x02c2) certificate { size = 703 (0x02bf) data = { saved in file 'cert.001' } } } type = 12 (server_key_exchange) length = 202 (0x0000ca) type = 14 (server_hello_done) length = 0 (0x000000) } } ] --> [ sslrecord { type = 22 (handshake) version = { 3,0 } length = 68 (0x44) handshake { type = 16 (client_key_exchange) length = 64 (0x000040) clientkeyexchange { message = {...} } } } ] --> [ sslrecord { type = 20 (change_cipher_spec) version = { 3,0 } length = 1 (0x1) } sslrecord { type = 22 (handshake) version = { 3,0 } length = 56 (0x38) > encrypted > } ] >-- [ sslrecord { type = 20 (change_cipher_spec) version = { 3,0 } length = 1 (0x1) } ] >-- [ sslrecord { type = 22 (handshake) version = { 3,0 } length = 56 (0x38) > encrypted > } ] --> [ sslrecord { type = ...
NSS tools : ssltap
type = 14 (server_hello_done) length = 0 (0x000000) } } ] --> [ sslrecord { 0: 16 03 00 00 44 |....d type = 22 (handshake) version = { 3,0 } length = 68 (0x44) handshake { 0: 10 00 00 40 |...@ type = 16 (client_key_exchange) length = 64 (0x000040) clientkeyexchange { message = {...} } } } ] --> [ sslrecord { 0: 14 03 00 00 01 |.....
...) certificatechain { chainlength = 706 (0x02c2) certificate { size = 703 (0x02bf) data = { saved in file 'cert.001' } } } type = 12 (server_key_exchange) length = 202 (0x0000ca) type = 14 (server_hello_done) length = 0 (0x000000) } } ] --> [ sslrecord { type = 22 (handshake) version = { 3,0 } length = 68 (0x44) handshake { type = 16 (client_key_exchange) length = 64 (0x000040) clientkeyexchange { message = {...} } } } ] --> [ sslrecord { type = 20 (change_cipher_spec) version = { 3,0 } length = 1 (0x1) } sslrecord { type = 22 (handshake) version = { 3,0 } length = 56 (0x38) > encrypted > } ] >-- [ sslrecord { type = 20 (change_cipher_spec) version = { 3,0 } length = 1 (0x1) } ] >-- [ sslrecord { type = 22 (handshake) version = { 3,0 } length = 56 (0x38) > encrypted > } ] --> [ sslrecord { type = ...
S/MIME functions
nss_cmsencrypteddata_getcontentinfo mxr 3.2 and later nss_cmsenvelopeddata_addrecipient mxr 3.2 and later nss_cmsenvelopeddata_create mxr 3.2 and later nss_cmsenvelopeddata_destroy mxr 3.2 and later nss_cmsenvelopeddata_getcontentinfo mxr 3.2 and later nss_cmsmessage_contentlevel mxr 3.2 and later nss_cmsmessage_contentlevelcount mxr 3.2 and later nss_cmsmessage_copy mxr 3.2 and later nss_cmsmessage_create mxr 3.2 and later nss_cmsmessage_createfromder mxr 3.2 and later nss_cmsmessage_destroy mxr 3.2 and later...
... nss_cmsmessage_getcontent mxr 3.2 and later nss_cmsmessage_getcontentinfo mxr 3.2 and later nss_cmsmessage_isencrypted mxr 3.4.1 and later nss_cmsmessage_issigned mxr 3.4 and later nss_cmsrecipientinfo_create mxr 3.2 and later nss_cmsrecipientinfo_createfromder mxr 3.8 and later nss_cmsrecipientinfo_createnew mxr 3.8 and later nss_cmsrecipientinfo_createwithsubjkeyid mxr 3.7 and later nss_cmsrecipientinfo_createwithsubjkeyidfromcert mxr 3.7 and later nss_cmsrecipientinfo_destroy mxr 3.2 and later nss_cmsr...
NSS_3.12.3_release_notes.html
bug 426413: audit messages need distinct types bug 438870: free freebl hashing code of dependencies on nspr and libutil bug 439115: db merge allows nickname conflicts in merged db bug 439199: sse2 instructions for bignum are not implemented on windows 32-bit bug 441321: tolerate incorrect encoding of dsa signatures in ssl 3.0 handshakes bug 444404: libpkix reports unknown issuer for nearly all certificate errors...
... bug 473357: ssltap incorrectly parses handshake messages that span record boundaries bug 473365: incompatible argument in pkix_validate.c.
NSS tools : ssltap
MozillaProjectsNSStoolsssltap
_hello_done) length = 0 (0x000000) } } ] --> [ sslrecord { 0: 16 03 00 00 44 |....d type = 22 (handshake) version = { 3,0 } length = 68 (0x44) handshake { 0: 10 00 00 40 |...@ type = 16 (client_key_exchange) length = 64 (0x000040) clientkeyexchange { message = {...} } } } ] --> [ sslrecord { 0: 14 03 00 00 01 |.....
... } type = 12 (server_key_exchange) length = 202 (0x0000ca) type = 14 (server_hello_done) length = 0 (0x000000) } } ] --> [ sslrecord { type = 22 (handshake) version = { 3,0 } length = 68 (0x44) handshake { type = 16 (client_key_exchange) length = 64 (0x000040) clientkeyexchange { message = {...} } } } ] --> [ sslrecord { type = 20 (change_cipher_spec) version = { 3,0 } length = 1 (0x1) } sslrecord { type = 22 (handshake) version = { 3,0 } length = 56 (0x38) > encrypted > } ] >-- [ sslrecord { type = 20 (change_cipher_spec) version = { 3,0 } length = 1 (0x1) } ] >-- [ sslrecord { typ...
JSAPI User Guide
void reporterror(jscontext *cx, const char *message, jserrorreport *report) { fprintf(stderr, "%s:%u:%s\n", report->filename ?
... report->filename : "[no filename]", (unsigned int) report->lineno, message); } int run(jscontext *cx) { // enter a request before running anything in the context.
JS::Compile
used to report filename or url in error messages.
...this information is included in error messages if an error occurs during compilation..
JS::CreateError
syntax // added in spidermonkey 45 bool js::createerror(jscontext *cx, jsexntype type, handleobject stack, handlestring filename, uint32_t linenumber, uint32_t columnnumber, jserrorreport *report, handlestring message, mutablehandlevalue rval); // obsolete since jsapi 39 bool js::createerror(jscontext *cx, jsexntype type, handlestring stack, handlestring filename, uint32_t linenumber, uint32_t columnnumber, jserrorreport *report, handlestring message, mutablehandlevalue rval); name type description cx jscontext * pointer to a js context from which to derive runtime information.
... message js::handlestring the value of error.prototype.message.
JS::Evaluate
used to report filename or url in error messages.
...this information is used in messages if an error occurs during compilation.
JSErrorReport
ucmessage const char16_t * the default unicode error message.
... messageargs const char16_t ** arguments for the error message.
JS_CompileFunction
used to report filename or url in error messages.
...this information is used in error messages if an error occurs during compilation.
JS_CompileFunctionForPrincipals
used to report filename or url in error messages.
...this information is passed in messages if an error occurs during compilation.
JS_CompileScriptForPrincipals
used to report filename or url in error messages.
...this information is included in error messages if an error occurs during compilation.
JS_EvaluateScript
used to report filename or url in error messages.
...this information is used in messages if an error occurs during compilation.
JS_EvaluateScriptForPrincipals
used to report filename or url in error messages.
...this information is used in messages if an error occurs during compilation.
Mork
MozillaTechMork
the header is: // <!-- <mdb:mork:z v="1.4"/> --> this file is therefore version 1.4 of the zany mork format for the message database.
...for example, the message summary format files use a table for each thread, where the meta-rows represent information about the thread in general.
An Overview of XPCOM
xpcom not only supports component software development, it also provides much of the functionality that a development platform provides, such as: component management file abstraction object message passing memory management we will discuss the above items in detail in the coming chapters, but for now, it can be useful to think of xpcom as a platform for component development, in which features such as those listed above are provided.
...these services include a cross platform file abstraction which provides uniform and powerful access to files, directory services which maintain the location of application- and system-specific locations, memory management to ensure everyone uses the same memory allocator, and an event notification system that allows passing of simple messages.
Starting WebLock
using them is a good way for objects to pass messages to each other without the objects having explicit knowledge of one another.
...the nsiobserver is a generic interface for passing messages between two or more objects without defining a specific frozen interface, and it's one of the ways in which extensibility is built into xpcom.
mozIStorageError
the mozistorageerror interface represents errors returned by the storage api, offering attributes to obtain the error code as well as a human-readable error message corresponding to the error that occurred.
... last changed in gecko 1.9.1 (firefox 3.5 / thunderbird 3.0 / seamonkey 2.0) inherits from: nsisupports attributes attribute type description message autf8string a human readable error string with details; this may be null if no details are available.
nsIAccessibleRole
the role is used by xul:browsermessage, role="alert", xforms:message.
... role_dialog 18 represents a dialog box or message box.
nsIDOMGeoPositionError
message domstring human readable error message.
... gecko 1.9.2 note the message attribute was removed in gecko 1.9.2 (firefox 3.6).
nsIDOMMozNetworkStatsManager
when total data usage reaches threshold bytes, a "networkstats-alarm" system message is sent to the application, where the optional parameter data must be a cloneable object.
... return value an alarm object with the same fields as that in the system message; alarmid, network, threshold, and data.
nsIDOMWindowInternal
void alert(in domstring text) boolean confirm(in domstring text) domstring prompt([optional] in domstring amessage, [optional] in domstring ainitial, [optional] in domstring atitle, [optional] in unsigned long asavepassword) void focus() void blur() void back() void forward() void home() void stop() void print() void moveto(in long xpos, in long ypos) void moveby(in long xdif, in long ydif) void resizeto(in long width, i...
...an casesensitive, [optional] in boolean backwards, [optional] in boolean wraparound, [optional] in boolean wholeword, [optional] in boolean searchinframes, [optional] in boolean showdialog) domstring atob(in domstring aasciistring) domstring btoa(in domstring abase64data) nsivariant showmodaldialog(in nsivariant aargs, [optional] in domstring aoptions) void postmessage(in domstring message, in domstring targetorigin) attributes attribute type description window nsidomwindowinternal readonly: the window object itself.
nsIDOMWindowUtils
adeltaz, in unsigned long adeltamode, in long amodifiers, in long alineorpagedeltax, in long alineorpagedeltay, in unsigned long aoptions); void sendnativekeyevent(in long anativekeyboardlayout, in long anativekeycode, in long amodifierflags, in astring acharacters, in astring aunmodifiedcharacters); void sendnativemouseevent(in long ascreenx, in long ascreeny, in long anativemessage, in long amodifierflags, in nsidomelement aelement); nsiquerycontenteventresult sendquerycontentevent(in unsigned long atype, in unsigned long aoffset, in unsigned long alength, in long ax, in long ay); obsolete since gecko 31.0 nsiquerycontenteventresult sendquerycontentevent(in unsigned long atype, in unsigned long aoffset, in unsigned long alength, in long ax, in long ay, [...
... void sendnativemouseevent( in long ascreenx, in long ascreeny, in long anativemessage, in long amodifierflags, in nsidomelement aelement ); parameters ascreenx ascreeny anativemessage amodifierflags aelement sendquerycontentevent() synthesize a query content event.
nsIDebug
void assertion( in string astr, in string aexpr, in string afile, in long aline ); parameters astr assertion message.
...void warning( in string astr, in string afile, in long aline ); parameters astr warning message.
nsIDocumentLoader
void createdocumentloader(out nsidocumentloader aninstance); obsolete since gecko 1.8 void destroy(); obsolete since gecko 1.8 void fireonlocationchange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsiuri auri); obsolete since gecko 1.8 void fireonstatuschange(in nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage); obsolete since gecko 1.8 void getcontentviewercontainer(in nsisupports adocumentid, out nsicontentviewercontainer aresult); native code only!
...hange( in nsiwebprogress awebprogress, in nsirequest arequest, in nsiuri auri ); parameters awebprogress arequest auri fireonstatuschange() obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0) void fireonstatuschange( in nsiwebprogress awebprogress, in nsirequest arequest, in nsresult astatus, in wstring amessage ); parameters awebprogress arequest astatus amessage native code only!getcontentviewercontainer obsolete since gecko 1.8 (firefox 1.5 / thunderbird 1.5 / seamonkey 1.0)this feature is obsolete.
nsIDragService
void firedrageventatsource(in unsigned long amsg); obsolete since gecko 43 void firedrageventatsource(in mozilla::eventmessage aeventmessage); native code only!
... [noscript] void firedrageventatsource( in mozilla::eventmessage aeventmessage ); parameters aeventmessage one of the event messages between edragdropeventfirst and edragdropeventlast defined in widget/eventmessagelist.h getcurrentsession() returns the current nsidragsession.
nsIEditorMailSupport
acitation the "mid" url of the source message.
...void inserttextwithquotations( in domstring astringtoinsert ); parameters astringtoinsert the string to be inserted pasteascitedquotation() paste a string as quoted text, whose representation is dependent on the editor type, replacing the selected text (if any) void pasteascitedquotation( in astring acitation, in long aselectiontype ); parameters acitation the "mid" url of the source message.
nsIException
message string a custom message set by the thrower.
... [binaryname(messagemoz)] read only.
nsIFrameLoader
messagemanager nsichromeframemessagemanager the message manager handling messages for this frame.
... see also content process event handling nsiframeloaderowner nsiframemessagelistener nsichromeframemessagemanager nsidomwindowutils ...
nsIMimeConverter
notaphishmessage indicates whether phisihing filters have been run on a message yet.
...thunderbird provides a utility function which performs this for the currently selected message: markcurrentmessageasread().
nsIMsgCustomColumnHandler
astring getsortstringforrow(in nsimsgdbhdr ahdr); parameters ahdr the message's nsimsgdbhdr.
... unsigned long getsortlongforrow(in nsimsgdbhdr ahdr); parameters ahdr the message's nsimsgdbhdr.
nsIMsgProtocolInfo
cangetincomingmessages boolean true if junk ui actions should be enabled for the account type.
... cangetmessages boolean true if "get messages" ui actions should be enabled for the account type.
nsIMsgSearchCustomTerm
*/ readonly attribute astring name; needsbody /// does this term need the message body?
...gth object to hold array length * * @return array of operators */ void getavailableoperators(in nsmsgsearchscopevalue scope, out unsigned long length, [retval, array, size_is(length)] out nsmsgsearchopvalue operators); match /** * apply the custom search term to a message * * @param msghdr header database reference representing the message * @param searchvalue user-set value to use in the search * @param searchop search operator (contains, ishigherthan, etc.) * * @return true if the term matches the message, else false */ boolean match(in nsimsgdbhdr msghdr, in autf8string search...
nsIMsgSearchValue
attribute astring str; attribute nsmsgpriorityvalue priority; attribute prtime date; // see nsmsgmessageflags.idl and nsmsgfolderflags.idl attribute unsigned long status; attribute unsigned long size; attribute nsmsgkey msgkey; attribute long age; // in days attribute nsimsgfolder folder; attribute nsmsglabelvalue label; attribute nsmsgjunkstatus junkstatus; /* * junkpercent is set by the message filter plugin, and is approximately * proportional...
... to the probability that a message is junk.
nsIProgressEventSink
onstatus() called to notify the event sink with a status message for the given request.
... astatusarg status code argument to be used with the string bundle service to convert the status message into localized, human readable text.
nsITransportSecurityInfo
netwerk/socket/nsitransportsecurityinfo.idlscriptable this interface provides information about transport security, including the security state and any error message for the connection.
... inherits from: nsisupports last changed in gecko 1.9 (firefox 3) attributes attribute type description errormessage wstring error message on connection failure.
nsIUpdate
if the update is a security update, a more seriously-worded user interface message is used to present the update to the user.
... statustext astring an optional message associated with the update.
nsIMsgSearchValue
attribute astring str; attribute nsmsgpriorityvalue priority; attribute prtime date; // see nsmsgmessageflags.idl and nsmsgfolderflags.idl attribute unsigned long status; attribute unsigned long size; attribute nsmsgkey msgkey; attribute long age; // in days attribute nsimsgfolder folder; attribute nsmsglabelvalue label; attribute nsmsgjunkstatus junkstatus; /* * junkpercent is set by the message filter plugin, and is approximately * proportional...
... to the probability that a message is junk.
Buddy icons in mail
seth spitzer mozilla is now able to show icons in the message header area and the addressbook card pane.
... for the message pane, the icon we will show is on disk at: <profile home>/nim/<value of pref aim.session.screenname>/picture/<screenname for sender email address>.gif when trying to determine the screenname for the sender, we search the addressbook that we are using for collection.
MailNews Filters
for new incoming messages, the protocol specific object that handles new messages calls nsimsgfilterlist::applyfilterstohdr and passes itself in as nsimsgfilterhitnotify interface to handle filter hits.
...for each new header, we evaluate the filter criteria and apply the actions synchronously, including moving a message to an other local folder, and advance to the next header.
Mailbox
the mailbox protocol is used to read messages from a local folder berkeley 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.
Spam filtering
to analyze a message for spam, we need the entire message, not just the headers.
... the purge code is implemented as a search of the "junk" folder, looking for "old" message that have the proper junk status.
Filter Incoming Mail
filter incoming mail to filter incoming mail, the first step is to detect new messages inconming.
...by example, setting it to lower case subject = subject.tolocalelowercase(); // then we rebuild a subject objet by rencoding the string // and assign it to the message headers and we're done amsghdr.subject = mimeconvert.encodemimepartiistr_utf8(subject, false, "utf-8", 0, 72); } } }; function init() { var notificationservice = components.classes["@mozilla.org/messenger/msgnotificationservice;1"] .getservice(components.interfaces.nsimsgfoldernotificationservice); notificationservice.addlistener(newmaillistener, notificationservice.msga...
Tips and Tricks from the newsgroups
on in its own tab run shell scripts from an extension (for example, to create a symlink) get extension metadata call java from thunderbird extensions (also an example here, written for firefox but compatible with thunderbird 3.x) define a custom protocol handler to call an external program save attachment and send it repeat image display using css sprites messages use reminderfox to open a message in the default thunderbird 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 di...
...splay 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 ...
Using popup notifications
a popup notification can include a text message, a button action, and zero or more additional actions provided in a drop-down menu accessed through the notification's button.
... components.utils.import('resource://gre/modules/popupnotifications.jsm'); var notify = new popupnotifications(gbrowser, document.getelementbyid("notification-popup"), document.getelementbyid("notification-popup-box")); var notification = notify.show( // browser gbrowser.selectedbrowser, // popup id "pdes-popup", // message "hi, there!, i'm gonna show you something today!!", // anchor id null, // main action { label: "click here", accesskey: "d", callback: function() { // you can call your function here } }, // secondary action null, // options { // alternative way to set the popup icon popupiconurl: "chrome://popupnotifications/skin/mozlogo.png" } ); settimeout(function(){ notification.
Using COM from js-ctypes
#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; void* getnotifyeventhandle; /* end inherit from ispnotifysource */ /* start inherit from ispeventsource */ void* setinterest; void* getevents; void* getinfo; /* end inherit from ispeventsource */ /* start ispvoice */ void* set...
...ctypes.voidptr_t }, { 'addref': ctypes.voidptr_t }, { 'release': ctypes.functiontype(callback_abi, ulong, // return [ ispvoice.ptr ]).ptr }, // end inherit from iunknown // start inherit from ispnotifysource // can set to ctypes.voidptr_t if arent going to use it { 'setnotifysink': ctypes.voidptr_t }, { 'setnotifywindowmessage': ctypes.voidptr_t }, { 'setnotifycallbackfunction': ctypes.voidptr_t }, { 'setnotifycallbackinterface': ctypes.voidptr_t }, { 'setnotifywin32event': ctypes.voidptr_t }, { 'waitfornotifyevent': ctypes.voidptr_t }, { 'getnotifyeventhandle': ctypes.voidptr_t }, // end inherit from ispnotifysource // start inherit from ispeventsource { 'setinterest': ctypes.voidptr_t ...
Mozilla
introduction to layout in mozilla ipc protocol definition language (ipdl) ipdl, short for "ipc (inter-process communication) protocol definition language", is a mozilla-specific language allowing c++ code to pass messages between processes or threads in an organized and secure way.
... all messages for multi-process plugins and tabs in firefox are declared in the ipdl language.
Browser Side Plug-in API - Plugins
npn_forceredraw forces a paint message for a windowless plug-in.
... npn_status displays a message on the status line of the browser window.
Deprecated tools - Firefox Developer Tools
once we have decided to remove the panel, we will provide a warning message, and finally, we will remove the panel from the codebase.
... you may see a warning message, as in the following image, when trying to activate a deprecated panel: in addition, if you open the panel for one of these tools, you will also see a warning message about its removal.
Index - Firefox Developer Tools
logpoints print a message to the console panel instead of pausing code execution.
...within that context they then construct a number of audio nodes, including: 146 web console debugging, guide, security, tools, web development, web development:tools, l10n:priority, web console the web console: 147 console messages most of the web console is occupied by the message display pane: 148 invoke getters from autocomplete no summary!
Tips - Firefox Developer Tools
check "enable persistent logs" in the settings to keep logged messages from before even after navigation.
... check "enable timestamps" in the settings to show timestamps besides the logged messages.
Web Console - Firefox Developer Tools
the web console: logs information associated with a web page: network requests, javascript, css, security errors and warnings as well as error, warning and informational messages explicitly logged by javascript code running in the page context enables you to interact with a web page by executing javascript expressions in the context of the page user interface of the web console parts of the web console ui.
... console messages details of the messages that the console logs.
about:debugging - Firefox Developer Tools
note: if the version of firefox on your remote device is more than one major version older than the version running on your computer, you may see a message like the following: in firefox 76 and above, the message can look like the following: see connection for firefox for android 68 for more information.
... service workers not compatible a warning message is displayed at the top of the this firefox tab if service workers are incompatible with the current browser configuration, and therefore cannot be used or debugged.
Firefox Developer Tools
web console see messages logged by a web page and interact with the page using javascript.
... browser console see messages logged by the browser itself and by add-ons, and run javascript code in the browser's scope.
AddressErrors - Web APIs
that's done by removing all shipping options currently set on the request, then set up an object named shippingaddresserrors which contains a country property which is an error message describing why the stated country isn't being permitted as a value.
... then a paymentdetailsupdate object is created with its error set to a generic message about address errors and with the reset of the object's values taken from shippingaddresserrors, and, using "...defaultpaymentdetails" as the final entry in the object, the remeainder of the properties' values are taken from defaultpaymentdetails.
Client.type - Web APIs
WebAPIClienttype
a document) function sendmessage(message) { return new promise(function(resolve, reject) { // note that this is the serviceworker.postmessage version navigator.serviceworker.controller.postmessage(message); window.serviceworker.onmessage = function(e) { resolve(e.data); }; }); } // controlling service worker self.addeventlistener("message", function(e) { // e.source is a client object e.source.postmessage("hello!
... your message was: " + e.data); // let's also post the type value back to the client e.source.postmessage(e.source.type); }); specifications specification status comment service workersthe definition of 'type' in that specification.
ClipboardItem - Web APIs
async function writeclipimg() { try { const imgurl = '/myimage.png'; const data = await fetch(imgurl); const blob = await data.blob(); await navigator.clipboard.write([ new clipboarditem({ [blob.type]: blob }) ]); console.log('fetched image copied.'); } catch(err) { console.error(err.name, err.message); } } reading from the clipboard here we're returning all items on the clipboard via the clipboard.read() method.
... async function getclipboardcontents() { try { const clipboarditems = await navigator.clipboard.read(); for (const clipboarditem of clipboarditems) { for (const type of clipboarditem.types) { const blob = await clipboarditem.gettype(type); // we can now use blob here } } } catch (err) { console.error(err.name, err.message); } } specifications specification status comment clipboard api and eventsthe definition of 'clipboarditem' in that specification.
console.debug() - Web APIs
WebAPIConsoledebug
the console method debug() outputs a message to the web console at the "debug" log level.
... the message is only displayed to the user if the console is configured to display debug output.
Console.group() - Web APIs
WebAPIConsolegroup
this indents following console messages by an additional level, until console.groupend() is called.
... using groups in the console requires gecko 9.0(firefox 9.0 / thunderbird 9.0 / seamonkey 2.6) you can use nested groups to help organize your output by visually associating related messages.
console.log() - Web APIs
WebAPIConsolelog
the console method log() outputs a message to the web console.
... the message may be a single string (with optional substitution values), or it may be any one or more javascript objects.
ContentIndex - Web APIs
png', }], category: 'article' }; // our asynchronous function to add indexed content async function registercontent(data) { const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) { return; } // register content try { await registration.index.add(data); } catch (e) { console.log('failed to register content: ', e.message); } } retrieving items within the current index the below example shows an asynchronous function that retrieves items within the content index and iterates over each entry, building a list for the interface.
...ync function createreadinglist() { // access our service worker registration const registration = await navigator.serviceworker.ready; // get our index entries const entries = await registration.index.getall(); // create a containing element const readinglistelem = document.createelement('div'); // test for entries if (!array.length) { // if there are no entries, display a message const message = document.createelement('p'); message.innertext = 'you currently have no articles saved for offline reading.' readinglistelem.append(message); } else { // if entries are present, display in a list of links to the content const listelem = document.createelement('ul'); for (const entry of entries) { const listitem = document.createelement('li'); ...
Content Index API - Web APIs
png', }], category: 'article' }; // our asynchronous function to add indexed content async function registercontent(data) { const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) { return; } // register content try { await registration.index.add(data); } catch (e) { console.log('failed to register content: ', e.message); } } retrieving items within the current index the below example shows an asynchronous function that retrieves items within the content index and iterates over each entry, building a list for the interface.
...ync function createreadinglist() { // access our service worker registration const registration = await navigator.serviceworker.ready; // get our index entries const entries = await registration.index.getall(); // create a containing element const readinglistelem = document.createelement('div'); // test for entries if (!array.length) { // if there are no entries, display a message const message = document.createelement('p'); message.innertext = 'you currently have no articles saved for offline reading.' readinglistelem.append(message); } else { // if entries are present, display in a list of links to the content const listelem = document.createelement('ul'); for (const entry of entries) { const listitem = document.createelement('li'); ...
DOMException() - Web APIs
the domexception() constructor returns a domexception object with a specified message and name.
... syntax var domexception = new domexception(); var domexception = new domexception(message); var domexception = new domexception(message, name); parameters message optional a description of the exception.
DOMException - Web APIs
constructor domexception() returns a domexception object with a specified message and name.
... domexception.message read only returns a domstring representing a message or description associated with the given error name.
DeprecationReportBody - Web APIs
message a string containing a human-readable description of the deprecation, including information such as what newer feature has superceded it, if any.
... this typically matches the message a browser will display in its devtools console when a deprecated feature is used, if one is available.
Element.requestFullscreen() - Web APIs
function togglefullscreen() { let elem = document.queryselector("video"); if (!document.fullscreenelement) { elem.requestfullscreen().catch(err => { alert(`error attempting to enable full-screen mode: ${err.message} (${err.name})`); }); } else { document.exitfullscreen(); } } if the document isn't already in full-screen mode—detected by looking to see if document.fullscreenelement has a value—we call the video's requestfullscreen() method.
... we don't need to do anything special if successful, but if the request fails, our promise's catch() handler presents an alert with an appropriate error message.
Encrypted Media Extensions API - Web APIs
interfaces mediakeymessageevent contains the content and related data when the content decryption module (cdm) generates a message for the session.
... mediakeysession represents a context for message exchange with a content decryption module (cdm).
EventSource() - Web APIs
syntax eventsource = new eventsource(url, configuration); parameters url a usvstring that represents the location of the remote resource serving the events/messages.
... examples var evtsource = new eventsource('sse.php'); var eventlist = document.queryselector('ul'); evtsource.onmessage = function(e) { var newelement = document.createelement("li"); newelement.textcontent = "message: " + e.data; eventlist.appendchild(newelement); } note: you can find a full example on github — see simple sse demo using php.
FileSystemEntry.isDirectory - Web APIs
if the entry is neither, an error handler is called with an appropriate message.
... if (entry.isdirectory) { processsubdirectory(entry); } else if (entry.isfile) { processfile(entry); } else { displayerrormessage("unsupported file system entry specified."); } specifications specification status comment file and directory entries apithe definition of 'isdirectory' in that specification.
FileSystemEntry.isFile - Web APIs
if the entry is neither, an error handler is called with an appropriate message.
... if (entry.isdirectory) { processsubdirectory(entry); } else if (entry.isfile) { processfile(entry); } else { displayerrormessage("unsupported file system entry specified."); } specifications specification status comment file and directory entries apithe definition of 'isfile' in that specification.
Using the Geolocation API - Web APIs
this object type contains two properties, a code indicating what type of error has been returned, and a human-readable message that describes what the error code means.
... you could use it like so: function errorcallback(error) { alert(`error(${error.code}): ${error.message}`); }; examples in the following example the geolocation api is used to retrieve the user's latitude and longitude.
HTMLButtonElement - Web APIs
htmlbuttonelement.validationmessage read only is a domstring representing the localized message that describes the validation constraints that the control does not satisfy (if any).
... the following attributes have been added: autofocus, formaction, formenctype, formmethod, formnovalidate, formtarget, labels, validity, validationmessage, and willvalidate.
HTMLCanvasElement: webglcontextcreationerror event - Web APIs
this event has a webglcontextevent.statusmessage property, which can contain a platform dependent string with more information about the failure.
... bubbles yes cancelable yes interface webglcontextevent event handler property none example var canvas = document.getelementbyid('canvas'); canvas.addeventlistener('webglcontextcreationerror', function(e) { console.log(e.statusmessage || 'unknown error'); }, false); var gl = canvas.getcontext('webgl'); // logs statusmessage or "unknown error" if unable to create webgl context specifications specification status comment webgl 1.0the definition of 'webglcontextcreationerror' in that specification.
HTMLElement: transitioncancel event - Web APIs
d'); }); the same, but using the ontransitioncancel property instead of addeventlistener(): const transition = document.queryselector('.transition'); transition.ontransitioncancel = () => { console.log('transition canceled'); }; live example in the following example, we have a simple <div> element, styled with a transition that includes 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 f...
... 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 ...
HTMLElement: transitionend event - Web APIs
=> { console.log('transition ended'); }); the same, but using the ontransitionend: const transition = document.queryselector('.transition'); transition.ontransitionend = () => { console.log('transition ended'); }; 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 that the transitionstart, transitionrun, transitioncancel and transitionend events f...
... 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 f...
HTMLElement: transitionrun event - Web APIs
ame, 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.
HTMLElement: transitionstart event - Web APIs
nstart', () => { 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.
... const transition = document.queryselector('.transition'); const message = document.queryselector('.message'); transition.addeventlistener('transitionrun', function() { message.textcontent = 'transitionrun fired'; }); transition.addeventlistener('transitionstart', function() { message.textcontent = 'transitionstart fired'; }); transition.addeventlistener('transitionend', function() { message.textcontent = 'transitionend fired'; }); the difference is that: transitionrun fires when the transition is created (i.e.
HTMLSelectElement.setCustomValidity() - Web APIs
the htmlselectelement.setcustomvalidity() method sets the custom validity message for the selection element to the specified message.
... syntax selectelt.setcustomvalidity(string); parameters string is the domstring containing the error message.
KeyboardEvent.key - Web APIs
WebAPIKeyboardEventkey
adding-left: 20px; padding-right: 20px; } .fx > div:first-child { width: 30%; } .flex { -webkit-flex: 1; flex: 1; } #test-target { display: block; width: 100%; margin-bottom: 10px; } javascript let textarea = document.getelementbyid('test-target'), consolelog = document.getelementbyid('console-log'), btnclearconsole = document.getelementbyid('btn-clear-console'); function logmessage(message) { document.getelementbyid("console-log").innerhtml += message + "<br>"; } textarea.addeventlistener('keydown', (e) => { if (!e.repeat) logmessage(`key "${e.key}" pressed [event: keydown]`); else logmessage(`key "${e.key}" repeating [event: keydown]`); }); textarea.addeventlistener('beforeinput', (e) => { logmessage(`key "${e.data}" about to be input [event: beforeinp...
...ut]`); }); textarea.addeventlistener('input', (e) => { logmessage(`key "${e.data}" input [event: input]`); }); textarea.addeventlistener('keyup', (e) => { logmessage(`key "${e.key}" released [event: keyup]`); }); btnclearconsole.addeventlistener('click', (e) => { let child = consolelog.firstchild; while (child) { consolelog.removechild(child); child = consolelog.firstchild; } }); result note: on browsers that don't fully implement the inputevent interface which is used for the beforeinput and input events, you may get incorrect output on those lines of the log output.
MIDIInput - Web APIs
WebAPIMIDIInput
use the midiinput interface of the web midi api to access and pass messages to a midi input port.
... event handlers midiinput.onmidimessage when the current port receives a midimessage it triggers a call to this event handler.
MediaError.code - Web APIs
WebAPIMediaErrorcode
to get a text string with specific diagnostic information, see mediaerror.message.
...the error handler simply outputs a message var obj = document.createelement('video'); obj.onerror = function() {console.log("error with media: " + obj.error.code);} obj.src="https://example.com/blahblah.mp4"; specifications specification status comment html living standardthe definition of 'mediaerror.code' in that specification.
MediaError - Web APIs
a mediaerror object describes the error in general terms using a numeric code categorizing the kind of error, and a message, which provides specific diagnostics about what went wrong.
... mediaerror.message a domstring object containing a human-readable string which provides specific diagnostic information to help the reader understand the error condition which occurred; specifically, it isn't simply a summary of what the error code means, but actual diagnostic information to help in understanding what exactly went wrong.
MediaKeys - Web APIs
WebAPIMediaKeys
methods mediakeys.createsession() returns a new mediakeysession object, which represents a context for message exchange with a content decryption module (cdm).
... mediakeys.setservercertificate() returns a promise to a server certificate to be used to encrypt messages to the license server.
MediaRecorder.onwarning - Web APIs
mediarecorder.onwarning = function(e) { console.log("a warning has been raised: " + e.message); } ...
... properties message contains information about the error that occurred.
MediaStreamConstraints.audio - Web APIs
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.
...; 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
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.
...= 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.
Transcoding assets for Media Source Extensions - Web APIs
.mp4 splitting media file (video) video_01250.mp4 splitting media file (video) video_01625.mp4 splitting media file (video) video_02000.mp4 $ tree -l 2 output output ├── audio │ └── und ├── stream.mpd └── video ├── 1 ├── 2 ├── 3 ├── 4 └── 5 8 directories, 1 file note: mp4-dash-encode.py does not display ffmpeg error messages.
... note: if "invalid duration specification for force_key_frames: 'expr:eq(mod(n" is displayed as an error message, modify mp4-dash-encode.py and remove two "'" from "-force_key_frames 'expr:eq(mod(n,%d),0)'".
Using the Notifications API - Web APIs
examples one of the most obvious use cases for web notifications is a web-based mail or irc application that needs to notify the user when a new message is received, even if the user is doing something else with another application.
... replacing existing notifications it is usually undesirable for a user to receive a lot of notifications in a short space of time — for example, what if a messenger application notified a user for each incoming message, and they were being sent a lot?
OffscreenCanvas - Web APIs
main.js (main thread code): var htmlcanvas = document.getelementbyid("canvas"); var offscreen = htmlcanvas.transfercontroltooffscreen(); var worker = new worker("offscreencanvas.js"); worker.postmessage({canvas: offscreen}, [offscreen]); offscreencanvas.js (worker code): onmessage = function(evt) { var canvas = evt.data.canvas; var gl = canvas.getcontext("webgl"); // ...
...}; you can also use requestanimationframe in workers onmessage = function(evt) { const canvas = evt.data.canvas; const gl = canvas.getcontext("webgl"); function render(time) { // ...
PaymentDetailsUpdate.error - Web APIs
the paymentdetailsupdate dictionary's error property is a human-readable domstring which provides an error message to be displayed if the specified information doesn't offer any valid shipping options.
... this message can be used to explain to the user why they cannot submit their payment as currently specified—whether that's because the selected products cannot be shipped to their region or because their address is not served by any of the shipping companies you use.
PerformanceResourceTiming.decodedBodySize - Web APIs
the decodedbodysize read-only property returns the size (in octets) received from the fetch (http or cache) of the message body, after removing any applied content-codings.
... syntax resource.decodedbodysize; return value the size (in octets) received from the fetch (http or cache) of the message body, after removing any applied content-codings.
Permissions.query() - Web APIs
WebAPIPermissionsquery
uservisibleonly: (push only, not supported in firefox — see the browser support section below) indicates whether you want to show a notification for every message or be able to send silent push notifications.
... sysex: (midi only) indicates whether you need and/or receive system exclusive messages.
Permissions.revoke() - Web APIs
uservisibleonly: (push only, not supported in firefox — see the browser compatibility section below) indicates whether you want to show a notification for every message or be able to send silent push notifications.
... sysex: (midi only) indicates whether you need and/or receive system exclusive messages.
PushManager.permissionState() - Web APIs
it can have the following properties: uservisibleonly: a boolean indicating that the returned push subscription will only be used for messages whose effect is made visible to the user.
... applicationserverkey: a public key your push server will use to send messages to client apps via a push server.
PushManager.subscribe() - Web APIs
it can have the following properties: uservisibleonly: a boolean indicating that the returned push subscription will only be used for messages whose effect is made visible to the user.
...if specified, all messages from your application server must use the vapid authentication scheme, and include a jwt signed with the corresponding private key.
PushSubscription.endpoint - Web APIs
the endpoint takes the form of a custom url pointing to a push server, which can be used to send a push message to the particular service worker instance that subscribed to the push service.
... example navigator.serviceworker.ready.then(function(reg) { reg.pushmanager.subscribe({uservisibleonly: true}).then(function(subscription) { console.log(subscription.endpoint); // at this point you would most likely send the subscription // endpoint to your server, save it, then use it to send a // push message at a later date }) }) specifications specification status comment push apithe definition of 'endpoint' in that specification.
PushSubscription.options - Web APIs
syntax var options = pushsubscription.options value an read-only options object containing the following values: uservisibleonly: a boolean, indicating that the returned push subscription will only be used for messages whose effect is made visible to the user.
... applicationserverkey: a public key your push server will use to send messages to client apps via a push server.
RTCDataChannel.bufferedAmountLowThreshold - Web APIs
this event may be used, for example, to implement code which queues more messages to be sent whenever there's room to buffer them.
...as messages are actually sent, this value is reduced accordingly.
RTCDataChannel.close() - Web APIs
the transport layer deals with any buffered messages; the protocol layer decides whether to send them or discard them.
... example var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel"); dc.onmessage = function (event) { console.log("received: " + event.data); dc.close(); // we decided to close after the first received message }; dc.onopen = function () { console.log("datachannel open"); }; dc.onclose = function ( console.log("datachannel close"); }; // now negotiate the connection and so forth...
RTCDataChannel: close event - Web APIs
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).
... you can also use the onclose event handler property to set a handler for close events: dc.onclose = ev => { messageinputbox.disabled = true; sendbutton.disabled = true; connectbutton.disabled = false; disconnectbutton.disabled = true; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'close' in that specification.
RTCDataChannel.maxRetransmits - Web APIs
the read-only rtcdatachannel property maxretransmits returns the maximum number of times the browser should try to retransmit a message before giving up, as set when the data channel was created, or null, which indicates that there is no maximum.
... syntax var tries = adatachannel.maxretransmits; value the maximum number of times the browser will try to retransmit a message before giving up, or null if not set when rtcpeerconnection.createdatachannel() was called.
RTCDataChannel.onclose - Web APIs
this way, the message entry field and the send button are only enabled for use when the connection is actually open.
... let pc = new rtcpeerconnection(); let dc = pc.createdatachannel("messagechannel")}}; dc.onopen = function(event) { document.getelementbyid("messagebox").disabled = false; document.getelementbyid("sendbutton").disabled = false; }; dc.onclose = function(event) { document.getelementbyid("messagebox").disabled = true; document.getelementbyid("sendbutton").disabled = true; } /* now negotiate the connection, etc...
RTCDataChannel.onerror - Web APIs
the error handler passes information about the error to a ui library's alert box function to present an error message to the user.
... let pc = new rtcpeerconnection(); let dc = pc.createdatachannel("playercontrol"); dc.onerror = function(event) { myuilibrary.doalertbox({ 'network error', // alert title 'the error "' + event.message + '" occurred while handling player control network messages.', event.filename, event.lineno, event.colno }); } /* ...
RTCDataChannel.protocol - Web APIs
the ability for each channel to have a defined subprotocol lets your app, for example, use json objects as messages on one channel while another channel is plaintext and another is raw binary or even some other format.
... example var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel", { protocol: "json" }); function handlechannelmessage(datachannel, msg) { switch(datachannel.protocol) { case "json": /* process json data */ break; case "raw": /* process raw binary data */ break; } } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannel.protocol' in that specification.
RTCDataChannel.readyState - Web APIs
it is no longer possible to queue new messages to be sent, but previously queued messages may still be send or received before entering the "closed" state.
... example var datachannel = peerconnection.createdatachannel("file transfer"); var sendqueue = []; function sendmessage(msg) { switch(datachannel.readystate) { case "connecting": console.log("connection not open; queueing: " + msg); sendqueue.push(msg); break; case "open": sendqueue.foreach((msg) => datachannel.send(msg)); break; case "closing": console.log("attempted to send message while closing: " + msg); break; case "closed": console.log("error!
RTCErrorEvent.error - Web APIs
datachannel.addeventlistener("error", (event) => { let error = event.error; if (error.errordetail === "sdp-syntax-error") { let errline = error.sdplinenumber; let errmessage = error.message; let alertmessage = `a syntax error occurred interpreting line ${errline} of the sdp: ${errmessage}`; showmyalertmessage("data channel error", alertmessage); } else { terminatemyconnection(); } }); if the error is an sdp syntax error—indicated by its errordetail property being sdp-syntax-error—, a message string is constructed to present the error message an...
...this message is then displayed using a function called showmyalertmessage(), which stands in for whatever output mechanism this code might use.
RTCIceCandidateInit.candidate - Web APIs
if your client-side signaling layer builds and transmits a json string including the candidate to the remote peer, the remote peer might handle receiving that json message like this: function goticecandidatemessage(msg) { var icecandidate = new rtcicecandidate({ candidate: msg.candidate; }); pc.addicecandidate(icecandidate).catch({ /* handle error */ }); } it's helpful to note that for backward compatibility with older versions of the webrtc specification, the rtcicecandidate() constructor accepts the value of candidate as its only input, in...
...that usage would change the above sample to look like this: function goticecandidatemessage(msg) { var icecandidate = new rtcicecandidate(msg.candidate); pc.addicecandidate(icecandidate).catch({ /* handle error */ }); } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcicecandidateinit.candidate' in that specification.
RTCPeerConnection.addIceCandidate() - Web APIs
syntax apromise = pc.addicecandidate(candidate); addicecandidate(candidate, successcallback, failurecallback); parameters candidate optional an object conforming to the rtcicecandidateinit dictionary, or an rtcicecandidate object; the contents of the object should be constructed from a message received over the signaling channel, describing a newly received ice candidate that's ready to be delivered to the local ice agent.
... // this example assumes that the other peer is using a signaling channel as follows: // // pc.onicecandidate = event => { // if (event.candidate) { // signalingchannel.send(json.stringify({ice: event.candidate})); // "ice" is arbitrary // } else { // // all ice candidates have been sent // } // } signalingchannel.onmessage = receivedstring => { const message = json.parse(receivedstring); if (message.ice) { // a typical value of ice here might look something like this: // // {candidate: "candidate:0 1 udp 2122154243 192.168.1.9 53421 typ host", sdpmid: "0", ...} // // pass the whole thing to addicecandidate: pc.addicecandidate(message.ice).catch(e => { console.log("failure during a...
RTCPeerConnection.createAnswer() - Web APIs
this code comes from the handler for the message sent to carry an offer to another peer across the signaling channel.
...in this case, a websocket connection is used to send a json message with a type field with the value "video-answer" to the other peer, carrying the answer to the device which sent the offer to connect.
RTCPeerConnection: datachannel event - Web APIs
pc.addeventlistener("datachannel", ev => { receivechannel = ev.channel; receivechannel.onmessage = myhandlemessage; receivechannel.onopen = myhandleopen; receivechannel.onclose = myhandleclose; }, false); receivechannel is set to the value of the event's channel property, which specifies the rtcdatachannel object representing the data channel linking the remote peer to the local one.
... this same code can also instead use the rtcpeerconnection interface's ondatachannel event handler property, like this: pc.ondatachannel = ev => { receivechannel = ev.channel; receivechannel.onmessage = myhandlemessage; receivechannel.onopen = myhandleopen; receivechannel.onclose = myhandleclose; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'datachannel' in that specification.
RTCPeerConnection.onicecandidate - Web APIs
this happens whenever the local ice agent needs to deliver a message to the other peer through the signaling server.
...this message should not be sent to the remote peer.
RTCPeerConnectionIceErrorEvent.address - Web APIs
examples this example creates a handler for icecandidateerror events which creates human readable messages describing the local network interface for the connection as well as the ice server that was being used to try to open the connection, then calls a function to display those as well as the event's errortext property's contents.
... pc.addeventlistener("icecandidateerror", (event) => { let networkinfo = `[local interface: ${event.address}:${event.port}`; let iceserverinfo = `[ice server: ${event.url}`; showmessage(errortext, iceserverinfo, networkinfo); }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnectioniceerrorevent.address' in that specification.
RTCRtpStreamStats.pliCount - Web APIs
a pli message is used by video decoders (running on the receiving end of the stream) to notify the encoder (the sender) that an undefined amount of coded video data, which may span frame boundaries, has been lost.
...however, the primary purpose of this message is to allow the sender to consider techniques to mitigate network performance issues.
RTCSctpTransport - Web APIs
possibly the most useful property on this interface is its maxmessagesize property, which you can use to determine the upper limit on the size of messages you can send over a data channel on the peer connection.
... rtcsctptransport.maxmessagesizeread only an integer value indicating the maximum size, in bytes, of a message which can be sent using the rtcdatachannel.send() method.
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); el...
...se pc.addicecandidate(new rtcicecandidate(message.candidate), function () {}, logerror); }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescription' in that specification.
Response.redirected - Web APIs
in the code below, a textual message is inserted into an element when a redirect occurred during the fetch operation.
... fetch("awesome-picture.jpg").then(function(response) { let elem = document.getelementbyid("warning-message-box"); if (response.redirected) { elem.innerhtml = "unexpected redirect"; } else { elem.innerhtml = ""; } return response.blob(); }).then(function(imageblob) { let imgobjecturl = url.createobjecturl(imageblob); document.getelementbyid("img-element-id").src = imgobjecturl; }); disallowing redirects because using redirected to manually filter out redirects can allow forgery of redirects, you should instead set the redirect mode to "error" in the init parameter when calling fetch(), like this: fetch("awesome-picture.jpg", { red...
Using the Screen Capture API - Web APIs
video: { cursor: "always" }, audio: false }; // set event listeners for the start and stop buttons startelem.addeventlistener("click", function(evt) { startcapture(); }, false); stopelem.addeventlistener("click", function(evt) { stopcapture(); }, false); logging content to make logging of errors and other issues easy, this example overrides certain console methods to output their messages to the <pre> block whose id is log.
... if any of that fails, the catch() clause outputs an error message to the log box.
Server-sent events - Web APIs
with server-sent events, it's possible for a server to send new data to a web page at any time, by pushing messages to the web page.
... these incoming messages can be treated as events + data inside the web page.
SharedWorkerGlobalScope - Web APIs
sharedworkerglobalscope.onconnect is an eventhandler representing the code to be called when the connect event is raised — that is, when a messageport connection is opened between the associated sharedworker and the main thread.
... workerglobalscope.dump() allows you to write a message to stdout — i.e.
Transferable - Web APIs
this interface does not define any method or property; it is merely a tag indicating objects that can be used in specific conditions, such as being transfered to a worker using the worker.postmessage() method.
... the arraybuffer, messageport, imagebitmap and offscreencanvas types implement this interface.
A basic 2D WebGL animation example - Web APIs
if an error occurrs while linking the program, the error message is logged to console.
...note the use of a template literal string to insert the correct shader type string into the message that gets generated.
Boilerplate 1 - Web APIs
specifically, the html has a <p> element that contains some descriptive text about the page and may also hold error messages; a <canvas> element; and optionally a <button>.
...in case of error, it displays an error message and returns null.
WebGL best practices - Web APIs
every webgl error is reported in the web console as a javascript warning with a descriptive message.
... after too many errors (32 in firefox), webgl stops generating descriptive messages, which really hinders debugging.
Lifetime of a WebRTC session - Web APIs
information exchanged during signaling there are three basic types of information that need to be exchanged during signaling: control messages used to set up, open, and close the communication channel, and to handle errors.
... each peer connects to an agreed-upon signaling server, such as a websocket server they both know how to exchange messages with.
The WebSocket API (WebSockets) - Web APIs
with this api, you can send messages to a server and receive event-driven responses without having to poll the server for a reply.
... messageevent the event sent by the websocket object when a message is received from the server.
Web Audio API - Web APIs
audioworkletnode the audioworkletnode interface represents an audionode that is embedded into an audio graph and can pass messages to the corresponding audioworkletprocessor.
... audioworkletprocessor the audioworkletprocessor interface represents audio processing code running in a audioworkletglobalscope that generates, processes, or analyses audio directly, and can pass messages to the corresponding audioworkletnode.
Web Workers API - Web APIs
data is sent between workers and the main thread via a system of messages — both sides send their messages using the postmessage() method, and respond to messages via the onmessage event handler (the message is contained within the message event's data property).
... worker represents a running worker thread, allowing you to pass messages to the running worker code.
Window.alert() - Web APIs
WebAPIWindowalert
syntax window.alert(message); parameters message optional a string you want to display in the alert dialog, or, alternatively, an object that is converted into a string and displayed.
... example window.alert("hello world!"); alert("hello world!"); both produce: notes the alert dialog should be used for messages which do not require any response on the part of the user, other than the acknowledgement of the message.
Window.confirm() - Web APIs
WebAPIWindowconfirm
the window.confirm() method displays a modal dialog with an optional message and two buttons: ok and cancel.
... syntax result = window.confirm(message); parameters message a string you want to display in the alert dialog.
Window.open() - Web APIs
WebAPIWindowopen
will create a new window or will re-use an already opened one" >promote firefox adoption</a></p> <p><a href="http://www.mozilla.org/support/firefox/faq" target="singlesecondarywindowname" onclick="openrequestedsinglepopup(this.href); return false;" title="this link will create a new window or will re-use an already opened one" >firefox faq</a></p> faq how can i prevent the confirmation message asking the user whether they want to close the window?
...the javascript console in mozilla-based browsers will report the warning message: "scripts may not close windows that were not opened by script." otherwise the history of urls visited during the browser session would be lost.
Window.prompt() - Web APIs
WebAPIWindowprompt
the window.prompt() displays a dialog with an optional message prompting the user to input some text.
... syntax result = window.prompt(message, default); parameters message optional a string of text to display to the user.
WindowEventHandlers - Web APIs
windoweventhandlers.onmessage is an eventhandler representing the code to be called when the message event is raised.
... windoweventhandlers.onmessageerror is an eventhandler representing the code to be called when the messageerror event is raised.
WindowOrWorkerGlobalScope.clearTimeout() - Web APIs
you'll see a message popping up in a second.
... var alarm = { remind: function(amessage) { alert(amessage); this.timeoutid = undefined; }, setup: function() { if (typeof this.timeoutid === 'number') { this.cancel(); } this.timeoutid = window.settimeout(function(msg) { this.remind(msg); }.bind(this), 1000, 'wake up!'); }, cancel: function() { window.cleartimeout(this.timeoutid); } }; window.onclick = function() { alarm.setup(); }; notes passing an invalid id to cleartimeout() silently does nothing; no exception is thrown.
XMLHttpRequest - Web APIs
if your communication needs to involve receiving event data or message data from a server, consider using server-sent events through the eventsource interface.
...unlike xmlhttprequest.status, this includes the entire text of the response message ("200 ok", for example).
Using the alert role - Accessibility
the alert role is used to communicate an important and usually time-sensitive message to the user.
... assistive technology products should listen for such an event and notify the user accordingly: screen readers may interrupt current output (whether it's speech or braille) and immediately announce or display the alert message.
Using the alertdialog role - Accessibility
note: this role should only be used for alert messages that have associated interactive controls.
... examples example 1: a basic alert dialog the code snippet below shows how to mark up an alert dialog that only provides a message and an ok button.
Using ARIA: Roles, states, and properties - Accessibility
ation row rowgroup rowheader separator table term textbox toolbar tooltip landmark roles banner complementary contentinfo form main navigation region search live region roles alert log marquee status timer window roles alertdialog dialog states and properties widget attributes aria-autocomplete aria-checked aria-current aria-disabled aria-errormessage aria-expanded aria-haspopup aria-hidden aria-invalid aria-label aria-level aria-modal aria-multiline aria-multiselectable aria-orientation aria-placeholder aria-pressed aria-readonly aria-required aria-selected aria-sort aria-valuemax aria-valuemin aria-valuenow aria-valuetext live region attributes aria-live aria-relevant aria-atomic aria-busy drag & drop attribu...
...tes aria-dropeffect aria-dragged relationship attributes aria-activedescendant aria-colcount aria-colindex aria-colspan aria-controls aria-describedby aria-details aria-errormessage aria-flowto aria-labelledby aria-owns aria-posinset aria-rowcount aria-rowindex aria-rowspan aria-setsize microsoftedge-specific properties x-ms-aria-flowfrom ...
ARIA: alert role - Accessibility
the alert role is added to the node containing an alert message, not the element causing the alert to be triggered.
...it is perfect for situations such as when a user fills out a form and javascript is used to add an error message - the alert would immediately read out the message.
ARIA: document role - Accessibility
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.
... once focus returns to the message list either by activating the back button or pressing an asociated keystroke, direct application interaction mode is invoked again, and the user can move to a different conversation in the list with the arrow keys.
Accessibility documentation index - Accessibility
15 using the alert role aria, accessibility, advanced, css, example, html, needscontent, alert, alert role, alertrole, alerts, assitive technology, role configuration, wcag1.2.1, wcag3.3.1 the alert role is used to communicate an important and usually time-sensitive message to the user.
... 103 understandable accessibility, help, language, navigation, principle 3, text, understandable, wcag, web content accessibility guidelines, abbreviations, consistency, error messages, form validation, labels, slang this article provides practical advice on how to write your web content so that it conforms to the success criteria outlined in the understandable principle of the web content accessibility guidelines (wcag) 2.0 and 2.1.
Robust - Accessibility
4.1.3 status messages (aa) added in 2.1 assistive technology users are made aware of new status messages added to the page.
... understanding status messages note: also see the wcag description for guideline 4.1: compatible: maximize compatibility with current and future user agents, including assistive technologies.
Ajax - Developer guides
WebGuideAJAX
with server-sent events, it's possible for a server to send new data to a web page at any time, by pushing messages to the web page.
... these incoming messages can be treated as events + data inside the web page.
<input type="file"> - HTML: Hypertext Markup Language
WebHTMLElementinputfile
if so, print a message into the preview <div> stating that no files have been selected.
... if the file type is invalid, we display a message inside a list item telling the user that they need to select a different file type.
<input type="number"> - HTML: Hypertext Markup Language
WebHTMLElementinputnumber
it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message.
.../label> <input id="balloons" type="number" name="balloons" step="10" min="0" max="100" required> <span class="validity"></span> </div> <div> <input type="submit"> </div> </form> try submitting the form with different invalid values entered — e.g., no value; a value below 0 or above 100; a value that is not a multiple of 10; or a non-numerical value — and see how the error messages the browser gives you differ with different ones.
<noframes>: The Frame Fallback element - HTML: Hypertext Markup Language
WebHTMLElementnoframes
<noframes> can be used to present a message explaining that the user's browser doesn't support frames, but ideally should be used to present an alternate form of the site that doesn't use frames but still offers the same or similar functionality.
...in addition, <noframes> is used to present an explanatory message if the user agent doesn't support frames.
Using the application cache - HTML: Hypertext Markup Language
as of firefox 44+, when appcache is used to provide offline support for a page, a warning message displays in the console advising developers to use service workers instead (bug 1204581).
...the notification bar displays a message such as: this website (example.com) is asking to store data on your computer for offline use.
Evolution of HTTP - HTTP
ssl 1.0 was never released outside the company, but ssl 2.0 and its successor ssl 3.0 allowed for the creation of e-commerce web sites by encrypting and guaranteeing the authenticity of the messages exchanged between the server and client.
... since 2005, the set of apis available to web pages greatly increased and several of these apis created extensions, mostly new specific http headers, to the http protocol for specific purposes: server-sent events, where the server can push occasional messages to the browser.
Identifying resources on the Web - HTTP
urn:isbn:9780141036144 urn:ietf:rfc:7230 the two urns correspond to the book nineteen eighty-four by george orwell, the ietf specification 7230, hypertext transfer protocol (http/1.1): message syntax and routing.
... examples https://developer.mozilla.org/docs/learn tel:+1-816-555-1212 git@github.com:mdn/browser-compat-data.git ftp://example.org/resource.txt urn:isbn:9780141036144 mailto:help@supercyberhelpdesk.info specifications specification title rfc 7230, section 2.7: uniform resource identifiers hypertext transfer protocol (http/1.1): message syntax and routing ...
Compression in HTTP - HTTP
end-to-end compression refers to a compression of the body of a message that is done by the server and will last unchanged until it reaches the client.
... hop-by-hop compression hop-by-hop compression, though similar to end-to-end compression, differs by one fundamental element: the compression doesn't happen on the resource in the server, creating a specific representation that is then transmitted, but on the body of the message between any two nodes on the path between the client and the server.
Content negotiation - HTTP
compressing http messages is one of the most important ways to improve the performance of a web site, it shrinks the size of the data transmitted and makes better use of the available bandwidth; browsers always send this header and the server should be configured to abide to it and to use compression.
...this is not too problematic with few headers, but with the eventual multiplications of them, the message size would lead to a decrease in performance.
Content-Disposition - HTTP
the content-disposition header is defined in the larger context of mime messages for e-mail, but only a subset of the possible parameters apply to http forms and post requests.
...--boundary content-disposition: form-data; name="field2"; filename="example.txt" value2 --boundary-- specifications specification title rfc 7578 returning values from forms: multipart/form-data rfc 6266 use of the content-disposition header field in the hypertext transfer protocol (http) rfc 2183 communicating presentation information in internet messages: the content-disposition header field ...
CSP: report-uri - HTTP
$current_domain; http_response_code(204); // http 204 no content $json_data = file_get_contents('php://input'); // we pretty print the json before adding it to the log file if ($json_data = json_decode($json_data)) { $json_data = json_encode($json_data, json_pretty_print | json_unescaped_slashes); if (!file_exists($log_file)) { // send an email $message = "the following content-security-policy violation occurred on " .
... $log_file; mail($email_address, $email_subject, $message, 'content-type: text/plain;charset=utf-8'); } else if (filesize($log_file) > $log_file_size_limit) { exit(0); } file_put_contents($log_file, $json_data, file_append | lock_ex); } specifications specification status comment content security policy level 3the definition of 'report-uri' in that specification.
Keep-Alive - HTTP
note that timeouts longer than the tcp timeout may be ignored if no keep-alive tcp message is set at the transport level.
...g: gzip content-type: text/html; charset=utf-8 date: thu, 11 aug 2016 15:23:13 gmt keep-alive: timeout=5, max=1000 last-modified: mon, 25 jul 2016 04:32:39 gmt server: apache (body) specifications specification title http keep-alive header keep-alive header (ietf internet draft) rfc 7230, appendix a.1.2: keep-alive hypertext transfer protocol (http/1.1): message syntax and routing ...
Large-Allocation - HTTP
examples large-allocation: 0 large-allocation: 500 troubleshooting errors the large-allocation header throws warnings or error messages when used incorrectly.
... this message means that the browser saw the large-allocation header, and was able to reload the page into a new process which should have more available contiguous memory.
Via - HTTP
WebHTTPHeadersVia
it is used for tracking message forwards, avoiding request loops, and identifying the protocol capabilities of senders along the request/response chain.
... examples via: 1.1 vegur via: http/1.1 gwa via: 1.0 fred, 1.1 p.example.net specifications specification title rfc 7230, section 5.7.1: via hypertext transfer protocol (http/1.1): message syntax and routing ...
Warning - HTTP
WebHTTPHeadersWarning
the warning general http header contains information about possible problems with the status of the message.
... warning header fields can in general be applied to any message, however some warn-codes are specific to caches and can only be applied to response messages.
TRACE - HTTP
WebHTTPMethodsTRACE
the http trace method performs a message loop-back test along the path to the target resource, providing a useful debugging mechanism.
... the final recipient of the request should reflect the message received, excluding some fields described below, back to the client as the message body of a 200 (ok) response with a content-type of message/http.
HTTP range requests - HTTP
http range requests allow to send only a portion of an http message from a server to a client.
...the content-range response header indicates where in the full resource this partial message belongs.
Redirections in HTTP - HTTP
if you serve the response as the result of this request, a simple press of the reload button will resend the request (possibly after a confirmation message).
...in this case, browsers will detect it and display an error message.
HTTP resources and specifications - HTTP
specification title status rfc 7230 hypertext transfer protocol (http/1.1): message syntax and routing proposed standard rfc 7231 hypertext transfer protocol (http/1.1): semantics and content proposed standard rfc 7232 hypertext transfer protocol (http/1.1): conditional requests proposed standard rfc 7233 hypertext transfer protocol (http/1.1): range requests proposed standard rfc 7234 hypertext transfer protocol (http/...
...l (http) keep-alive header informational (expired) draft spec http client hints ietf draft rfc 7578 returning values from forms: multipart/form-data proposed standard rfc 6266 use of the content-disposition header field in the hypertext transfer protocol (http) proposed standard rfc 2183 communicating presentation information in internet messages: the content-disposition header field only a subset of syntax of the content-disposition header can be used in the context of http messages.
Private class fields - JavaScript
class classwithprivatemethod { #privatemethod() { return 'hello world' } getprivatemessage() { return this.#privatemethod() } } const instance = new classwithprivatemethod() console.log(instance.getprivatemessage()) // expected output: "hello worl​d" private instance methods may be generator, async, or async generator functions.
... private getters and setters are also possible: class classwithprivateaccessor { #message get #decoratedmessage() { return `✨${this.#message}✨` } set #decoratedmessage(msg) { this.#message = msg } constructor() { this.#decoratedmessage = 'hello world' console.log(this.#decoratedmessage) } } new classwithprivateaccessor(); // expected output: "✨hello worl​d✨" specifications specification public and private instance fieldsthe definition of 'fielddefinition' in that specification.
SyntaxError: Malformed formal parameter - JavaScript
message syntaxerror: expected {x} (edge) syntaxerror: malformed formal parameter (firefox) error type syntaxerror what went wrong?
... admittedly the wording in the error message is slightly strange.
JavaScript error reference - JavaScript
each error is an object based upon the error object, and has a name and a message.
... list of errors in this list, each page is listed by name (the type of error) and message (a more detailed human-readable error message).
AggregateError - JavaScript
instance properties aggregateerror.prototype.message error message, defaults to "".
... examples catching an aggregateerror promise.any([ promise.reject(new error("some error")), ]).catch(e => { console.log(e instanceof aggregateerror); // true console.log(e.message); // "all promises rejected" console.log(e.name); // "aggregateerror" console.log(e.errors); // [ error: "some error" ] }); creating an aggregateerror try { throw new aggregateerror([ new error("some error"), ], 'hello'); } catch (e) { console.log(e instanceof aggregateerror); // true console.log(e.message); // "hello" console.log(e.name); // "aggregateerror" console.log(e.errors); // [ error: "some err...
Error.prototype.toString() - JavaScript
'error' : string(name); var msg = this.message; msg = (msg === undefined) ?
... '' : string(msg); if (name === '') { return msg; } if (msg === '') { return name; } return name + ': ' + msg; }; examples using tostring() var e = new error('fatal error'); console.log(e.tostring()); // 'error: fatal error' e.name = undefined; console.log(e.tostring()); // 'error: fatal error' e.name = ''; console.log(e.tostring()); // 'fatal error' e.message = undefined; console.log(e.tostring()); // '' e.name = 'hello'; console.log(e.tostring()); // 'hello' specifications specification ecmascript (ecma-262)the definition of 'error.prototype.tostring' in that specification.
EvalError() constructor - JavaScript
syntax new evalerror([message[, filename[, linenumber]]]) parameters message optional.
... creating an evalerror try { throw new evalerror('hello', 'somefile.js', 10); } catch (e) { console.log(e instanceof evalerror); // true console.log(e.message); // "hello" console.log(e.name); // "evalerror" console.log(e.filename); // "somefile.js" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // "@scratchpad/2:2:9\n" } specifications specification ecmascript (ecma-262)the definition of 'nativeerror constr...
Intl.ListFormat() constructor - JavaScript
type the format of output message.
... style the length of the formated message.
Intl.RelativeTimeFormat() constructor - JavaScript
numeric the format of output message.
... style the length of the internationalized message.
Intl.RelativeTimeFormat.prototype.format() - JavaScript
syntax relativetimeformat.format(value, unit) parameters value numeric value to use in the internationalized relative time message.
... unit unit to use in the relative time internationalized message.
Intl.RelativeTimeFormat.prototype.formatToParts() - JavaScript
syntax relativetimeformat.formattoparts(value, unit) parameters value numeric value to use in the internationalized relative time message.
... unit unit to use in the relative time internationalized message.
Intl.RelativeTimeFormat.prototype.resolvedOptions() - JavaScript
style the length of the internationalized message.
... numeric the format of output message.
Promise.all() - JavaScript
it rejects immediately upon any of the input promises rejecting or non-promises throwing an error, and will reject with this first rejection message / error.
... var p3 = new promise((resolve, reject) => { settimeout(() => resolve('three'), 3000); }); var p4 = new promise((resolve, reject) => { settimeout(() => resolve('four'), 4000); }); var p5 = new promise((resolve, reject) => { reject(new error('reject')); }); // using .catch: promise.all([p1, p2, p3, p4, p5]) .then(values => { console.log(values); }) .catch(error => { console.error(error.message) }); //from console: //"reject" it is possible to change this behaviour by handling possible rejections: var p1 = new promise((resolve, reject) => { settimeout(() => resolve('p1_delayed_resolution'), 1000); }); var p2 = new promise((resolve, reject) => { reject(new error('p2_immediate_rejection')); }); promise.all([ p1.catch(error => { return error }), p2.catch(error => { return er...
RangeError - JavaScript
instance properties rangeerror.prototype.message error message.
... although ecma-262 specifies that rangeerror should provide its own message property, in spidermonkey, it inherits error.prototype.message.
SyntaxError() constructor - JavaScript
syntax new syntaxerror([message[, filename[, linenumber]]]) parameters message optional human-readable description of the error filename optional the name of the file containing the code that caused the exception linenumber optional the line number of the code that caused the exception examples catching a syntaxerror try { eval('hoo bar'); } catch (e) { console.error(e instanceof syntaxerror); console.error(e.message); console.error(e.name); console.error(e.filename); console.error(e.linenumber); console.error(e.columnnumber); console.error(e.stack); } creating a syntaxerror try { throw new syntaxerror('hello', 'somefile.js', 1...
...0); } catch (e) { console.error(e instanceof syntaxerror); // true console.error(e.message); // hello console.error(e.name); // syntaxerror console.error(e.filename); // somefile.js console.error(e.linenumber); // 10 console.error(e.columnnumber); // 0 console.error(e.stack); // @debugger eval code:3:9 } specifications specification ecmascript (ecma-262)the definition of 'nativeerror constructor' in that specification.
WebAssembly.CompileError() constructor - JavaScript
syntax new webassembly.compileerror(message, filename, linenumber) parameters message optional human-readable description of the error.
... examples creating a new compileerror instance the following snippet creates a new compileerror instance, and logs its details to the console: try { throw new webassembly.compileerror('hello', 'somefile', 10); } catch (e) { console.log(e instanceof compileerror); // true console.log(e.message); // "hello" console.log(e.name); // "compileerror" console.log(e.filename); // "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } specifications specification webassembly jav...
WebAssembly.LinkError() constructor - JavaScript
syntax new webassembly.linkerror(message, filename, linenumber) parameters message optional human-readable description of the error.
... examples creating a new linkerror instance the following snippet creates a new linkerror instance, and logs its details to the console: try { throw new webassembly.linkerror('hello', 'somefile', 10); } catch (e) { console.log(e instanceof linkerror); // true console.log(e.message); // "hello" console.log(e.name); // "linkerror" console.log(e.filename); // "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } specifications specification webassembly javasc...
WebAssembly.RuntimeError() constructor - JavaScript
syntax new webassembly.runtimeerror(message, filename, linenumber) parameters message optional human-readable description of the error.
... examples creating a new runtimeerror instance the following snippet creates a new runtimeerror instance, and logs its details to the console: try { throw new webassembly.runtimeerror('hello', 'somefile', 10); } catch (e) { console.log(e instanceof runtimeerror); // true console.log(e.message); // "hello" console.log(e.name); // "runtimeerror" console.log(e.filename); // "somefile" console.log(e.linenumber); // 10 console.log(e.columnnumber); // 0 console.log(e.stack); // returns the location where the code was run } specifications specification webassembly jav...
WebAssembly.compile() - JavaScript
examples using compile the following example compiles the loaded simple.wasm byte code using the compile() function and then sends it to a worker using postmessage().
... var worker = new worker("wasm_worker.js"); fetch('simple.wasm').then(response => response.arraybuffer() ).then(bytes => webassembly.compile(bytes) ).then(mod => worker.postmessage(mod) ); note: you'll probably want to use webassembly.compilestreaming() in most cases, as it is more efficient than compile().
Optional chaining (?.) - JavaScript
do something with the data } catch (err) { if (onerror) { // testing if onerror really exists onerror(err.message); } } } // using optional chaining with function calls function dosomething(oncontent, onerror) { try { // ...
... do something with the data } catch (err) { onerror?.(err.message); // no exception if onerror is undefined } } optional chaining with expressions you can also use the optional chaining operator when accessing properties with an expression using the bracket notation of the property accessor: let nestedprop = obj?.['prop' + 'name']; optional chaining not valid on the left-hand side of an assignment let object = {}; object?.property = 1; // uncaught syntaxerror: invalid left-hand side in assignment array item access with optional chaining let arrayitem = arr?.[42]; examples basic example this example looks for the value of the name property for the member bar in a map when there is no such member.
<merror> - MathML
WebMathMLElementmerror
the mathml <merror> element is used to display contents as error messages.
... in firefox this error message is rendered similar to the typical xml error message.
MathML documentation index - MathML
WebMathMLIndex
13 <merror> mathml, mathml reference, mathml:element, mathml:general layout schemata the mathml <merror> element is used to display contents as error messages.
... in firefox this error message is rendered similar to the typical xml error message.
Codecs used by WebRTC - Web media technologies
however, if this isn't signaled as supported in the sdp, then it's encouraged that browsers support display orientation sei messages, though not required.
...avc implementations for webrtc are required to support the special "filler payload" and "full frame freeze" sei messages; these are used to support switching among multiple input streams seamlessly.
OpenSearch description format
if the error message isn't be helpful, the following tips could help you find the problem.
... the xmlns attribute is important — without it you could get the error message "firefox could not download the search plugin".
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.
... yes, this means three more messages back and forth between each server, and the request has yet to be made.
Scripting - SVG: Scalable Vector Graphics
WebSVGScripting
function myrect(x,y,w,h,message){ this.message=message this.rect=document.createelementns("http://www.w3.org/2000/svg","rect") this.rect.setattributens(null,"x",x) this.rect.setattributens(null,"y",y) this.rect.setattributens(null,"width",w) this.rect.setattributens(null,"height",h) document.documentelement.appendchild(this.rect) this.rect.addeventlistener("click",this,false) this.handleevent= function(evt){ sw...
...itch (evt.type){ case "click": alert(this.message) break; } } } inter-document scripting: referencing embedded svg when using svg within html, adobe's svg viewer 3.0 automatically includes a window property called svgdocument that points to the svg document.
Mixed content - Web security
for example, an attacker could replace an image served over http with an inappropriate image or message to the user.
... warnings in web console the firefox web console displays a mixed content warning message in the net pane when a page on your website has this issue.
Same-origin policy - Web security
to communicate between documents from different origins, use window.postmessage.
... window the following cross-origin access to these window properties is allowed: methods window.blur window.close window.focus window.postmessage attributes window.closed read only.
XML introduction - XML: Extensible Markup Language
example <?xml version="1.0" encoding="utf-8"?> <message> <warning> hello world <!--missing </warning> --> </message> now let's look at a corrected version of that same document: <?xml version="1.0" encoding="utf-8"?> <message> <warning> hello world </warning> </message> a document that contains an undefined tag is invalid.
...please refresh and try again."> ]> <body> <message> &warning; </message> </body> you can also use numeric character references to specify special characters; for example, &#xa9; is the "©" symbol.
XSLT elements reference - XSLT: Extensible Stylesheet Language Transformations
WebXSLTElement
<xsl:apply-imports><xsl:apply-templates><xsl:attribute-set><xsl:attribute><xsl:call-template><xsl:choose><xsl:comment><xsl:copy-of><xsl:copy><xsl:decimal-format><xsl:element><xsl:fallback><xsl:for-each><xsl:if><xsl:import><xsl:include><xsl:key><xsl:message><xsl:namespace-alias><xsl:number><xsl:otherwise><xsl:output><xsl:param><xsl:preserve-space><xsl:processing-instruction><xsl:sort><xsl:strip-space><xsl:stylesheet><xsl:template><xsl:text><xsl:transform><xsl:value-of><xsl:variable><xsl:when><xsl:with-param> <xsl:apply-imports> <xsl:apply-templates> <xsl:attribute> <xsl:attribute-set> <xsl:call-template> <xsl:choose> <xsl:comment> <xsl:cop...
...y> <xsl:copy-of> <xsl:decimal-format> <xsl:element> <xsl:fallback> (not supported) <xsl:for-each> <xsl:if> <xsl:import> (mostly supported) <xsl:include> <xsl:key> <xsl:message> <xsl:namespace-alias> (not supported) <xsl:number> (partially supported) <xsl:otherwise> <xsl:output> (partially supported) <xsl:param> <xsl:preserve-space> <xsl:processing-instruction> <xsl:sort> <xsl:strip-space> <xsl:stylesheet> (partially supported) <xsl:template> <xsl:text> (partially supported) <xsl:transform> <xsl:value-of> (partially supported) <xsl:variable> <xsl:when> <xsl:with-param> ...
Navigator.mozNotification - Archive of obsolete content
method overview notification createnotification(in domstring title, in domstring description, in domstring iconurl optional); methods createnotification() creates and returns a notification object that can be used to display the specified message with an optional url.
XUL Migration Guide - Archive of obsolete content
but the sdk makes a distinction between: add-on scripts, which can use the sdk apis, but are not able to interact with web pages content scripts, which can access web pages, but do not have access to the sdk's apis content scripts and add-on scripts communicate by sending each other json messages: in fact, the ability to communicate with the add-on scripts is the only extra privilege a content script is granted over a normal remote web page script.
High-Level APIs - Archive of obsolete content
notifications display transient, toaster-style desktop messages to the user.
core/namespace - Archive of obsolete content
} widget.prototype = object.create(view.prototype); widget.prototype.postmessage = function postmessage(message) { let { sandbox } = sandboxes(this); sandbox.postmessage(json.stringify(json.parse(message))); ...
lang/functional - Archive of obsolete content
g/functional"); let setup = once(function (env) { // initializing important things console.log("successfully initialized " + env); return 1; // assume success and return 1 }); setup('dev'); // returns 1 // prints "successfully initialized dev" // future attempts to call this function just return the cached // value that was returned previously setup('production'); // returns 1 // no print message is displayed since the function isn't executed parameters fn : function the function that will be executed only once inside the once wrapper.
remote/child - Archive of obsolete content
communicating with the parent process to communicate with the parent process, the process, frames, and frame objects in sdk/remote/child have a port object that you can use to receive messages from, and send messages to, code in the parent.
cfx - Archive of obsolete content
cfx supports the following global options: -h, --help - show a help message and exit -v, --verbose - enable lots of output "command-specific options" are documented alongside the commands.
jpm-mobile - Archive of obsolete content
jpm usage is: jpm-mobile [command] [options] jpm supports the following global options: -h, --help - show a help message and exit -v, --version - print the jpm version number installation jpm-mobile is distributed using the node package manager npm, so to get jpm-mobile you need to have npm installed, if you haven't already.
package.json - Archive of obsolete content
description the add-on's description; this is a human-readable message describing what the add-on does.
Tools - Archive of obsolete content
console enables your add-on to log error, warning or informational messages.
Getting Started (jpm) - Archive of obsolete content
to build an xpi, just execute the command jpm xpi from the add-on's directory: jpm xpi you should see a message like: jpm info successfully created xpi at /path/to/my-addon/@my-addon-0.0.1.xpi to test that this worked, try installing the xpi file in your own firefox installation.
Using third-party modules (jpm) - Archive of obsolete content
click the button, and the message "clicked" is logged.
Tutorials - Archive of obsolete content
development techniques logging log messages to the console for diagnostic purposes.
HTML in XUL for rich tooltips - Archive of obsolete content
that tooltip is empty now, but we will use the mouseover event to dynamically populate the tooltip (which is about to be shown) with a different message for each menuitem.
Progress Listeners - Archive of obsolete content
}, // for definitions of the remaining functions see related documentation onprogresschange: function(awebprogress, arequest, curself, maxself, curtot, maxtot) {}, onstatuschange: function(awebprogress, arequest, astatus, amessage) {}, onsecuritychange: function(awebprogress, arequest, astate) {} } attach the progress listener to a <browser> or a <tabbrowser> element using addprogresslistener, for example for firefox put the following code in a load listener of a main window: gbrowser.addprogresslistener(mylistener); when used with a browser, the second argument is a mask which determines the type of events tha...
Enhanced Extension Installation - Archive of obsolete content
messages that appear in the extensions ui in response to user-actions such as install, uninstall, enable and disable are now driven by the extensions datasource itself and are supplied by the em:displaydescription property, rather than being supplied by the front end and several different redundant xbl bindings/style rules.
Installing Extensions and Themes From Web Pages - Archive of obsolete content
furthermore, calling updateenabled may lead to problems if your distribution site is not in the user's whitelist, because firefox only displays the "installation blocked" message when install or installchrome are called, or when a xpi file is loaded.
Listening to events in Firefox extensions - Archive of obsolete content
it is used to update the ui for many different reasons: update the progress bar and status messages as pages load turn on and off the throbber as pages load set the site icon when available update the address bar as the user navigates hide notification bars when appropriate as the user navigates apply the site zoom preferences to newly loading pages update the bookmarking star button ui update the identity display as the site's security changes tabsprogresslistener this object is a t...
Chapter 4: Using XPCOM—Implementing advanced processes - Archive of obsolete content
an xpconnect-wrapped nsiioservice message should appear.
Connecting to Remote Content - Archive of obsolete content
make sure you're not telling users everything is ok, or worse, bombarding them with error messages.
Getting Started with Firefox Extensions - Archive of obsolete content
if you open the menu and then the menu item below, you'll see a nice alert message (for some definitions of 'nice').
The Box Model - Archive of obsolete content
here's a typical usage of the label element: <label control="xulschoolhello-greeting-textbox" value="&xulschoolhello.typegreeting.label;" /> <textbox id="xulschoolhello-greeting-textbox" /> the label says something like "type a greeting message", and the textbox next to it allows the user to type the message.
Extensions support in SeaMonkey 2 - Archive of obsolete content
thing insertbefore="status-bar" /> </vbox> use the following technique to make your overlay work on both seamonkey 2 and firefox 3: <window id="main-window"> <vbox id="browser-bottombox" insertbefore="status-bar"> <something insertbefore="status-bar" /> </vbox> </window> thunderbird 3 gfolderdisplay api seamonkey 2.0 only supports a reduced set of methods: selectedcount selectedmessage selectedmessageisfeed selectedmessageisimap selectedmessageisnews selectedmessageisexternal selectedindices selectedmessages selectedmessageuris messagedisplay gmessagedisplay api seamonkey 2.0 only supports a reduced set of methods: displayedmessage visible javascript tweaks firefox supports some shorthand in various places.
Setting up an extension development environment - Archive of obsolete content
(note that the extension manager automatically restarts the application at startup sometimes, which may mean you won't have time to see the messages logged before the automatic restart happens.
Firefox addons developer guide - Archive of obsolete content
rules: file and directory names: italic method and variable names: class name if you want to add a fixme, add: fixme: a message notes: the original document is in japanese and distributed via the xuldev.org website.
An Interview With Douglas Bowman of Wired News - Archive of obsolete content
as many times as i heard the message that design of content should be addressable separately from the content itself, i don't think i realized the full benefits of doing so until we actually went through the process of separating them.
Creating a status bar extension - Archive of obsolete content
we include properties to configure our new status bar panel the way we want, setting its text label to "hello world" and establishing a tool tip with the message "sample status bar item" in it.
JXON - Archive of obsolete content
it is very practical for internal javascript access, but don't use it if you want to transfer the tree via json string (as for worker messages, for example).
MMgc - Archive of obsolete content
(the second switch will slow your application down a lot more than the first switch, so you could try the first, then the second.) when a missing write barrier is detected, mmgc will assert and drop you into the debugger, and will print out a message telling you which object contained the missing write barrier, the address of the member variable that needs it, and what object didn't get marked due to the missing write barrier.
Defining Cross-Browser Tooltips - Archive of obsolete content
for instance, visual browsers frequently display the title as a "tool tip" (a short message that appears when the pointing device pauses over an object).
Images, Tables, and Mysterious Gaps - Archive of obsolete content
however, these techniques may be relevant when the developer cannot assume that users have a modern browser, such as for html-based e-mail messages.
Locked config settings - Archive of obsolete content
if you suspect syntax errors in your config file, you can display the exact error message by enclosing your code in a try-catch block: try { ...
Other Mozilla customization pages - Archive of obsolete content
at the moment all messages of the program are in german language.
Getting Started - Archive of obsolete content
my_theme.jar!/global/* /chrome/my_theme.jar!/help/* /chrome/my_theme.jar!/messenger/* /chrome/my_theme.jar!/messenger-newsblog/* /chrome/my_theme.jar!/mozapps/* /chrome/my_theme.jar!/navigator/* /chrome.manifest /install.rdf /icon.png /preview.png make sure not to just zip up the my_theme parent directory since that will cause the drag and drop install in the next section to fail without error messages.
Creating a Microsummary - Archive of obsolete content
('http://people.mozilla.com/~myk/microsummaries/tutorial/sfx-generator.xml')">install the spread firefox home page microsummary!</button> clicking that button will generate a javascript error on browsers that don't support microsummaries, however, so to improve the experience for those users, we should check to see if the user is using a microsummaries-enabled browser and display an explanatory message if not.
FAQ - Archive of obsolete content
if a message appears in the preferences window telling you that it's an old skin, you're going to have to look over the code to see what changed.
Getting Started - Archive of obsolete content
if you have the wrong number here, after you install the skin and select it in the list, it will give you a message saying that it's out of date.
Creating a Skin for Firefox/Getting Started - Archive of obsolete content
you need to do is repackage a jar file with the following directory structure, using your favorite archive manager to create a zip archive: /browser/* /communicator/* /global/* /help/* /mozapps/* /contents.rdf /install.rdf /icon.png /preview.png make sure not to just zip up the my_theme parent directory since that will cause the drag and drop install in the next section to fail without error messages.
Dehydra Object Reference - Archive of obsolete content
location objects location objects are passed to builtin functions such as warning() and error() to specify the location of the message.
Extension Frequently Asked Questions - Archive of obsolete content
before asking for help, be sure to set the debugging prefs and check the error console for related messages.
JavaScript Client API - Archive of obsolete content
, "foo"); } fooengine.prototype = { __proto__: weave.syncengine.prototype, _recordobj: foorecord, _storeobj: foostore, _trackerobj: footracker }; as you can see, there isn't actually any new code here at all; the prototype simply defines some metadata such as the store and tracker classes to use, and the human-readable name that will be used in the log files to identify errors and status messages coming from this engine.
Hidden prefs - Archive of obsolete content
for example: when that mail gets sent, approved: test@test.com will be in the message in the headers.
CRMF Request object - Archive of obsolete content
rfc 4211, the internet x.509 public key infrastructure certificate request message format (crmf), defines a certreqmessage.
generateCRMFRequest() - Archive of obsolete content
the string found by accessing crmfobject.request is the base-64 encoded crmf message to be sent to the ca/ra, or an error string.
importUserCertificates - Archive of obsolete content
strings will be returned: error string description "error:usercancel" the user canceled the import operation "error:invalidcertificate" one of the certificate packages was incorrectly formatted "error:internalerror" the software encountered some internal error, such as out of memory "error:invalidrequestid" the request id in the response message does not match any outstanding request ...
Menu - Archive of obsolete content
ArchiveMozillaJetpackUIMenu
leave a comment on that bug or send a message to the mailing list.
Notifications - Archive of obsolete content
titlethe head of the notification message.string bodythe message itself.stringfalse iconthe url of an .ico file.string jetpack.notifications.show("hello world"); var mybody = " my first message body on jetpack"; var myicon = "http://www.mozilla.com/favicon.ico"; jetpack.notifications.show({title: "my first message on jetpack", body: mybody, icon: myicon}); ...
Mozilla Application Framework in Detail - Archive of obsolete content
it is a development environment that provides the following features for the cross-platform software developer: component management file abstraction object message passing memory management this component object model makes virtually all of the functionality of gecko available as a series of components, or reusable cross-platform libraries, that can be accessed from the browser or scripted from any mozilla application.
Plug-n-Hack Phase1 - Archive of obsolete content
the user can be given a message to this effect.
Porting NSPR to Unix Platforms - Archive of obsolete content
some of them respond to the <tt>-h</tt> command line option and print a usage message.
Configuration - Archive of obsolete content
status turns the status messages on or off for this web app: yes or no location turns the readonly location bar on or off for this web app: yes or no navigation turns the hotkey history navigation (alt+left, alt+right and alt+home) on or off for this web app: yes or no splashscreen filename of an html page to be displayed while the app is loading.
HostWindow - Archive of obsolete content
status - area of the statusbar that displays the loading status message and a "percent complete" progress bar, as well as the "gear" menu that provides access to prism commands such as displaying the error console.
The new nsString class implementation (1999) - Archive of obsolete content
if you happen to see dbaron lying around somewhere, please direct him here so he can fix this message.
Using Breakpoints in Venkman - Archive of obsolete content
when used with the continue regardless of result option, the breakpoint can be used as a simple log message.
Mozilla Web Developer Community - Archive of obsolete content
the list of old devedge feeds is at http://devedge-temp.mozilla.org/comm.../feedlist.html feedback hendrix mdnproduct feedback bugzilla - report a bug in a mozilla product for questions related to this website (but not technical questions), please send your message to the mdc mailing list.
Creating XPI Installer Modules - Archive of obsolete content
the archive, named barley.xpi, should contain the following two files: barley.jar install.js this zip file, when opened from mozilla using file -> open, will initialize its own installation and display a message like the following: when you click ok, mozilla installs the new package.
Using XPInstall to Install Plugins - Archive of obsolete content
this includes instructions on where to install the software, and what messages to feed to the user.
A XUL Bestiary - Archive of obsolete content
events are messages that are sent from an object when that object performs some action.
cycler - Archive of obsolete content
this is used, for example, in a mail window, for a column that indicates that the message is read or unread with a small mark in the cell.
id - Archive of obsolete content
ArchiveMozillaXULAttributeid
'); } </script> a more abstract version of the above would be a <button id="foo" label="click me" oncommand="setwidgetlabel(this, 'i was pressed')"/> <script> function setwidgetlabel(idname, newcaption){ document.getelementbyid( idname.id ).setattribute('label',newcaption) } </script> not specifying the id attribute for a window or a prefwindow fills the console with the following warning message: warning: empty string passed to getelementbyid() see also name ...
reserved - Archive of obsolete content
ommand id="cmd_newnavigator" oncommand="openbrowserwindow()" reserved="true"/> if the keyboard shortcut for that is accel-t, then this code will not work as expected, as compared to when it is run from web content: document.addeventlistener("keydown", handlekey, true); function handlekey(event) { // listen for the "new tab" shortcut if (event.metakey && (event.key == "t")) { // log a message console.log("intercepted accel-t"); // prevent the default browser action event.preventdefault(); event.stoppropagation(); } } currently, this event handler as coded above runs and logs the message, but the default behavior persists.
removeAllNotifications - Archive of obsolete content
if immediate is true, the messages are removed immediately.
Menus - Archive of obsolete content
here, it just displays an alert message.
selstyle - Archive of obsolete content
to see the difference, compare the selection style in the folder list and the message list in mozilla mail.
Notes - Archive of obsolete content
implementing an nsicommandlinehandler on windows may trigger a bug that causes an error message ("windows cannot find the file specified") to be displayed when opening external links (like from a shortcut or from an external application).
Style classes - Archive of obsolete content
ArchiveMozillaXULStyle
« xul reference home alert-icon chromeclass-toolbar error-icon groove header indent listcell-iconic listitem-iconic menuitem-iconic menuitem-non-iconic message-icon monospace plain question-icon small-margin statusbarpanel-iconic statusbarpanel-iconic-text statusbarpanel-menu-iconic text-link thin tree-splitter treecol-image ...
Building Trees - Archive of obsolete content
here is an example of a tree using an sqlite datasource: <tree datasources="profile:messages.sqlite" ref="*" querytype="storage" flags="dont-build-content"> <treecols> <treecol id="subject" label="subject" flex="3"/> <treecol id="sender" label="sender" flex="2"/> <treecol id="date" label="date" flex="1"/> </treecols> <template> <query> select subject, sender, date from messages </query> <action> <treechildren> <treeitem uri="?"> ...
The Joy of XUL - Archive of obsolete content
to install a new application the user need only click a hypertext link on a web page or in an email message and accept the new package through a mozilla install dialog.
Creating toolbar buttons (Customize Toolbar Window) - Archive of obsolete content
main window and view message window).
Additional Install Features - Archive of obsolete content
you may also want to display an error message to the user.
Manifest Files - Archive of obsolete content
the error message "xml parsing error: undefined entity" in your xul file can be caused by an error in the manifest or in the jar file referenced by the manifest.
Modifying a XUL Interface - Archive of obsolete content
note: if you're creating the checkbox dynamically and it's not yet added to the dom, you must use setattribute("checked", "false") instead, because the xbl isn't initiated yet.) example 6 : source view <button label="change" oncommand="this.nextsibling.checked = !this.nextsibling.checked;"/> <checkbox label="check for messages"/> radio buttons may be selected as well using properties, however since only one in a group may be selected at a time, the others must all be unchecked when one is checked.
More Menu Features - Archive of obsolete content
the example below creates a simple submenu inside the file menu example 1 : source view <toolbox flex="1"> <menubar id="sample-menubar"> <menu id="file-menu" label="file"> <menupopup id="file-popup"> <menu id="new-menu" label="new"> <menupopup id="new-popup"> <menuitem label="window"/> <menuitem label="message"/> </menupopup> </menu> <menuitem label="open"/> <menuitem label="save"/> <menuseparator/> <menuitem label="exit"/> </menupopup> </menu> </menubar> </toolbox> adding a menu to our find files example let's add a menu to the find files dialog.
Styling a Tree - Archive of obsolete content
set the property on a row or cell, as in the following example: <treerow properties="makeitblue"> css selectors for the tree the style sheet can take this property and use it to change the appearance of the row for unread messages or labels.
Templates - Archive of obsolete content
numerous datasources are provided with mozilla such as bookmarks, history and mail messages.
XUL Structure - Archive of obsolete content
for example, the messenger component has descriptions of the mail messages list window, the composition window and the address book dialogs.
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 '** ' + file + ' **' data = open(file).read() p.feed(data) w.write('<html><h3>periodic table of xul elements</h3>') w.write('<table><style>.head {font-weight: bold; background-color: l...
browser - Archive of obsolete content
ibutes autocompleteenabled, autocompletepopup, autoscroll, disablehistory, disableglobalhistory, disablesecurity, droppedlinkhandler, homepage, showcaret, src, type properties accessibletype, cangoback, cangoforward, contentdocument, contentprincipal, contenttitle, contentvieweredit, contentviewerfile, contentwindow, currenturi, docshell, documentcharsetinfo, homepage, markupdocumentviewer, messagemanager, preferences, securityui, sessionhistory, webbrowserfind, webnavigation, webprogress methods addprogresslistener, goback, goforward, gohome, gotoindex, loaduri, loaduriwithflags, reload, reloadwithflags, removeprogresslistener, stop, swapdocshells examples <!-- shows mozilla homepage inside a groupbox --> <groupbox flex="1"> <caption label="mozilla homepage"/> <browser type="...
description - Archive of obsolete content
</description> this is a long section of text that will not word wrap <description value="this is a long section of text that will not word wrap"> </description> this is a long section of dynamically controlled text that will word wrap <description id="desc" style="width: 300px"></description> document.getelementbyid('desc').textcontent = "this is a long section of dynamic message text that will word wrap"; attributes crop type: one of the values below if the label of the element is too big to fit in its given space, the text will be cropped on the side specified by the crop attribute.
notification - Archive of obsolete content
« xul reference home [ examples | attributes | properties | methods | related ] the notification is used to display an informative message.
notificationbox - Archive of obsolete content
if immediate is true, the messages are removed immediately.
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 panel by clicking and dragging anywhere on its background area.
<statusbarpanel> - Archive of obsolete content
this element is often used with a short label or icon to indicate status, for instance whether the user is online or whether there are new messages.
stringbundle - Archive of obsolete content
for example, the following defines two properties: message.displayerror=an error occured trying to display this message message.namealreadyused=the name %s is already being used by another account.
tree - Archive of obsolete content
ArchiveMozillaXULtree
to see the difference, compare the selection style in the folder list and the message list in mozilla mail.
treecol - Archive of obsolete content
this is used, for example, in a mail window, for a column that indicates that the message is read or unread with a small mark in the cell.
Building XULRunner with Python - Archive of obsolete content
.getservice(components.interfaces.nsiwindowwatcher); wwatch.openwindow(null, "chrome://global/content/console.xul", "_blank", "chrome,dialog=no,all", null); } // dump to the js console (xulrunner -jsconsole) function jsdump(str) { components.classes['@mozilla.org/consoleservice;1'] .getservice(components.interfaces.nsiconsoleservice) .logstringmessage(str); } function jserror(str) { components.utils.reporterror(str); } a final tip is to use task manager to check for a zombie xulrunner process after a crash.
Creating a Windows Inno Setup installer for XULRunner applications - Archive of obsolete content
_started_with_xulrunner appsupporturl=http://developer.mozilla.org/en/docs/getting_started_with_xulrunner appupdatesurl=http://developer.mozilla.org/en/docs/getting_started_with_xulrunner defaultdirname={pf}\my app defaultgroupname=my app allownoicons=yes outputdir=..\build\output outputbasefilename=myapp-1.0-win32 ; setupiconfile= compression=lzma solidcompression=yes [languages] name: english; messagesfile: compiler:default.isl [components] name: main; description: my app; types: full compact custom; flags: fixed name: runtime; description: xul runner runtime; types: full custom [tasks] name: desktopicon; description: {cm:createdesktopicon}; groupdescription: {cm:additionalicons}; flags: unchecked name: quicklaunchicon; description: {cm:createquicklaunchicon}; groupdescription: {cm:additiona...
Getting started with XULRunner - Archive of obsolete content
lication: /library/frameworks/xul.framework/xulrunner-bin "/applications/finkle/testapp.app/contents/resources/application.ini" you may run it without installing (but with the menu bar and dock icon missing) in os x by typing: /library/frameworks/xul.framework/xulrunner-bin "/<full path>/testapp/application.ini" note: the full path is required or a "error: couldn't parse application.ini."-message will be returned.
MacFAQ - Archive of obsolete content
dth height sizemode" > <!-- load the mozilla helpers --> <script type="application/javascript" src="chrome://global/content/nsusersettings.js" /> <script><![cdata[ function debug(alogstring) { var mconsoleservice = components.classes["@mozilla.org/consoleservice;1"] .getservice(components.interfaces.nsiconsoleservice) mconsoleservice.logstringmessage("myxul: " + alogstring + "\n"); } function checkotherwindows() { var singletonwindowtype = nspreferences.copyunicharpref("toolkit.singletonwindowtype"); var windowmediator = components.classes["@mozilla.org/appshell/window-mediator;1"] .getservice(components.interfaces.nsiwindowmediator); var win = windowmediator.getmostrecentwindow(singleto...
Archived Mozilla and build documentation - Archive of obsolete content
it reports javascript-related errors and warnings, css errors and arbitrary messages from chrome code.
2006-10-06 - Archive of obsolete content
brian king also mentions that documentation on handling message headers on the ui side would be helpful.
2006-10-13 - Archive of obsolete content
discussions shared training.dat & message filters jon-mikel is looking for suggestions on sharing spam filter data and message filters between machines easily.
2006-11-03 - Archive of obsolete content
suggestion made for e-mail popup it suggested that the e-mail popup duration should depends on number of messages and examples of this idea is provided.
2006-11-17 - Archive of obsolete content
solution is provided by jay lee should there be an additional options for account configuration that just delete the messages from the server whenever they are deleted in tb?
2006-11-03 - Archive of obsolete content
he also noted that he has had different results (error messages when compiling) on different machines.
2006-10-27 - Archive of obsolete content
problem with belarusian firefox 2 rc3 the broken message is displayed after user tries to visit non-existing site.
NPN_GetValue - Archive of obsolete content
this transparent child window can have its own windowproc within which the plug-in can deal with wm_command messages sent to it a result of tracking the popup menu or modal dialog.
NPN_SetValue - Archive of obsolete content
the alternative is windowless where no window messages are sent to the plugin as there is no window associated with it.
NPN_Write - Archive of obsolete content
npstream* stream; char* mydata = "<html><b>this is a message from my plug-in!</b></html>"; int32 mylength = strlen(mydata) + 1; /* create the stream.
NPAPI plugin reference - Archive of obsolete content
(while the api theoretically allows the preferred proxy for a given url to be changed, doing so does not have much meaning given how proxies are configured, and is not supported.) npn_status lets a plug-in display a message on the browser's status line.
Digital Signatures - Archive of obsolete content
tamper detection and related authentication techniques rely on a mathematical function called a one-way hash (also called a message digest).
Threats - Archive of obsolete content
the attacks often comes in form of instant messages or phishing emails which appear to be legitimate but they are used to obtain personal information.
Building a Theme - Archive of obsolete content
if you get a message that the install.rdf is malformed, it is helpful to load it into firefox using the file->open file command and it will report xml errors to you.
Updating an extension to support multiple Mozilla applications - Archive of obsolete content
we need to add lines to the manifest for thunderbird and sunbird, like this: # thunderbird overlay chrome://messenger/content/messenger.xul chrome://stockwatcher2/content/stockwatcher2.xul # sunbird overlay chrome://calendar/content/calendar.xul chrome://stockwatcher2/content/stockwatcher2.xul these lines cause the main thunderbird message list window and the main window in sunbird to be the target of the overlays we apply in the stockwatcher2.xul file.
Browser Detection and Cross Browser Support - Archive of obsolete content
you can do this by providing an error message for users of older browsers as well as alternative content contained in noscript tags.
Browser Feature Detection - Archive of obsolete content
ures.length; i++) { if (features[i].supported) document.write('<tr><td>' + features[i].name + '<\/td><td>' + features[i].supported + '<\/td><\/tr>'); else document.write('<tr><td>' + features[i].name + '<\/td><td style="background-color:red">' + features[i].supported + '<\/td><\/tr>'); } document.write('<\/table>'); } var oldonerror = window.onerror; // suppress error messages...
E4X for templating - Archive of obsolete content
urn s.replace(/"/g, '&quot;').replace(/'/g, '&apos;'); } if (typeof s === 'xml') { return s.tostring().replace(/"/g, '&quot;').replace(/'/g, '&apos;'); } return string(s).replace(/"/g, '&quot;').replace(/'/g, '&apos;'); } localization e4x works nicely with a simple utility for localizing strings of a properties file: // localization function $s(msg, args){ //get localized message var strs = cc['@mozilla.org/intl/stringbundle;1'].getservice(ci.nsistringbundleservice).
XForms Custom Controls - Archive of obsolete content
the following list shows where the base bindings for our xforms controls are defined: xforms.xml - contains the base bindings for output, label, trigger, submit, case, message, hint, help, alert, upload and repeat xforms controls.
Requests For Enhancement - Archive of obsolete content
ArchiveWebXFormsRFE
you can do so by posting a message on the xforms newsgroup or file a new bug in the 'xforms' component of the 'core' product.
XForms Config Variables - Archive of obsolete content
preference default description xforms.disablepopup false disables xforms engine popup error messages xforms.enableexperimentalfeatures false enable experimental features.
The Business Benefits of Web Standards - Archive of obsolete content
the message to accountants, executives and shareholders alike should be irresistible.
Game promotion - Game development
there are two options to get coverage from the youtubers: first is you contact them directly and send a link to your game via email or private message.
Desktop mouse and keyboard controls - Game development
em all to everyone, we can detect whether the game is launched on desktop or mobile and just show the appropriate controls for the device: if(this.game.device.desktop) { movetext = 'arrow keys or wasd to move'; shoottext = 'x or space to shoot'; } else { movetext = 'tap and hold to move'; shoottext = 'tap to shoot'; } if the game is running on desktop the cursor and w a s d keys message will be shown — if not, then the mobile touch controls message will be.
Game over - Game development
for now we'll keep it simple, showing an alert message and restarting the game by reloading the page.
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.
2D maze game with device orientation - Game development
ettext("level: "+this.level+" / "+this.maxlevels); this.ball.body.x = this.ballstartpos.x; this.ball.body.y = this.ballstartpos.y; this.ball.body.velocity.x = 0; this.ball.body.velocity.y = 0; this.showlevel(); } }, if the current level is equal to the maximum number of levels (in this case 5), then the game is finished — you'll get a congratulations message along with the number of seconds elapsed through the whole game, and a button to press that takes you to the main menu.
Ciphertext - MDN Web Docs Glossary: Definitions of Web-related terms
in cryptography, a ciphertext is a scrambled message that conveys information but is not legible unless decrypted with the right cipher and the right secret (usually a key), reproducing the original cleartext.
DTLS (Datagram Transport Layer Security) - MDN Web Docs Glossary: Definitions of Web-related terms
as a datagram protocol, dtls doesn't guarantee the order of message delivery, or even that messages will be delivered at all.
Decryption - MDN Web Docs Glossary: Definitions of Web-related terms
decryption is a cryptographic primitive: it transforms a ciphertext message into plaintext using a cryptographic algorithm called a cipher.
Encryption - MDN Web Docs Glossary: Definitions of Web-related terms
encryption is a cryptographic primitive: it transforms a plaintext message into a ciphertext using a cryptographic algorithm called a cipher.
Entity header - MDN Web Docs Glossary: Definitions of Web-related terms
an entity header is an http header that can be used in an http request or response, and describes the content of the body of themessage.
General header - MDN Web Docs Glossary: Definitions of Web-related terms
a general header is an http header that can be used in both request and response messages but doesn't apply to the content itself.
HMAC - MDN Web Docs Glossary: Definitions of Web-related terms
hmac is a protocol used for cryptographically authenticating messages.
IMAP - MDN Web Docs Glossary: Definitions of Web-related terms
imap (internet message access protocol) is a protocol used to retrieve and store emails.
NNTP - MDN Web Docs Glossary: Definitions of Web-related terms
nntp (network news transfer protocol) is a protocol used to transfer usenet messages from client to server or between servers.
POP3 - MDN Web Docs Glossary: Definitions of Web-related terms
clients usually retrieve all messages and then delete them from the server, but pop3 does allow retaining a copy on the server.
Placeholder names - MDN Web Docs Glossary: Definitions of Web-related terms
placeholder names are commonly used in cryptography to indicate the participants in a conversation, without resorting to terminology such as "party a," "eavesdropper," and "malicious attacker." the most commonly used names are: alice and bob, two parties who want to send messages to each other, occasionally joined by carol, a third participant eve, a passive attacker who is eavesdropping on alice and bob's conversation mallory, an active attacker ("man-in-the-middle") who is able to modify their conversation and replay old messages ...
SCTP - MDN Web Docs Glossary: Definitions of Web-related terms
sctp (stream control transmission protocol) is an ietf standard for a transport protocol which enables the reliable, in-order transmission of messages while offering congestion control, multi-homing, and other features to improve reliability and stability of the connection.
SDP - MDN Web Docs Glossary: Definitions of Web-related terms
here is a typical sdp message: v=0 o=alice 2890844526 2890844526 in ip4 host.anywhere.com s= c=in ip4 host.anywhere.com t=0 0 m=audio 49170 rtp/avp 0 a=rtpmap:0 pcmu/8000 m=video 51372 rtp/avp 31 a=rtpmap:31 h261/90000 m=video 53000 rtp/avp 32 a=rtpmap:32 mpv/90000 sdp is never used alone, but by protocols like rtp and rtsp.
Server - MDN Web Docs Glossary: Definitions of Web-related terms
a client program and server program traditionally connect by passing messages encoded using a protocol over an api.
Signature - MDN Web Docs Glossary: Definitions of Web-related terms
signature (security) a signature, or digital signature, is a protocol showing that a message is authentic.
Symmetric-key cryptography - MDN Web Docs Glossary: Definitions of Web-related terms
block ciphers are always used with a mode, which specifies how to securely encrypt messages that are longer than the block size.
Synchronous - MDN Web Docs Glossary: Definitions of Web-related terms
synchronous refers to real-time communication where each party receives (and if necessary, processes and replies to) messages instantly (or as near to instantly as possible).
TCP slow start - MDN Web Docs Glossary: Definitions of Web-related terms
congestion control congestion itself is a state that happens within a network layer when the message traffic is too busy it slows the network response time.
Transport Layer Security (TLS) - MDN Web Docs Glossary: Definitions of Web-related terms
when a server and client communicate using tls, it ensures that no third party can eavesdrop or tamper with any message.
VoIP - MDN Web Docs Glossary: Definitions of Web-related terms
voip (voice over internet protocol) is a technology used to transmit voice messages over ip (internet protocol) networks.
Challenge-response authentication - MDN Web Docs Glossary: Definitions of Web-related terms
challenge-response protocols are one way to fight against replay attacks where an attacker listens to the previous messages and resends them at a later time to get the same credentials as the original message.
Percent-encoding - MDN Web Docs Glossary: Definitions of Web-related terms
'!' '$' '&' "'" '(' ')' '*' '+' ',' ';' '=' '%' ' ' %3a %2f %3f %23 %5b %5d %40 %21 %24 %26 %27 %28 %29 %2a %2b %2c %3b %3d %25 %20 or + depending on the context, the character ' ' is translated to a '+' (like in the percent-encoding version used in an application/x-www-form-urlencoded message), or in '%20' like on urls.
What is accessibility? - Learn web development
ions, such as unnecessary content or advertisements; consistent webpage layout and navigation; familiar elements, such as underlined links blue when not visited and purple when visited; dividing processes into logical, essential steps with progress indicators; website authentication as easy as possible without compromising security; and making forms easy to complete, such as with clear error messages and simple error recovery.
Debugging CSS - Learn web development
take a step back from the problem any coding problem can be frustrating, especially css problems because you often don't get an error message to search for online to help with finding a solution.
Images, media, and form elements - Learn web development
if the user enters something unexpected, or leaves a required field blank, the browser can show an error message.
How do you make sure your website works properly? - Learn web development
http statuses servers respond with a status message whenever they receive a request.
How do I use GitHub Pages? - Learn web development
then, you need to enter the following commands (pressing enter after each one) to push those changes to github: git add --all git commit -m 'another commit' git push you can replace another commit with a more suitable message to describe what change you just made.
The HTML5 input types - Learn web development
to implement different validation behavior, you can use the pattern attribute, and you can also custom the error messages; we'll talk how to use these features in the client-side form validation article later on.
Example - Learn web development
a simple form html content <form action="/my-handling-form-page" method="post"> <div> <label for="name">name:</label> <input type="text" id="name" name="user_name"> </div> <div> <label for="mail">e-mail:</label> <input type="email" id="mail" name="user_email"> </div> <div> <label for="msg">message:</label> <textarea id="msg" name="user_message"></textarea> </div> <div class="button"> <button type="submit">send your message</button> </div> </form> css content form { /* just to center the form on the page */ margin: 0 auto; width: 400px; /* to see the limits of the form */ padding: 1em; border: 1px solid #ccc; border-radius: 1em; } div + div { margin-top: 1em...
The web and web standards - Learn web development
"sure thing web browser — here you go" [downloads files and renders web page] the actual syntax for http messages (called requests and responses) is not that human-readable, but this gives you the basic idea.
Use JavaScript within a webpage - Learn web development
at a minimum, leave a short message with <noscript> like this: <noscript>to use this site, please enable javascript.</noscript> ideally, replicate the javascript functionality with html and server-side scripting when possible.
Use HTML to solve common problems - Learn web development
LearnHTMLHowto
how to create a basic html document how to divide a webpage into logical sections how to set up a proper structure of headings and paragraphs basic text-level semantics html specializes in providing semantic information for a document, so html answers many questions you might have about how to get your message across best in your document.
From object to iframe — other embedding technologies - Learn web development
a quick example first though — try loading the previous example we showed above into your browser — you can find it live on github (see the source code too.) you won't actually see anything displayed on the page, and if you look at the console in the browser developer tools, you'll see a message telling you why.
Index - Learn web development
312 client-side form validation beginner, example, forms, guide, html, javascript, learn, web, regex client-side form validation sometimes requires javascript if you want to customize styling and error messages, but it always requires you to think carefully about the user.
Making decisions in your code — conditionals - Learn web development
smith.'; here we have a variable called isbirthday — if this is true, we give our guest a happy birthday message; if not, we give her the standard daily greeting.
Drawing graphics - Learn web development
boo hoo!</p> </canvas> of course, the above message is really unhelpful!
Basic math in JavaScript — numbers and operators - Learn web development
for example, booleans can be used to: display the correct text label on a button depending on whether a feature is turned on or off display a game over message if a game is over or a victory message if the game has been won display the correct seasonal greeting depending what holiday season it is zoom a map in or out depending on what zoom level is selected we'll look at how to code such logic when we look at conditional statements in a future article.
Solve common problems in your JavaScript code - Learn web development
in fact, some browsers (like firefox) will give you an error message in the developer console if you have code after a return statement.
JavaScript object basics - Learn web development
note: it is useful to think about the way objects communicate as message passing — when an object needs another object to perform some kind of action often it sends a message to another object via one of its methods, and waits for a response, which we know as a return value.
Object prototypes - Learn web development
bye for now!'); }; save the code and load the page in the browser, and try entering the following into the text input: person1.farewell(); you should get an alert message displayed, featuring the person's name as defined inside the constructor.
Aprender y obtener ayuda - Learn web development
run code after several promises are fulfilled play a video stream from a webcam in the browser create a linear gradient in the background of your element error messages if you are having a problem with some code and a specific error message is coming up, it is often a good idea to just copy the error message into your search engine and use it as the search term.
Ember interactivity: Events, classes and state - Learn web development
coming back to our browser tab with the app running, we can type whatever we want, and when we hit enter we'll be greeted with an alert message telling us exactly what we typed.
Ember app structure and componentization - Learn web development
this already exists, and its contents currently look like so: {{!-- the following component displays ember's default welcome message.
Accessibility in React - Learn web development
you should see both messages in your console, with each one repeating three times.
Getting started with React - Learn web development
if you have both package managers installed and explicitly want to use npm, you can add the flag --use-npm when you run create-react-app: npx create-react-app moz-todo-react --use-npm create-react-app will display a number of messages in your terminal while it works; this is normal!
React resources - Learn web development
react devtools we used console.log() to check on the state and props of our application in this tutorial, and you'll also have seen some of the useful warnings and error message that react gives you both in the cli and your browser's javascript console.
Starting our Svelte Todo list app - Learn web development
the console should currently give you a message along the lines of "<app> was created with unknown prop 'name'".
Deployment and next steps - Learn web development
after creating a new repo gitlab will greet you with a message explaining different options to upload your existing files.
Getting started with Svelte - Learn web development
so far it just renders the 'hello world!' message.
Getting started with Vue - Learn web development
right now, it should contain a welcome message, a link to the vue documentation, links to the plugins you added when you initialized the app with your cli, and some other useful links to the vue community and ecosystem.
Handling common accessibility problems - Learn web development
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 (other form elements have different controls, for example the <select> element can have its options displayed and cycled between using the up and down arrow keys).
Introduction to automated testing - Learn web development
inside this file, put the following: const gulp = require('gulp'); gulp.task('default', function() { console.log('gulp running'); }); this requires the gulp module we installed earlier, and then runs a basic task that does nothing except for printing a message to the terminal — this is useful for letting us know that gulp is working.
Deploying our app - Learn web development
now all the code is staged, we can commit; run the following command: git commit -m ’committing initial code’ note: although you're free to write whatever you wish in the commit message, there's some useful tips around the web on good commit messages.
Mozilla Plugin Accessibility
seamonkey has no message bar for plugin installation the message bar will be ported to seamonkey as part of the toolkit merging work that will occur for xulrunner.
Creating a Login Manager storage module
getservice(ci.nsiconsoleservice); return this.__logservice; }, log: function (message) { dump("sampleloginmanager: " + message + "\n"); this._logservice.logstringmessage("sampleloginmanager: " + message); }, // logs function name and arguments for debugging stub: function(arguments) { var args = []; for (let i = 0; i < arguments.length; i++) args.push(arguments[i]) this.log("called " + arguments.callee.name + "(" + args.join(",") + ")"); }, ini...
Debugging Table Reflow
it can be invoked by set gecko_block_debug_flags=reflow the available options are: reflow really-noisy-reflow max-element-size space-manager verify-lines damage-repair lame-paint-metrics lame-reflow-metrics disable-resize-opt these options can be combined with a comma separated list messages generated by the reflow switch: block(div)(1)@00be5ac4: reflowing dirty lines computedwidth=9000 computedheight=1500 this message is generated inside of nsresult nsblockframe::reflowdirtylines(nsblockreflowstate& astate) it first shows the block id and address and then the computed width and height from the htmlreflowstate.
Debugging on Windows
console debugging when printing to stdout from a content process, the console message will not appear on windows.
Simple SeaMonkey build
(if you get a message saying this application did not install properly then you should see a windows dialog giving you the option to re-install with the 'correct settings'.
Simple Sunbird build
(if you get a message saying this application did not install properly then you should see a windows dialog giving you the option to re-install with the 'correct settings'.
Updating NSPR or NSS in mozilla-central
in your commit message, include the required keywords, upgrade_nspr_release and/or upgrade_nss_release.
Contributing to the Mozilla code base
when you commit your code, please use the following format for your commit message: `bug number - what your patch does; r?reviewer` for example, a commit message may look like `bug 1234567 - remove reflow by caching element size.
Error codes returned by Mozilla APIs
_no_dom_node_specified (0x80640002) ns_error_schemavalidator_no_type_found (0x80640003) ns_error_schemavalidator_type_not_found (0x80640004) note: there are other errors in these files: gfx/public/nsidevicecontext.h base/public/nsneterror.h parser/htmlparser/public/nsiparser.h layout/base/nslayouterrors.h profile/public/nsiprofileinternal.idl security/manager/ssl/public/nsicmsmessageerrors.idl directory/xpcom/base/public/nsildaperrors.idl content/base/public/nscontenterrors.h see also mozilla error lookup lets you quickly look up the error name by its code in different formats.
Experimental features in Firefox
this also changes the console warning; if the upgrade succeeds, the message indicates that the request was upgraded, instead of showing a warning.
Blocked: Custom cookie permission
message firefox: cookieblockedbypermission=request to access cookies or storage on “x” was blocked because of custom cookie permission.
Partitioned: All third-party storage access requests
message firefox: cookiepartitionedforeign=partitioned cookie or storage access was provided to “<url>” because it is loaded in the third-party context and storage partitioning is enabled.
Tracking Protection
when firefox blocks content, it logs a message to the web console like this: the resource at "http://some/url" was blocked because tracking protection is enabled.
Firefox and the "about" protocol
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 pol...
Using the Browser API
MozillaGeckoChromeAPIBrowser APIUsing
to react to search changes in a more precise way if desired: //browser.addeventlistener('mozbrowserfindchange', function(e) { // can react to find changes if required //}) reporting errors we've got one more piece of code to mention from our source: browser.addeventlistener('mozbrowsererror', function (e) { console.log("loading error: " + e.detail); }); this simple listener logs an error message to the console when an error with the browser iframe is encountered.
mozbrowseractivitydone
the mozbrowseractivitydone event is fired when something inside the browser <iframe> triggers a web activity, and that web activity's message is consumed by the receiving app.
Browser API
the following new events can be listened for: mozbrowseractivitydone sent when something inside the browser <iframe> triggers a web activity, and that web activity's message is consumed by the receiving app.
Chrome-only API reference
MozillaGeckoChromeAPI
to use a postmessage with callback version of chromeworker that features promises, see promiseworker.
Script security
normal content windows are globals, of course, but so are chrome windows, sandboxes, workers, the contentframemessagemanager in a frame script, and so on.
How to Report a Hung Firefox
getservice(ci.nsiwindowmediator); let win = wm.getmostrecentwindow("navigator:browser"); let browser = win.gbrowser.selectedbrowser; if (browser.isremotebrowser) { browser.messagemanager.loadframescript('data:,let appinfo = components.classes["@mozilla.org/xre/app-info;1"];if (appinfo && appinfo.getservice(components.interfaces.nsixulruntime).processtype != components.interfaces.nsixulruntime.process_type_default) {components.utils.import("resource://gre/modules/ctypes.jsm");var zero = new ctypes.intptr_t(8);var badptr = ctypes.cast(zero, ctypes.pointertype(ctypes.int32_t)...
Glossary
actor bridge channel child compressed message message nullable parent protocol state ...
Code Samples
ction(addon) { addon.uninstall(); }); disable an add-on components.utils.import("resource://gre/modules/addonmanager.jsm"); addonmanager.getaddonbyid("youraddon@youraddon.com", function(addon) { if (addon.isactive) addon.userdisabled = addon.isactive; }); listening for add-on uninstall this example sets a variable beinguninstalled that you can check when you get a profile-before-change message to do cleanup for your add-on on uninstall.
UpdateListener
an updatelistener receives messages from an update check for a single add-on, though it is possible to pass the same updatelistener to as many calls to findupdates() as you like.
FxAccountsProfileClient.jsm
fxaccountsprofileclienterror attributes name string name of the error fxaccountsprofileclienterror code number status code of the request errno number error number error string error description message string error message ...
Following the Android Toasts Tutorial from a JNI Perspective
it only fills the amount of space required for the message, and the current activity remains visible and interactive.
OS.File.Error
these exceptions hold both a human-readable error message detailing the i/o error and attributes to help determining the cause of the error.
OSFile.jsm
from a worker thread in some cases, the main thread api for os.file is not appropriate as it would require too much message passing, or because the code that requires file i/o is already executed on a worker thread.
Promise
if you see the message "a promise chain failed to handle a rejection", there is likely something to be fixed in the code.
Task.jsm
async() simplifies the common pattern of implementing a method via a task, like this simple object with a greet method that has a name parameter and spawns a task to send a greeting and return its reply: let greeter = { message: "hello, name!", greet: function(name) { return task.spawn((function* () { return yield sendgreeting(this.message.replace(/name/, name)); }).bind(this); }) }; with async(), the method can be declared succinctly: let greeter = { message: "hello, name!", greet: task.async(function* (name) { return yield sendgreeting(this.message.replace(/name/, name)); }) }; while mai...
XPCOMUtils.jsm
exceptions thrown this method throws an exception with the message "in generateci, don't use a component for generating classinfo" if classinfo parameter is an xpcom component.
JavaScript code modules
log.jsm (formerly log4moz) provides a log4j style api for logging, log messages to various endpoints, such as the browser console or a file on disk.
L10n Checks
0 - quiet; 5 - show all messages merge in the source mode you can tell l10n checks to merge missing strings and files into the locale files by setting a merge directory, e.g.: check-l10n-completeness -m output_dir suite/locales/l10n.ini ../l10n/ de note: only files which were merged will be saved in that directory.
Localizing XLIFF files for iOS
commiting your xliff file using this command, commit your translated xliff file into your locale's directory: git commit -m "commit message here" .
Uplifting a localization from Central to Aurora
hg merge if this just passes, you want to commit, and you probably want to use a commit message like "merging central and aurora".
Mozilla Development Tools
it is our home-grown web-based tool for watching the up-to-the-minute goings-on in our cvs repository (viewing checkins and log messages, reading diffs, etc.) tinderbox tinderbox is for knowing when the tree is in flames.
BloatView
| per-inst leaked| total rem| 0 |total | 17 2484|253953338 38| 17 |asynctransactiontrackersholder | 40 40| 10594 1| 78 |compositorchild | 472 472| 1 1| 79 |condvar | 24 48| 3086 2| 279 |messagepump | 8 8| 30 1| 285 |mutex | 20 60| 89987 3| 302 |pcompositorchild | 412 412| 1 1| 308 |pimagebridgechild | 416 416| 1 1| the first line tells you the pid of the leaking process, along with the type of pro...
Investigating leaks using DMD heap scan mode
the output will look something like this, after a message about loading progress: 0x7f0882fe3230 [fragmentorelement (xhtml) script https://www.example.com] --[[via hash] mlistenermanager]--> 0x7f0899b4e550 [eventlistenermanager] --[mlisteners event=onload listenertype=3 [i]]--> 0x7f0882ff8f80 [callbackobject] --[mincumbentglobal]--> 0x7f0897082c00 [nsglobalwindowinner # 2147483662 inner https://www.example.com] root 0x7f0882fe3230 i...
Leak-hunting strategies and tips
then go on to selecting a folder, then selecting a message, and then other activities one does while reading mail.
Profiling with the Firefox Profiler
you can identify this by hitting analyze (cleopatra will show you an error message).
tools/power/rapl
otherwise, it will fail with an error message explaining this requirement.
browser.dom.window.dump.enabled
this setting enables the dump function, which sends messages to the system console.
Preference reference
accessibility.tabfocusthe preference accessibility.tabfocus controls what elements receive focus when the user presses the tab key.browser.altclicksavethe preference browser.altclicksave controls whether clicking a link while holding the alt key starts the download of that link.browser.dom.window.dump.enabledthis setting enables the dump function, which sends messages to the system console.
Patches and pushes
use a commit message that mentions the bug number, describes the change, and mentions the reviewer.
MailNews
it provides a number of functions and capabilities, including: communications protocols - smtp, pop3, imap, nntp message management, including search and filtering message composition address book the mailnews code lives in the mailnews/ directory of comm-central.
Midas editor module security preferences
this functionality is completely removed since 2013-12-14 18:23 pst, see: bugs 38966 and 913734 note: if you've reached this page from a message box in firefox or another mozilla product, try using keyboard shortcuts for the cut, copy, and paste commands: copy: ctrl+c or ctrl+insert (command+c on mac) paste: ctrl+v or shift+insert (command+v on mac) cut: ctrl+x or shift+delete (command+x on mac) the information on the rest of this page is for web developers and advanced users.
NSPR LOG FILE
this environment variable specifies the file to which log messages are directed.
PR_Cleanup
that is, the process (if necessary) forcibly terminates any existing threads and exits without significant blocking and without error messages or core files.
PR_LogPrint
returns nothing description this function unconditionally writes a message to the log using the specified format string.
PR_NOT_REACHED
terminates the calling application with a message to the log.
PR_SetLogFile
subsequent log messages are written to this file.
Encrypt Decrypt MAC Keys As Session Objects
-" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* * print usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -i -o \n\n", progname); fprintf(stderr, "%-20s specify 'a' for encrypt operation\n\n", "-c "); fprintf(stderr, "%-20s specify 'b' for decrypt operation\n\n", " "); fprintf(stderr, "%-20s specify db directory path\n\...
Encrypt and decrypt MAC using token
-" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* * print usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -i -o \n\n", progname); fprintf(stderr, "%-20s specify 'a' for encrypt operation\n\n", "-c "); fprintf(stderr, "%-20s specify 'b' for decrypt operation\n\n", " "); fprintf(stderr, "%-20s specify db directory path\n\...
NSS Key Log Format
<clientrandom> is 32 bytes random value from the client hello message, encoded as 64 hexadecimal characters.
NSS_3.12.1_release_notes.html
bug 311432: ecc's ecl_use_fp code (for linux x86) fails pairwise consistency test bug 330622: certutil's usage messages incorrectly document certain options bug 330628: coreconf/linux.mk should _not_ default to x86 but result in an error if host is not recognized bug 359302: remove the sslsample code from nss source tree bug 372241: need more versatile form of cert_nametoascii bug 390296: nss ignores subject cn even when san contains no dnsname bug 401928: support generalized pkcs#5 v2 pbes bug 403543...
NSS 3.14.2 release notes
bug 822433 - fixed a crash in dtls_freehandshakemessages.
NSS 3.15.1 release notes
bug 877798 - fix ssltap to print the certificate_status handshake message correctly.
NSS 3.15.4 release notes
notable changes in nss 3.15.4 reordered the cipher suites offered in ssl/tls client hello messages to match modern best practices.
NSS 3.19 release notes
nss 3.19 source distributions are available on ftp.mozilla.org for secure https download: source tarballs: https://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/nss_3_19_rtm/src/ security fixes in nss 3.19 bug 1086145 / cve-2015-2721 - fixed a bug related to the ordering of tls handshake messages.
NSS 3.24 release notes
however, the server-side implementation of the ssl/tls protocol still supports processing of received v2-compatible client hello messages.
NSS 3.25.1 release notes
notable changes in nss 3.25.1 md5 signature algorithms sent by the server in certificaterequest messages are now properly ignored.
NSS 3.25 release notes
removed the limitation that allowed nss to only support certificate_verify messages that used the same signature hash algorithm as the prf when using tls 1.2 client authentication.
NSS 3.26.2 release notes
notable changes in nss 3.26.2 md5 signature algorithms sent by the server in certificaterequest messages are now properly ignored.
NSS 3.27.2 Release Notes
notable changes in nss 3.27.2 the ssl_settrustanchors() function is used to set the distinguished names that an nss server includes in its tls certificaterequest message.
NSS 3.35 release notes
new types in sslt.h sslhandshaketype - the type of a tls handshake message.
NSS 3.44 release notes
cert_decodecertpackage() crash with netscape certificate sequences 1533616 - sdb_getattributevaluenolock should make at most one sql query, rather than one for each attribute 1531236 - provide accessor for certcertificate.dercert 1536734 - lib/freebl/crypto_primitives.c assumes a big endian machine 1532384 - in nss test certificates, use @example.com (not @bogus.com) 1538479 - post-handshake messages after async server authentication break when using record layer separation 1521578 - x25519 support in pk11pars.c 1540205 - freebl build fails with -dnss_disable_chachapoly 1532312 - post-handshake auth doesn't interoperate with openssl 1542741 - certutil -f crashes with segmentation fault 1546925 - allow preceding text in try comment 1534468 - expose chacha20 primitive 1418944 - quote cc...
NSS 3.47 release notes
tls exporter in tstclnt and selfserv bug 1581024 - heap overflow in nss utility "derdump" bug 1582343 - soft token mac verification not constant time bug 1578238 - handle invald tag sizes for ckm_aes_gcm bug 1576295 - check all bounds when encrypting with seed_cbc bug 1580286 - nss rejects tls 1.2 records with large padding with sha384 hmac bug 1577448 - create additional nested s/mime test messages for thunderbird bug 1399095 - allow nss-try to be used to test nspr changes bug 1267894 - libssl should allow selecting the order of cipher suites in clienthello bug 1581507 - fix unportable grep expression in test scripts bug 1234830 - [cid 1242894][cid 1242852] unused values bug 1580126 - fix build failure on aarch64_be while building freebl/gcm bug 1385039 - build nspr tests as part of ...
NSS 3.49 release notes
in pk11install_platform_generate bug 1602288 - fix build failure due to missing posix signal.h bug 1588714 - implement checkarmsupport for win64/aarch64 bug 1585189 - nss database uses 3des instead of aes to encrypt db entries bug 1603257 - fix ubsan issue in softoken ckm_nss_chacha20_ctr initialization bug 1590001 - additional hrr tests (cve-2019-17023) bug 1600144 - treat clienthello with message_seq of 1 as a second clienthello bug 1603027 - test that esni is regenerated after helloretryrequest bug 1593167 - intermittent mis-reporting potential security risk sec_error_unknown_issuer bug 1535787 - fix automation/release/nss-release-helper.py on macos bug 1594933 - disable building dbm by default bug 1562548 - improve gcm perfomance on aarch32 this bugzilla query returns all the bug...
NSS 3.56 release notes
bug 1588941 - send empty certificate message when scheme selection fails.
Enc Dec MAC Output Public Key as CSR
*/ #ifndef port_errortostring #ifndef sec_error_base #define sec_error_base (-0x2000) #define port_errortostring(err) pr_errortostring((err), pr_language_i_default) #endif #endif /* * print usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c -d [-z ] " "[-p | -f ] -s -r -i -o \n\n", progname); fprintf(stderr, "%-20s specify 'g' for generating rsa keypair for wrapping\n\n", "g"); fprintf(stderr, "%-20s specify 'e' for encrypt operation\n\n", "e"); fprintf(stderr, "%-20s spe...
Enc Dec MAC Using Key Wrap CertReq PKCS10 CSR
/* sample 6 commands */ typedef enum { generate_csr, add_cert_to_db, save_cert_to_header, encrypt, decrypt, sign, verify, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4, pubkey = 5, lab = 6, certenc= 7, certvfy= 8, sig = 9 } headertype; /* * print usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s %s %s %s %s %s %s %s %s %s\n\n", progname, " -<g|a|h|e|ds|v> -d <dbdirpath> ", "[-p <dbpwd> | -f <dbpwdfile>] [-z <noisefilename>] [-a <\"\">]", "-s <subject> -r <csr> | ", "-n <nickname> -t <trust> -c <cert> [ -r <csr> -u <issuernickname> ...
Encrypt Decrypt_MAC_Using Token
-" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* * print usage message and exit.
NSS Sample Code Sample_2_Initialization of NSS
sample code 1 /* nspr headers */ #include <prthread.h> #include <plgetopt.h> #include <prprf.h> /* nss headers */ #include <nss.h> #include <pk11func.h> #include "util.h" /* print a usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -d <dbdirpath> [-p <plainpasswc>]" " [-f <passwdffile>]\n\n", progname); fprintf(stderr, "%-15s specify a db directory path\n\n", "-d <dbdirpath>"); fprintf(stderr, "%-15s specify a plaintext password\n\n", "-p <plainpasswc>"); fprintf(stderr, "%-15s specify a password file\n\n",...
NSS Sample Code Sample_3_Basic Encryption and MACing
--" #define mac_header "-----begin mac-----" #define mac_trailer "-----end mac-----" #define pad_header "-----begin pad-----" #define pad_trailer "-----end pad-----" typedef enum { encrypt, decrypt, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4 } headertype; /* print a usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -c <a|b> -d <dbdirpath> [-z <noisefilename>] " "[-p <dbpwd> | -f <dbpwdfile>] -i <ipfilename> -o <opfilename>\n\n", progname); fprintf(stderr, "%-20s specify 'a' for encrypt operation\n\n", "-c <a|b>"); fprintf(stderr, "%-20s specify 'b' for decrypt operation\n\n"...
Initialize NSS database - sample 2
/* * print a usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s -d [-p ]" " [-f ]\n\n", progname); fprintf(stderr, "%-15s specify a db directory path\n\n", "-d "); fprintf(stderr, "%-15s specify a plaintext password\n\n", "-p "); fprintf(stderr, "%-15s specify a password file\n\n", "-f "); exit(-1); } /* * initslotpassword */ char * initslotpassword(pk11slotinfo *slot, prbool retry, void *arg) { file *input; file *output; char *p0 = null; char *p1 = null; s...
sample2
port_errortostring #define port_errortostring(err) pr_errortostring((err), pr_language_i_default) #endif /* sample 6 commands */ typedef enum { generate_csr, add_cert_to_db, save_cert_to_header, encrypt, decrypt, sign, verify, unknown } commandtype; typedef enum { symkey = 0, mackey = 1, iv = 2, mac = 3, pad = 4, pubkey = 5, lab = 6, certenc= 7, certvfy= 8, sig = 9 } headertype; /* * print usage message and exit */ static void usage(const char *progname) { fprintf(stderr, "\nusage: %s %s %s %s %s %s %s %s %s %s\n\n", progname, " -<g|a|h|e|ds|v> -d <dbdirpath> ", "[-p <dbpwd> | -f <dbpwdfile>] [-z <noisefilename>] [-a <\"\">]", "-s <subject> -r <csr> | ", "-n <nickname> -t <trust> -c <cert> [ -r <csr> -u <issuernickname> [-x <\"\">] -m <serialnumber> ] | ", "-n <nickname> -b <headerfilename> | ",...
nss tech note3
this message attempts to answer that question, and to document nss's approach to validating certificates for certain purposes.
Overview of NSS
ietf message specification (based on the popular internet mime standard) that provides a consistent way to send and receive signed and encrypted mime data.
FC_DigestKey
the digest for the entire message is returned by a call to fc_digestfinal.
FC_Sign
description fc_sign signs a message in a single operation according to the attributes of the previous call to fc_signinit.
FC_SignUpdate
the signature for the entire message is returned by a call to fc_signfinal.
FC_VerifyUpdate
the result for the entire message is returned by a call to fc_verifyfinal.
FIPS mode of operation
fc_decryptinit fc_decrypt fc_decryptupdate fc_decryptfinal message digesting functions these functions support sha-1, sha-256, sha-384, and sha-512.
NSS environment variables
messages sent and received will be timestamped and dumped (to stdout) in standard hex-dump format.
NSS tools : modutil
if any of these databases already exist in a specified directory, modutil returns an error message.
TLS Cipher Suite Discovery
they must agree on these items: key establishment algorithm (such as rsa, dh, or ecdh) peer authentication algorithm (such as rsa, dsa, ecdsa) bulk data encryption algorithm (such as rc4, des, aes) and key size digest algorithm for message authentication checking (sha1, sha256) there are numerous available choices for each of those categories, and the number of possible combinations of all those choices is large.
NSS Tools certutil-tasks
mistakes with command-line options just print a usage message.
NSS Tools modutil
if any of these databases already exist in a specified directory, the security module database tool displays an error message.
NSS Tools pk12util
if no suitable replacement for the desired algorithm can be found a "no security module can perform the requested operation" will appear on the error message.
NSS tools : modutil
MozillaProjectsNSStoolsmodutil
if any of these databases already exist in a specified directory, modutil returns an error message.
Multithreading in Necko
for example, on xp_win an invisible window is created with a message pump on a background thread for processing wsa asynchronous dns events.
Rhino community
to view archived messages earlier than september 27, 2007, try google group for the earlier newsgroup.
Rhino Debugger
whenever a javascript exception is thrown by a script a message dialog will be displayed and control will be given to the debugger at the location the exception is raised.
Rhino overview
internationalization the messages reported by the javascript engine are by default retrieved from the property file org/mozilla/javascript/resources/messages.properties.
Rhino shell
help() executing the help function will print usage and help messages.
Creating JavaScript jstest reftests
asserteq asserteq(v1, v2[, message]) checks that v1 and v2 are the same value.
Creating JavaScript tests
asserteq(v1, v2[, message]) check that v1 and v2 are the same value.
Statistics API
the browser preference javascript.options.mem.log controls dumping of human-readable gc stats messages to the developer console.
Self-hosted builtins in SpiderMonkey
throwtypeerror, throwrangeerror, throwsyntaxerror, which self-hosted code should use instead of throw so that the error message is specified in js.msg and can be localized.
JS::CallArgs
if false, it reports an error message on the context.
JS_CompileUTF8FileHandle
this filename is used for error messages.
JS_GetInstancePrivate
in this case, js_getinstanceprivate tests whether or not there is a function name associated with the argument vector, and if there is, reports the name in an error message using the js_reporterror function.
JS_GetLocaleCallbacks
get and set locale specific string conversion and error message callbacks.
Parser API
the syntax error object thrown by reflect.parse() has the same message property as the syntax error that would be thrown by eval(src).
SpiderMonkey 1.8.5
if you are running valgrind on your embedding, be sure to build spidermonkey with the --enable-valgrind option to suppress superflous error messages triggered by the garbage collector.
SpiderMonkey 1.8.7
if you are running valgrind on your embedding, be sure to build spidermonkey with the --enable-valgrind option to suppress superflous error messages triggered by the garbage collector.
TPS Tests
this will cause tps to set the firstsync pref to the relevant value before syncing, so that the described actionwill take place logger.loginfo(msg) logs the given message to the tps log.
Handling Mozilla Security Bugs
if the group decides to publish a warning, the module owner, a peer, or some other person they may designate will post this message to the known vulnerabilities page (which will be the authoritative source for this information) and will also send a copy of this message to an appropriate moderated mailing list and/or newsgroup (e.g., netscape.public.mozilla.announce and/or some other newsgroup/list established specifically for this purpose).
Animated PNG graphics
MozillaTechAPNG
an error message may be displayed to the user if appropriate.
Gecko Roles
role_dialog represents a dialog box or message box.
XUL Accessibility
ptext attribute value if the aria role is used and it allows to have accessible value then aria-valuetext or aria-valuenow are used if the element is xlink then value is generated from link location actions if the element is xlink then jump action is exposed if the element has registered click event handler then click action is exposed xul elements notification used to display an informative message.
Feed content access API
nsifeedprogresslistener implemented by the program that wants to parse an rss or atom feed to receive messages during the parsing process.
XPCOM array guide
MozillaTechXPCOMGuideArrays
example: an array of error message static const char* pointers.
Making cross-thread calls using runnables
in general, threading and message passing should be asynchronous.
Components.Exception
syntax var exception = [ new ] components.exception([ message [, result [, stack [, data ] ] ] ]); parameters message a string which can be displayed in the error console when your exception is thrown or in other developer-facing locations, defaulting to 'exception' result the nsresult value of the exception, which defaults to components.results.ns_error_failure stack an xpcom stack to be set on the exception (defaulting to the current stack chain) d...
Components.utils.cloneInto
suppose the page script defines a function like this: // page script function foo(greeting) { console.log("they said: " + greeting.message); } the add-on script can define an object, clone it, and pass it into this function: // add-on script var addonscriptobject = {"message" : "hello from add-on"}; contentwindow.foo(cloneinto(addonscriptobject, contentwindow)); // "they said: hello from add-on" cloning objects that have functions if the object to be cloned contains functions, you must pass the {clonefunctions:true} flag or you'l...
Folders
folders have a number of interesting attributes: parent subfolder server uri flags and methods getdatabase ( how to get a database of the messages in the folder.) updatefolder (gets new messages for that folder, if applicable, e.g., pop3 inboxes, imap folders, news folders, rss folders) ...
jsdIStackFrame
this is the filename you'll see in error messages, and so on.
nsIAbstractWorker
see also using web workers nsiworkermessageport nsiworkermessageevent nsiworkerscope nsiworkerglobalscope nsiworker ...
nsIAppShellService
to get an out of process element you want to communicate with via message manager, then append a browser element with remote attribute set to true.
nsIAppStartup
.getservice(components.interfaces.nsiconsoleservice); var startupinfo = components.classes["@mozilla.org/toolkit/app-startup;1"] .getservice(ci.nsiappstartup_mozilla_2_0).getstartupinfo(); var keys = object.keys(startupinfo); keys.sort(function(a, b) { return startupinfo[a] - startupinfo[b]; }); for each (var name in keys) { aconsoleservice.logstringmessage(name + ": " + startupinfo[name]); } to calculate how long startup took, compute the difference between the event's timestamp and the timestamp of the process event.
nsIBadCertListener2
return value the consumer shall return true if it wants to suppress the error message related to the bad cert (the connection will still get canceled).
nsICryptoHMAC
constant value description md2 1 message digest algorithm 2 md5 2 message-digest algorithm 5 sha1 3 secure hash algorithm 1 sha256 4 secure hash algorithm 256 sha384 5 secure hash algorithm 384 sha512 6 secure hash algorithm 512 methods finish() completes this hmac object and produces the actual hmac diegest data.
nsICryptoHash
constant value description md2 1 message digest algorithm 2 md5 2 message-digest algorithm 5 sha1 3 secure hash algorithm 1 sha256 4 secure hash algorithm 256 sha384 5 secure hash algorithm 384 sha512 6 secure hash algorithm 512 methods finish() completes the hash object and produces the actual hash data.
nsIDOMChromeWindow
messagemanager nsichromeframemessagemanager read only.
nsIErrorService
xpcom/base/nsierrorservice.idlscriptable this is a service that allows nsresult codes to be mapped to string bundles that can be used to look up error messages.
nsIHttpChannel
the value of nsirequest.status() will be ns_ok even when processing a 404 file not found response because such a response may include a message body that (in some cases) should be shown to the user.
nsIJumpListItem
1.0 66 introduced gecko 2.0 inherits from: nsisupports last changed in gecko 2.0 (firefox 4 / thunderbird 3.3 / seamonkey 2.1) note: to consumers: it's reasonable to expect we'll need support for other types of jump list items (an audio file, an email message, etc.).
nsILocale
nsilocale_messages - related to fonts, character encodings and so on.
nsILocaleService
this method returns the same as getsystemlocale.getcategory("nsilocale_messages").
nsIMacDockSupport
this can be used, for example, to display the number of unread messages in an email client.
nsIMimeHeaders
headername, in boolean getallofthem ); parameters headername missing description getallofthem missing description return value missing description exceptions thrown missing exception missing description initialize() void initialize( [const] in string allheaders, in long allheaderssize ); parameters allheaders insert the complete message content allheaderssize length of the passed in content exceptions thrown missing exception missing description remarks see also ...
nsIMsgFilterList
terstohdr() void nsimsgfilterlist::applyfilterstohdr ( in nsmsgfiltertypetype filtertype, in nsimsgdbhdr msghdr, in nsimsgfolder folder, in nsimsgdatabase db, in string headers, in unsigned long headersize, in nsimsgfilterhitnotify listener, in nsimsgwindow msgwindow, in nsilocalfile amessagefile ) writeinattr() void nsimsgfilterlist::writeintattr ( in nsmsgfilterfileattribvalue attrib, in long value, in nsioutputstream stream ) writestrattr() void nsimsgfilterlist::writestrattr ( in nsmsgfilterfileattribvalue attrib, in string value, in nsioutputstream stream ) writew...
nsINavHistoryService
if this uri is loaded soon after this message has been received, that transition will be marked as following a bookmark.
nsIParserUtils
sanitizerlogremovals (1 << 6) flag for sanitizer: log messages to the console for everything that gets sanitized.
nsISSLErrorListener
return value the consumer shall return true if it wants to suppress the error message related to the error (the connection will still get canceled).
nsIURI
this is useful for authentication, managing sessions, or for checking the origin of an uri to prevent cross-site scripting attacks while using methods such as window.postmessage().
nsIWindowsShellService
a rgb value, where (r << 24 | g << 16 | b) obsolete since gecko 1.8 unreadmailcount unsigned long the number of unread mail messages for the current user.
nsIWorkerGlobalScope
see also using web workers nsiworkermessageport nsiworkermessageevent nsiworkerscope nsiabstractworker nsiworker ...
nsMsgSearchAttrib
nsmsgsearchattribvalue priority = 4; /* mail only */ const nsmsgsearchattribvalue msgstatus = 5; const nsmsgsearchattribvalue to = 6; const nsmsgsearchattribvalue cc = 7; const nsmsgsearchattribvalue toorcc = 8; const nsmsgsearchattribvalue alladdresses = 9; const nsmsgsearchattribvalue location = 10; /* result list only */ const nsmsgsearchattribvalue messagekey = 11; /* message result elems */ const nsmsgsearchattribvalue ageindays = 12; const nsmsgsearchattribvalue folderinfo = 13; /* for "view thread context" from result */ const nsmsgsearchattribvalue size = 14; const nsmsgsearchattribvalue anytext = 15; const nsmsgsearchattribvalue keywords = 16; // keywords are the internal representation of tags.
nsMsgSearchTerm
%{c++ #define is_string_attribute(_a) \ (!(_a == nsmsgsearchattrib::priority || _a == nsmsgsearchattrib::date || \ _a == nsmsgsearchattrib::msgstatus || _a == nsmsgsearchattrib::messagekey || \ _a == nsmsgsearchattrib::size || _a == nsmsgsearchattrib::ageindays || \ _a == nsmsgsearchattrib::folderinfo || _a == nsmsgsearchattrib::location || \ _a == nsmsgsearchattrib::label || _a == nsmsgsearchattrib::junkstatus || \ _a == nsmsgsearchattrib::folderflag || _a == nsmsgsearchattrib::uint32hdrproperty || \ _a == nsmsgsearchattrib::junkpercent || _a == nsmsgsearchattrib...
Setting HTTP request headers
var headername = "x-hello"; var headervalue = "world"; function log(text) { // var consoleservice = components.classes["@mozilla.org/consoleservice;1"].getservice(components.interfaces.nsiconsoleservice); // consoleservice.logstringmessage(text); } function myhttplistener() { } myhttplistener.prototype = { observe: function(subject, topic, data) { if (topic == "http-on-modify-request") { log("----------------------------> (" + subject + ") mod request"); var httpchannel = subject.queryinterface(components.interfaces.nsihttpchannel); httpchannel.setrequestheader(headername, headervalue, f...
Warnings
sort operations this warning message will say something about the number of sort operations that have occurred for a sql statement.
Storage
bind a statement, your javascript should look something like this to execute a statement asynchronously: statement.executeasync({ handleresult: function(aresultset) { for (let row = aresultset.getnextrow(); row; row = aresultset.getnextrow()) { let value = row.getresultbyname("column_name"); } }, handleerror: function(aerror) { print("error: " + aerror.message); }, handlecompletion: function(areason) { if (areason != components.interfaces.mozistoragestatementcallback.reason_finished) print("query canceled or aborted!"); } }); the call to executeasync takes an object that implements mozistoragestatementcallback.
The Valgrind Test Job
understanding errors for each problem that valgrind finds, it emits a message describing the problem, along with a stack trace indicating where the problem occurs.
Address book sync client design
* 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 amsg); /** * notify the observer that the ab sync operation has been completed.
nsIMsgCloudFileProvider
lasterror acstring readonly: the last error message received from the server.
LDAP Support
in such a scenario, it may be hard to tell which person you really want to send the message to.
Mailnews and Mail code review requirements
the procedure to use these is to be sure to: include "rs=simple-orange-fix" or "rs=orange-debugging" in the first line of the commit message paste a link to the pushed commit with the rubber stamp in the bug make sure you pasted a link to any try-server pushes of the patch in the bug rs=simple-orange-fix requirements: the patch is fixing an intermittent orange test failure.
The libmime module
| | |--- mimemultipartparallel | | | | | |--- mimemultipartalternative | | | | | |--- mimemultipartrelated | | | | | |--- mimemultipartappledouble | | | | | |--- mimesunattachment | | | | | |--- mimemultipartsigned (abstract) | | | |--- mimemessage | | | |--- mimeuntypedtext | |--- mimeleaf (abstract) | | | |--- mimeinlinetext (abstract) | | | | | |--- mimeinlinetextplain | | | | | |--- mimeinlinetexthtml | | | | | |--- mimeinlinetextrichtext | | | | | | | |--- mimeinlinetextenriched ...
Creating a Custom Column
getcelltext() is the text that is displayed to the user while getsort*forrow() is what is used internally when sorting by your column a simple implementation objects in javascript are just "advanced" variables, so an implementation of the nsimsgcustomcolumnhandler interface looks like: var columnhandler = { getcelltext: function(row, col) { //get the message's header so that we can extract the reply to field var hdr = gdbview.getmsghdrat(row); return hdr.getstringproperty("replyto"); }, getsortstringforrow: function(hdr) {return hdr.getstringproperty("replyto");}, isstring: function() {return true;}, getcellproperties: function(row, col, props){}, getrowproperties: function(row, props){}, getimagesrc: ...
Access Thunderbird Window Areas
var foldertree = getfoldertree(); var searchinput = getsearchinput(); var messagepane = getmessagepane(); var messagepaneframe = getmessagepaneframe(); var mailtoolbox = getmailtoolbox(); var currentmsgfolder = getloadedmsgfolder(); see the msgmail3panewindow.js for other helper methods ...
Add Option to Context Menu
for thunderbird 2 <?xml version="1.0"?> <overlay id="sample" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <menupopup id="messagepanecontext"> <menuitem id="my_option" label="my option concise and cool label" oncommand="alert('hi')"/> </menupopup> </overlay> for thunderbird 3 <?xml version="1.0"?> <overlay id="sample" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <popup id="mailcontext"> <menuitem id="my_option" label="my option concise an...
Use SQLite
sql queries on the client side, using in-memory (blob) storage of 2mb: var db = opendatabase('mydb', '1.0', 'test db', 2 * 1024 * 1024); var msg; db.transaction(function (tx) { tx.executesql('create table if not exists logs (id unique, log)'); tx.executesql('insert into logs (id, log) values (1, "foobar")'); tx.executesql('insert into logs (id, log) values (2, "logmsg")'); msg = '<p>log message created and row inserted.</p>'; document.queryselector('#status').innerhtml = msg; }); db.transaction(function (tx) { tx.executesql('select * from logs', [], function (tx, results) { var len = results.rows.length, i; msg = "<p>found rows: " + len + "</p>"; document.queryselector('#status').innerhtml += msg; for (i = 0; i < len; i++){ msg = "<p><b>" + results.rows.item(i).l...
Thunderbird developer reference docs
folder classes db views (message list) message summary database mailnews protocols mailnews filters ...
libmime content type handlers
the primary use of libmime is to parse and render rfc822 messages for use by the messenger component of seamonkey.
Declaring and Using Callbacks
if two arguments are passed to the callback constructor, the second is used as the this parameter: function myjscallback() { alert(this.message); }; var receiver = { message: 'hi there!' }; var callback = funcptrtype(myjscallback, receiver); // alerts with 'hi there' when the callback is invoked if three arguments are passed to the callback constructor, the third argument is used as a sentinel value which the callback returns if an exception is thrown.
Standard OS Libraries
to call objective-c based api from ctypes, use the following functions in libobjc.dylib: objc_getclass to get class sel_registername to register selector name objc_msgsend and some variants to send message to class and instance objective-c code can be translated into c code by the following rule: // objective-c code nsevent loc = [nsevent mouselocation]; // pseudo c code nsevent loc = (nspoint)objc_msgsend(objc_getclass("nsevent"), sel_registername("mouselocation")); example: [nsevent mouselocation] components.utils.import("resource://gre/modules/ctypes.js...
CData
charcode); console.info('fromcharcode:', fromcharcode); var char16_val = fromcharcode.join(''); console.info('char16_val:', char16_val); return char16_val; } if (!jschar) { try { var char8_val = stringptr.readstring(); console.info('stringptr.readstring():', char8_val); return char8_val; } catch (ex if ex.message.indexof('malformed utf-8 character sequence at offset ') == 0) { console.warn('ex of offset utf8 read error when trying to do readstring so using alternative method, ex:', ex); return readjscharstring(); } } else { return readjscharstring(); } } ...
ctypes
.dll"); var hmodule = ctypes.uint32_t; var hwnd = ctypes.uint32_t; var lpctstr = ctypes.jschar.ptr; var lpcstr = ctypes.char.ptr; var loadlibrary = kernel.declare("loadlibraryw", ctypes.winapi_abi, hmodule, lpctstr); var getprocaddress = kernel.declare("getprocaddress", ctypes.winapi_abi, ctypes.void_t.ptr, hmodule, lpcstr); var huser = loadlibrary("user32"); var funcptr = getprocaddress(huser, "messageboxw"); // now we have a pointer to a function, let's cast it to the right type var messageboxtype = ctypes.functiontype(ctypes.winapi_abi, ctypes.int32_t, [hwnd, lpctstr, lpctstr, ctypes.uint32_t]); funcptr = ctypes.cast(funcptr, messageboxtype.ptr); funcptr(0, "test1", "test2", 0); credit for this example is to wladimir palant (stackoverflow :: how to call a function using pointer in js-ctype...
Streams - Plugins
npstream* stream; char* mydata = "<html><head><title>this is a message from my plug-in!</title></head><body><p><strong>this is a message from my plug-in!</strong></p></body>/html>"; int32 mylength = strlen(mydata) + 1; /* create the stream.
Introduction to DOM Inspector - Firefox Developer Tools
for thunderbird and seamonkey mail and news, any messages you're viewing will be listed here.
Use watchpoints - Firefox Developer Tools
the message panel in the upper right corner indicates that the debugger is "paused on property set".
Debugger.Object - Firefox Developer Tools
errormessagename if the referent is an error created with an engine internal message template this is a string which is the name of the template; undefined otherwise.
All keyboard shortcuts - Firefox Developer Tools
web console command windows macos linux open the web console ctrl + shift + k cmd + opt + k ctrl + shift + k search in the message display pane ctrl + f cmd + f ctrl + f open the object inspector pane ctrl + click ctrl + click ctrl + click clear the object inspector pane esc esc esc focus on the command line ctrl + shift + k cmd + opt + k ctrl + shift + k clear output ctrl + shift + l ctrl + l from firefox 67: cmd + k ...
Network monitor toolbar - Firefox Developer Tools
a set of tool icons: pause (or resume) recording network log search the log request blocking an array of buttons to filter the network request list by type: by the content type of the response xhr requests websocket upgrades and messages (labeled ws) other requests a checkbox that allows you to disable caching.
Edit fonts - Firefox Developer Tools
empty elements will not have any fonts used and will display the message "no fonts were found for the current element." fonts will be included in this section for one of the following reasons: they are listed in the element's font-family css declaration value.
CSS Flexbox Inspector: Examine Flexbox layouts - Firefox Developer Tools
if you expand the section without selecting a flexbox container, it will only display the message, "select a flex container or item to continue".
Inspect and select colors - Firefox Developer Tools
hovering the mouse over the contrast message gives a more detailed explanation.
Responsive Design Mode - Firefox Developer Tools
now when you change such settings for the first time, you are given a warning message that tells you these reloads are no longer automatic, and informed about how you can make them automatic.
IndexedDB - Firefox Developer Tools
you can delete an indexeddb database using the context menu in the storage tree: if the database cannot be deleted (most commonly because there are still active connections to the database), a warning message will be displayed in the storage inspector: you can use the context menu in the table widget to delete all items in an object store, or a particular item: ...
View Source - Firefox Developer Tools
if the number is higher than the lines in a file, you receive an error message.
Web console keyboard shortcuts - Firefox Developer Tools
command windows macos linux open the web console ctrl + shift + k cmd + opt + k ctrl + shift + k search in the message display pane ctrl + f cmd + f ctrl + f open the object inspector pane ctrl + click ctrl + click ctrl + click clear the object inspector pane esc esc esc focus on the command line ctrl + shift + k cmd + opt + k ctrl + shift + k clear output ctrl + shift + l ctrl + l from firefox 67: cmd + k ctrl + shift + l command line interpreter these shortcuts apply when you're in the command line interpreter.
Rich output - Firefox Developer Tools
export output to the clipboard once you have output in the console window, you can save it to the clipboard by right-clicking on the output and selecting export visible messages to clipboard: this will copy all of the output to the clipboard.
The JavaScript input interpreter - Firefox Developer Tools
note that the result might be an error message.
about:debugging (before Firefox 68) - Firefox Developer Tools
just click the "push" button to send a push event to the service worker: service workers not compatible in firefox 49+, a warning message will be displayed in the service workers section of the workers page if service workers are incompatible with the current browser configuration, and therefore cannot be used or debugged.
AbortController.AbortController() - Web APIs
}).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror.
AbortController.abort() - Web APIs
}).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror.
AbortController.signal - Web APIs
}).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror.
AbortController - Web APIs
}).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with a domexception named aborterror.
AbortSignal - Web APIs
}).catch(function(e) { reports.textcontent = 'download error: ' + e.message; }) } note: when abort() is called, the fetch() promise rejects with an aborterror.
AddressErrors.addressLine - Web APIs
syntax var addresslineerror = addresserrors.addressline; value if an error occurred during validation of the address due to one of the strings in the addressline array having an invalid value, this property is set to a domstring providing a human-readable error message explaining the validation error.
AddressErrors.country - Web APIs
syntax var countryerror = addresserrors.country; value if an error occurred during validation of the address due to the country property having an invalid value, this property is set to a domstring providing a human-readable error message explaining the validation error.
AesGcmParams - Web APIs
note that the iv does not have to be secret, just unique: so it is ok, for example, to transmit it in the clear alongside the encrypted message.
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.onremove - Web APIs
a console message is logged each time an animation it removed, invoked when the remove event is fired.
Attr - Web APIs
WebAPIAttr
dth="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.
AudioContext() - Web APIs
non-standard exceptions in chrome if the value of the latencyhint property isn't valid, chrome throws a typeerror exception with the message "the provided value '...' is not a valid enum value of type audiocontextlatencycategory".
AudioWorkletNode - Web APIs
audioworkletnode.port read only returns a messageport used for bidirectional communication between the node and its associated audioworkletprocessor.
AudioWorkletProcessor - Web APIs
properties port read only returns a messageport used for bidirectional communication between the processor and the audioworkletnode which it belongs to.
Background Tasks API - Web APIs
logelem is the <div> we'll insert logged text messages into.
BeforeUnloadEvent - Web APIs
window.addeventlistener("beforeunload", function (e) { var confirmationmessage = "\o/"; (e || window.event).returnvalue = confirmationmessage; // gecko + ie return confirmationmessage; /* safari, chrome, and other * webkit-derived browsers */ }); specifications specification status comment html living standardthe definition of 'beforeunloadevent' i...
Bluetooth.getAvailability() - Web APIs
examples the following snippet prints out a message in the console specifying wheter or not bluetooth is supported: navigator.bluetooth.getavailability().then(available => { if (available) console.log("this device supports bluetooth!"); else console.log("doh!
BroadcastChannel() - Web APIs
var bc = new broadcastchannel('internal_notification'); bc.postmessage('new listening connected!'); specifications specification status comment html living standardthe definition of 'broadcastchannel()' in that specification.
BroadcastChannel.close() - Web APIs
syntax var str = channel.close(); example // connect to a channel var bc = new broadcastchannel('test_channel'); // more operations (like postmessage, …) // when done, disconnect from the channel bc.close(); specifications specification status comment html living standardthe definition of 'broadcastchannel.close()' in that specification.
BroadcastChannel.name - Web APIs
syntax var str = channel.name; examples // connect to a channel var bc = new broadcastchannel('test_channel'); // more operations (like postmessage, …) // log the channel name to the console console.log(bc.name); // "test_channel" // when done, disconnect from the channel bc.close(); specifications specification status comment html living standardthe definition of 'broadcastchannel.name' in that specification.
Client - Web APIs
WebAPIClient
methods client.postmessage() sends a message to the client.
Clients.openWindow() - Web APIs
examples // send notification to os if applicable if (self.notification.permission === 'granted') { const notificationobject = { body: 'click here to view your messages.', data: { url: self.location.origin + '/some/path' }, // data: { url: 'http://example.com' }, }; self.registration.shownotification('you\'ve got messages!', notificationobject); } // notification click event listener self.addeventlistener('notificationclick', e => { // close the notification popout e.notification.close(); // get all the window clients e.waituntil(clients.ma...
Clients - Web APIs
WebAPIClients
client.focus(); chatclient = client; break; } } // if we didn't find an existing chat window, // open a new one: if (!chatclient) { chatclient = await clients.openwindow('/chat/'); } // message the client: chatclient.postmessage("new chat messages!"); }()); }); specifications specification status comment service workersthe definition of 'clients' in that specification.
Clipboard.read() - Web APIs
WebAPIClipboardread
if it's not a png image, an error message is presented.
ClipboardItem() - Web APIs
async function writeclipimg() { try { const imgurl = '/myimage.png'; const data = await fetch(imgurl); const blob = await data.blob(); await navigator.clipboard.write([ new clipboarditem({ [blob.type]: blob }) ]); console.log('fetched image copied.'); } catch(err) { console.error(err.name, err.message); } } specifications specification status comment clipboard api and eventsthe definition of 'clipboarditem' in that specification.
ClipboardItem.getType() - Web APIs
async function getclipboardcontents() { try { const clipboarditems = await navigator.clipboard.read(); for (const clipboarditem of clipboarditems) { for (const type of clipboarditem.types) { const blob = await clipboarditem.gettype(type); // we can now use blob here } } } catch (err) { console.error(err.name, err.message); } } specifications specification status comment clipboard api and eventsthe definition of 'clipboarditem' in that specification.
ClipboardItem.types - Web APIs
async function getclipboardcontents() { try { const clipboarditems = await navigator.clipboard.read(); for (const clipboarditem of clipboarditems) { for (const type of clipboarditem.types) { const blob = await clipboarditem.gettype(type); // we can now use blob here } } } catch (err) { console.error(err.name, err.message); } } specifications specification status comment clipboard api and eventsthe definition of 'clipboarditem' in that specification.
Console.error() - Web APIs
WebAPIConsoleerror
outputs an error message to the web console.
Console.info() - Web APIs
WebAPIConsoleinfo
the console.info() method outputs an informational message to the web console.
Console.warn() - Web APIs
WebAPIConsolewarn
outputs a warning message to the web console.
Console API - Web APIs
the console api provides functionality to allow developers to perform debugging tasks, such as logging messages or the values of variables at set points in your code, or timing how long an operation takes to complete.
ContentIndex.add() - Web APIs
WebAPIContentIndexadd
png', }], category: 'article' }; // our asynchronous function to add indexed content async function registercontent(data) { const registration = await navigator.serviceworker.ready; // feature detect content index if (!registration.index) { return; } // register content try { await registration.index.add(data); } catch (e) { console.log('failed to register content: ', e.message); } } the add method can also be used within the service worker scope.
ContentIndex.getAll() - Web APIs
ync function createreadinglist() { // access our service worker registration const registration = await navigator.serviceworker.ready; // get our index entries const entries = await registration.index.getall(); // create a containing element const readinglistelem = document.createelement('div'); // test for entries if (!array.length) { // if there are no entries, display a message const message = document.createelement('p'); message.innertext = 'you currently have no articles saved for offline reading.' readinglistelem.append(message); } else { // if entries are present, display in a list of links to the content const listelem = document.createelement('ul'); for (const entry of entries) { const listitem = document.createelement('li'); ...
DOMError - Web APIs
WebAPIDOMError
domerror.message read only returns a domstring representing a message or description associated with the given error type name.
Document: animationstart event - Web APIs
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.
Document.lastModified - Web APIs
here is a possible example of how to show an alert message when the page changes (see also: javascript cookies api): if (date.parse(document.lastmodified) > parsefloat(document.cookie.replace(/(?:(?:^|.*;)\s*last_modif\s*\=\s*([^;]*).*$)|^.*$/, "$1") || "0")) { document.cookie = "last_modif=" + date.now() + "; expires=fri, 31 dec 9999 23:59:59 gmt; path=" + location.pathname; alert("this page has changed!"); } …the same example, but skipping the ...
Document.onafterscriptexecute - Web APIs
example function finished(e) { logmessage(`finished script with id: ${e.target.id}`); } document.addeventlistener('afterscriptexecute', finished, true); view live example specification html5 ...
Document.onbeforescriptexecute - Web APIs
example function starting(e) { logmessage("starting script with id: " + e.target.id); } document.addeventlistener("beforescriptexecute", starting, true); view live examples specification html5 ...
Document.write() - Web APIs
WebAPIDocumentwrite
note: using document.write() in deferred or asynchronous scripts will be ignored and you'll get a message like "a call to document.write() from an asynchronously-loaded external script was ignored" in the error console.
Examples of web and XML development using the DOM - Web APIs
note that the table itself has an onclick event handler that ought to display a message when the table is clicked.
Introduction to the DOM - Web APIs
your dom programming may be something as simple as the following, which displays an alert message by using the alert() function from the window object, or it may use more sophisticated dom methods to actually create new content, as in the longer example below.
Element.classList - Web APIs
WebAPIElementclassList
string.prototype.trim polyfill if (!"".trim) string.prototype.trim = function(){ return this.replace(/^[\s]+|[\s]+$/g, ''); }; (function(window){"use strict"; // prevent global namespace pollution if(!window.domexception) (domexception = function(reason){this.message = reason}).prototype = new error; var wsre = /[\11\12\14\15\40]/, wsindex = 0, checkifvalidclasslistentry = function(o, v) { if (v === "") throw new domexception( "failed to execute '" + o + "' on 'domtokenlist': the token provided must not be empty." ); if((wsindex=v.search(wsre))!==-1) throw new domexception("failed to execute '"+o+"' on 'domtokenlist': " + "the token provided ('"+v...
Element: fullscreenchange event - Web APIs
if document.fullscreenelement is null, the code logs a message that the change is to leave full-screen mode.
Element.onfullscreenchange - Web APIs
function togglefullscreen() { let elem = document.queryselector("video"); elem.onfullscreenchange = handlefullscreenchange; if (!document.fullscreenelement) { elem.requestfullscreen().then({}).catch(err => { alert(`error attempting to enable full-screen mode: ${err.message} (${err.name})`); }); } else { document.exitfullscreen(); } } function handlefullscreenchange(event) { let elem = event.target; let isfullscreen = document.fullscreenelement === elem; adjustmycontrols(isfullscreen); } specifications specification status comment fullscreen apithe definition of 'onfullscreenchange' in that specification.
ErrorEvent - Web APIs
errorevent.message read only is a domstring containing a human-readable error message describing the problem.
Event - Web APIs
WebAPIEvent
reinputevent beforeunloadevent blobevent clipboardevent closeevent compositionevent cssfontfaceloadevent customevent devicelightevent devicemotionevent deviceorientationevent deviceproximityevent domtransactionevent dragevent editingbeforeinputevent errorevent fetchevent focusevent gamepadevent hashchangeevent idbversionchangeevent inputevent keyboardevent mediastreamevent messageevent mouseevent mutationevent offlineaudiocompletionevent overconstrainederror pagetransitionevent paymentrequestupdateevent pointerevent popstateevent progressevent relatedevent rtcdatachannelevent rtcidentityerrorevent rtcidentityevent rtcpeerconnectioniceevent sensorevent storageevent svgevent svgzoomevent timeevent touchevent trackevent transitionevent uievent userprox...
Using Fetch - Web APIs
response.statustext — a string (default value "ok"), which corresponds to the http status code message.
FileException - Web APIs
when errors occur, forward them to the main app using postmessage() as in the following: function onerror(e) { postmessage('error:' + e.tostring()); } try { //error is thrown if "log.txt" already exists.
Introduction to the File and Directory Entries API - Web APIs
at minimum, handle the errors to provide error messages, so you'll have an idea of what's going on.
FullscreenOptions.navigationUI - Web APIs
let elem = document.documentelement; elem.requestfullscreen({ navigationui: "show" }).then({}).catch(err => { alert(`an error occurred while trying to switch into full-screen mode: ${err.message} (${err.name})`); }); the promise's resolve handler does nothing, but if the promise is rejected, an error message is displayed by calling alert().
Guide to the Fullscreen API - Web APIs
when a fullscreen request fails, firefox will log an error message to the web console explaining why the request failed.
Geolocation.clearWatch() - Web APIs
example var id, target, option; function success(pos) { var crd = pos.coords; if (target.latitude === crd.latitude && target.longitude === crd.longitude) { console.log('congratulation, you reach the target'); navigator.geolocation.clearwatch(id); } }; function error(err) { console.warn('error(' + err.code + '): ' + err.message); }; target = { latitude : 0, longitude: 0, } options = { enablehighaccuracy: false, timeout: 5000, maximumage: 0 }; id = navigator.geolocation.watchposition(success, error, options); specifications specification status comment geolocation api recommendation initial specification.
Geolocation.getCurrentPosition() - Web APIs
examples var options = { enablehighaccuracy: true, timeout: 5000, maximumage: 0 }; function success(pos) { var crd = pos.coords; console.log('your current position is:'); console.log(`latitude : ${crd.latitude}`); console.log(`longitude: ${crd.longitude}`); console.log(`more or less ${crd.accuracy} meters.`); } function error(err) { console.warn(`error(${err.code}): ${err.message}`); } navigator.geolocation.getcurrentposition(success, error, options); specifications specification status comment geolocation api recommendation initial specification.
Geolocation.watchPosition() - Web APIs
examples var id, target, options; function success(pos) { var crd = pos.coords; if (target.latitude === crd.latitude && target.longitude === crd.longitude) { console.log('congratulations, you reached the target'); navigator.geolocation.clearwatch(id); } } function error(err) { console.warn('error(' + err.code + '): ' + err.message); } target = { latitude : 0, longitude: 0 }; options = { enablehighaccuracy: false, timeout: 5000, maximumage: 0 }; id = navigator.geolocation.watchposition(success, error, options); specifications specification status comment geolocation apithe definition of 'watchposition()' in that specification.
GeolocationPositionError - Web APIs
geolocationpositionerror.message read only secure context returns a human-readable domstring describing the details of the error.
Geolocation API - Web APIs
geolocationpositionerror a geolocationpositionerror is returned by an unsuccessful call to one of the methods contained inside geolocation, inside an error callback, and contains an error code and message.
GlobalEventHandlers.onanimationcancel - Web APIs
result assembled together, you get this: if your browser supports animationcancel, hiding the box using the button will cause a message to be displayed about the event.
HTMLElement: animationstart event - Web APIs
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('animation started'); }; live example html <div class="animation-example"> <div...
HTMLElement.hidden - Web APIs
example here's an example where a hidden block is used to contain a thank you message that is displayed after a user agrees to an unusual request.
HTMLFrameSetElement - Web APIs
windoweventhandlers.onmessage is an eventhandler representing the code to be called when the message event is raised.
HTMLMediaElement: canplay event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.oncanplay specification html5 media examples these examples add an event listener for the htmlmediaelement's canplay event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: canplaythrough event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.oncanplaythrough specification html5 media examples these examples add an event listener for the htmlmediaelement's canplaythrough event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: durationchange event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.ondurationchange specification html5 media examples these examples add an event listener for the htmlmediaelement's durationchange event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: emptied event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onemptied specification html5 media examples these examples add an event listener for the htmlmediaelement's emptied event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: ended event - Web APIs
cancelable no interface event target element default action none event handler property globaleventhandlers.onended specification html5 media this event is also defined in media capture and streams and web audio api examples these examples add an event listener for the htmlmediaelement's ended event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement.error - Web APIs
var videoelement = document.createelement('video'); videoelement.onerror = function() { console.log("error " + videoelement.error.code + "; details: " + videoelement.error.message); } videoelement.src = "https://example.com/bogusvideo.mp4"; specifications specification status comment html living standardthe definition of 'htmlmediaelement.error' in that specification.
HTMLMediaElement: loadeddata event - Web APIs
examples these examples add an event listener for the htmlmediaelement's loadeddata event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: loadedmetadata event - Web APIs
examples these examples add an event listener for the htmlmediaelement's loadedmetadata event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: pause event - Web APIs
general info bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onpause specification html5 media examples these examples add an event listener for the htmlmediaelement's pause event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: play event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onplay specification html5 media examples these examples add an event listener for the htmlmediaelement's play event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: playing event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onplaying specification html5 media examples these examples add an event listener for the htmlmediaelement's playing event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: ratechange event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onratechange specification html5 media examples these examples add an event listener for the htmlmediaelement's ratechange event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: seeked event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onseeked specification html5 media examples these examples add an event listener for the htmlmediaelement's seeked event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: seeking event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onseeking specification html5 media examples these examples add an event listener for the htmlmediaelement's seeking event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: stalled event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onstalled specification html5 media examples these examples add an event listener for the htmlmediaelement's stalled event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: suspend event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onsuspend specification html5 media examples these examples add an event listener for the htmlmediaelement's suspend event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: timeupdate event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.ontimeupdate specification html5 media examples these examples add an event listener for the htmlmediaelement's timeupdate event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: volumechange event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onvolumechange specification html5 media examples these examples add an event listener for the htmlmediaelement's volumechange event, then post a message when that event handler has reacted to the event firing.
HTMLMediaElement: waiting event - Web APIs
bubbles no cancelable no interface event target element default action none event handler property globaleventhandlers.onwaiting specification html5 media examples these examples add an event listener for the htmlmediaelement's waiting event, then post a message when that event handler has reacted to the event firing.
HTMLVideoElement.msIsStereo3D - Web APIs
this uses metadata set in mp4 or mpeg-2 file containers and h.264 supplemental enhancement information (sei) messages to determine the stereo capability of the source.
The HTML DOM API - Web APIs
broadcastchannel dedicatedworkerglobalscope messagechannel messageevent messageport sharedworker sharedworkerglobalscope worker workerglobalscope workerlocation workernavigator websocket interfaces these interfaces, defined by the html specification, are used by the websockets_api.
IDBDatabaseException - Web APIs
message domstring error message describing the exception raised.
MediaDeviceInfo - Web APIs
navigator.mediadevices.enumeratedevices() .then(function(devices) { devices.foreach(function(device) { console.log(device.kind + ": " + device.label + " id = " + device.deviceid); }); }) .catch(function(err) { console.log(err.name + ": " + err.message); }); this might produce: videoinput: id = cso9c0ypaf274oucpua53cne0yhlir2yxci+sqfbzz8= audioinput: id = rkxxbyjnabbadgqnnzqlvldmxls0yketycibg+xxnvm= audioinput: id = r2/xw1xupiyzunfv1lgrkoma5wtovckwfz368xcndm0= or if one or more media streams are active, or if persistent permissions have been granted: videoinput: facetime hd camera (built-in) id=cso9c0ypaf274oucpua53cne0yhlir2yxci+sqfbzz8= ...
MediaDevices.enumerateDevices() - Web APIs
navigator.mediadevices.enumeratedevices() .then(function(devices) { devices.foreach(function(device) { console.log(device.kind + ": " + device.label + " id = " + device.deviceid); }); }) .catch(function(err) { console.log(err.name + ": " + err.message); }); this might produce: videoinput: id = cso9c0ypaf274oucpua53cne0yhlir2yxci+sqfbzz8= audioinput: id = rkxxbyjnabbadgqnnzqlvldmxls0yketycibg+xxnvm= audioinput: id = r2/xw1xupiyzunfv1lgrkoma5wtovckwfz368xcndm0= or if one or more mediastreams are active or persistent permissions are granted: videoinput: facetime hd camera (built-in) id=cso9c0ypaf274oucpua53cne0yhlir2yxci+sqfbzz8= audioinput...
MediaDevices.ondevicechange - Web APIs
tbyid("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)); }, false); we set up global variables that contain references to the <ul> elements that are used to list the audio and video devices: let audiolist = document.getelementbyid("audiolist"); let videolist = document.getelementbyid("videolist"); getting and drawing the device list now let's take a look at updatedevicelist() itself.
update() - Web APIs
the mediakeysession.update() method loads messages and licenses to the cdm, and then returns a promise .
createSession() - Web APIs
the mediakeys.createsession() method returns a new mediakeysession object, which represents a context for message exchange with a content decryption module (cdm).
setServerCertificate() - Web APIs
the mediakeys.setservercertificate() method a promise to a server certificate to be used to encrypt messages to the license server.
MediaRecorder.mimeType - Web APIs
}) .catch(function(error) { console.log(error.message); }); changing line 14 to the following causes mediarecorder to try to use avc constrained baseline profile level 4 for video and aac-lc (low complexity) for audio, which is good for mobile and other possible resource-constrained situations.
MediaRecorderErrorEvent.error - Web APIs
the message atttribute should provide additional information, if it exists.
MediaSource.endOfStream() - Web APIs
when you make an xmlhttprequest call for a media chunk, and onabort or onerror triggers, you might want to call endofstream('network'), display a descriptive message in the ui, and maybe retry the network request immediately or wait until the network is back up (via some kind of polling.) decode: terminates playback and signals that a decoding error has occured.
Recording a media element - Web APIs
lines 6-7 starts the recording process by calling recorder.start(), and outputs a message to the log with the updated state of the recorder and the number of seconds it will be recording.
NDEFReader() - Web APIs
the ndefreader() constructor of the web nfc api returns a newly constructed ndefreader object used to read ndef messages from compatiable nfc devices, e.g.
NDEFReadingEvent - Web APIs
ndefreadingevent.message read only represents the received message as an ndefmessage object.
NDEFWriter() - Web APIs
the ndefwriter() constructor of the web nfc api returns a newly constructed ndefwriter object used to write ndef messages to compatiable nfc devices, e.g.
NDEFWriter - Web APIs
methods ndefwriter.write() called to write ndef message to a tag (after ensuring hardware and ua compatibility and obtaining permission from the user) or get an error explaining why feature is not available.
Navigator.registerProtocolHandler() - Web APIs
for example, you can register to handle sms text message links by passing the "sms" scheme.
Node.nodeType - Web APIs
WebAPINodenodeType
=== node.document_type_node; // true document.createdocumentfragment().nodetype === node.document_fragment_node; // true var p = document.createelement("p"); p.textcontent = "once upon a time…"; p.nodetype === node.element_node; // true p.firstchild.nodetype === node.text_node; // true comments this example checks if the first node inside the document element is a comment, and displays a message if not.
Notification.timestamp - Web APIs
for example, a timestamp for an upcoming meeting could be set in the future, whereas a timestamp for a missed message could be set in the past.
OverconstrainedError.OverconstrainedError() - Web APIs
message text for the error's message property.
OverconstrainedError - Web APIs
overconstrainederror.message read only returns the text supplied in the constructor.
PayerErrors - Web APIs
if this property is absent, the paer name is fine phone optional if present, this string is an error message explaining why the payer's phone number (paymentresponse.payerphone) failed validation.
PaymentDetailsUpdate.shippingAddressErrors - Web APIs
the paymentdetailsupdate dictionary's shippingaddresserrors property, if present, contains an addresserrors object whose contents provide error messages for one or more of the values in the paymentaddress specified as paymentrequest.shippingaddress.
PaymentRequest.onshippingaddresschange - Web APIs
}).catch(function(err) { console.error("uh oh, something bad happened", err.message); }); specifications specification status comment payment request apithe definition of 'onshippingaddresschange' in that specification.
PaymentRequest.shippingAddress - Web APIs
}).catch(function(err) { console.error("uh oh, something bad happened", err.message); }); function updatedetails(details, shippingaddress, resolve) { if (shippingaddress.country === 'us') { var shippingoption = { id: '', label: '', amount: {currency: 'usd', value: '0.00'}, selected: true }; if (shippingaddress.region === 'mo') { shippingoption.id = 'mo'; shippingoption.label = 'free shipping in missouri'; details.total.amo...
PaymentRequest.show() - Web APIs
// paymentresponse.methodname contains the selected payment method // paymentresponse.details contains a payment method specific response await response.complete("success"); } catch (err) { console.error("uh oh, something bad happened", err.message); } } the following example shows how to update the payment sheet as it's being presented to the end-user.
PaymentResponse.complete() - Web APIs
mentrequest = new request('secure/payment/endpoint'); fetch(serverpaymentrequest, fetchoptions).then( response => { if (response.status < 400) { paymentresponse.complete("success"); } else { paymentresponse.complete("fail"); }; }).catch( reason => { paymentresponse.complete("fail"); }); }).catch(function(err) { console.error("uh oh, something bad happened", err.message); }); specifications specification status comment payment request apithe definition of 'paymentresponse: complete' in that specification.
PaymentResponse.details - Web APIs
the details read-only property of the paymentresponse interface returns a json-serializable object that provides a payment method specific message used by the merchant to process the transaction and determine a successful funds transfer.
PaymentResponse: payerdetailchange event - Web APIs
if any are invalid, appropriate error messages should be configured and the retry() method should be called on the paymentresponse to ask the user to update the invalid entries.
PaymentResponse.shippingAddress - Web APIs
}).catch(function(err) { console.error("uh oh, something bad happened", err.message); }); function updatedetails(details, shippingaddress, resolve) { if (shippingaddress.country === 'us') { var shippingoption = { id: '', label: '', amount: {currency: 'usd', value: '0.00'}, selected: true }; if (shippingaddress.region === 'mo') { shippingoption.id = 'mo'; shippingoption.label = 'free shipping in missouri'; details.total.amo...
PaymentResponse.shippingOption - Web APIs
}).catch(function(err) { console.error("uh oh, something bad happened", err.message); }); function updatedetails(details, shippingoption, resolve, reject) { var selectedshippingoption; var othershippingoption; if (shippingoption === 'standard') { selectedshippingoption = details.shippingoptions[0]; othershippingoption = details.shippingoptions[1]; details.total.amount.value = '55.00'; } else if (shippingoption === 'express') { selectedshippingoption = de...
PaymentResponse - Web APIs
properties paymentresponse.details read only secure context returns a json-serializable object that provides a payment method specific message used by the merchant to process the transaction and determine successful fund transfer.
Payment Request API - Web APIs
basiccarderrors an object providing any error messages associated with the fields in the basiccardresponse object that are not valid.
PerformanceObserver.observe() - Web APIs
unrecognized types are ignored, though the browser may output a warning message to the console to help developers debug their code.
PerformanceResourceTiming - Web APIs
performanceresourcetiming.decodedbodysizeread only a number that is the size (in octets) received from the fetch (http or cache) of the message body, after removing any applied content-codings.
PushEvent.PushEvent() - Web APIs
when the constructor is invoked, the pushevent.data property of the resulting object will be set to a new pushmessagedata object containing bytes extracted from the eventinitdict data member.
PushManager.supportedContentEncodings - Web APIs
the supportedcontentencodings read-only property of the pushmanager interface returns an array of supported content codings that can be used to encrypt the payload of a push message.
PushManager - Web APIs
properties pushmanager.supportedcontentencodings returns an array of supported content codings that can be used to encrypt the payload of a push message.
PushSubscription - Web APIs
methods pushsubscription.getkey() returns an arraybuffer which contains the client's public key, which can then be sent to a server and used in encrypting push message data.
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.
RTCDataChannel.ordered - Web APIs
the read-only rtcdatachannel property ordered indicates whether or not the data channel guarantees in-order delivery of messages; the default is true, which indicates that the data channel is indeed ordered.
RTCDataChannelEvent.channel - Web APIs
pc.ondatachannel = function(event) { inbounddatachannel = event.channel; inbounddatachannel.onmessage = handleincomingmessage; inbounddatachannel.onopen = handlechannelopen; inbounddatachannel.onclose = handlechannelclose; } specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcdatachannelevent.channel' in that specification.
RTCDataChannelEvent - Web APIs
pc.ondatachannel = function(event) { inbounddatachannel = event.channel; inbounddatachannel.onmessage = handleincomingmessage; inbounddatachannel.onopen = handlechannelopen; inbounddatachannel.onclose = handlechannelclose; } see a simple rtcdatachannel sample for another, more complete, example of how to use data channels.
RTCIceCandidate.RTCIceCandidate() - Web APIs
the default value of candidate is the empty string, which indicates that the candidate is an "end-of-candidates" message.
RTCIceCandidate - Web APIs
usernamefragment read only a domstring containing a randomly-generated username fragment ("ice-ufrag") which ice uses for message integrity along with a randomly-generated password ("ice-pwd").
RTCInboundRtpStreamStats.pliCount - Web APIs
however, the primary purpose of this message is to allow the sender to consider techniques to mitigate network performance issues.
RTCOfferOptions.iceRestart - Web APIs
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.
RTCPeerConnection.addTrack() - Web APIs
it comes from the handlevideooffermsg() method there, which is called when an offer message is received from the remote peer.
RTCPeerConnection.canTrickleIceCandidates - Web APIs
er => pc.setlocaldescription(answer)) .then(_ => if (pc.cantrickleicecandidates) { return pc.localdescription; } return new promise(r => { pc.addeventlistener('icegatheringstatechange', e => { if (e.target.icegatheringstate === 'complete') { r(pc.localdescription); } }); }); }) .then(answer => sendanswertopeer(answer)) // signaling message .catch(e => handleerror(e)); pc.addeventlistener('icecandidate', e => { if (pc.cantrickleicecandidates) { sendcandidatetopeer(e.candidate); // signaling message } }); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.cantrickleicecandidates' in that specification.
RTCPeerConnection.close() - Web APIs
example var pc = new rtcpeerconnection(); var dc = pc.createdatachannel("my channel"); dc.onmessage = function (event) { console.log("received: " + event.data); pc.close(); // we decided to close after the first received message }; dc.onopen = function () { console.log("datachannel open"); }; dc.onclose = function () { console.log("datachannel close"); }; specifications specification status comment webrtc 1.0: real-time communication between browsersthe d...
RTCPeerConnection: connectionstatechange event - Web APIs
bubbles no cancelable no interface event event handler onconnectionstatechange examples for an rtcpeerconnection, pc, this example sets up a handler for connectionstatechange messages to handle changes to the connectivity of the webrtc session.
RTCPeerConnection.createOffer() - Web APIs
in this case, a websocket connection is used to send a json message with a type field with the value "video-offer" to the other peer.
RTCPeerConnection: icecandidateerror event - Web APIs
when this happens, the server url and the error message are passed to a function called reportconnectfail() to log or output the connection failure.
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.
RTCPeerConnection.sctp - Web APIs
example var pc = new rtcpeerconnection(); var channel = pc.createdatachannel("mydata"); channel.onopen = function(event) { channel.send('sending a message'); } channel.onmessage = function(event) { console.log(event.data); } // determine the largest message size that can be sent var sctp = pc.sctp; var maxmessagesize = sctp.maxmessagesize; specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcpeerconnection.sctp' in that specification.
RTCPeerConnection.setRemoteDescription() - Web APIs
{ return mypeerconnection.createanswer(); }) .then(function(answer) { return mypeerconnection.setlocaldescription(answer); }) .then(function() { // send the answer to the remote peer using the signaling server }) .catch(handlegetusermediaerror); } after creating our rtcpeerconnection and saving it as mypeerconnection, we pass the description included in the received offer message, msg, directly into setremotedescription() to tell the user agent's webrtc layer what configuration the caller has proposed using.
RTCPeerConnection.signalingState - Web APIs
because the signaling process is a state machine, being able to verify that your code is in the expected state when messages arrive can help avoid unexpected and avoidable failures.
RTCPeerConnection - Web APIs
this happens whenever the local ice agent needs to deliver a message to the other peer through the signaling server.oniceconnectionstatechange the rtcpeerconnection.oniceconnectionstatechange property is an event handler which specifies a function to be called when the iceconnectionstatechange event is fired on an rtcpeerconnection instance.
RTCRemoteOutboundRtpStreamStats.remoteTimestamp - Web APIs
if this property is present, it comes from the rtcp sender report (sr) block, which reflects the clock on the remote peer at the time the message was sent.
RTCRtcpParameters - Web APIs
this is used, for example, in sdes (sdp security descriptions) messages, described in rfc 4568.
RTCRtpTransceiver.stop() - Web APIs
usage notes when you call stop() on a transceiver, the sender immediately stops sending media and each of its rtp streams are closed using the rtcp "bye" message.
RTCSessionDescription() - Web APIs
sdp a string containing a sdp message describing the session.
RTCSessionDescription.sdp - Web APIs
syntax var value = sessiondescription.sdp; sessiondescription.sdp = value; value the value is a domstring containing an sdp message like this one: v=0 o=alice 2890844526 2890844526 in ip4 host.anywhere.com s= c=in ip4 host.anywhere.com t=0 0 m=audio 49170 rtp/avp 0 a=rtpmap:0 pcmu/8000 m=video 51372 rtp/avp 31 a=rtpmap:31 h261/90000 m=video 53000 rtp/avp 32 a=rtpmap:32 mpv/90000 example // the remote description has been set previously on pc, an rtcpeerconnection alert(pc.remotedescription.sdp); specifications specification status comment webrtc 1.0: real-time communication between browsersthe definition of 'rtcsessiondescription.sdp...
RTCSessionDescription.toJSON() - Web APIs
"sdp", containing a domstring, or null, with the sdp message corresponding to rtcsessiondescription.sdp property.
ReadableStreamDefaultReader.closed - Web APIs
when it is closed, the promise fulfills and the message is logged to the console.
Request.cache - Web APIs
WebAPIRequestcache
// in reality; this would be a function that takes a path and a // reference to the controller since it would need to change the value let controller = new abortcontroller(); fetch("some.json", {cache: "only-if-cached", mode: "same-origin", signal: controller.signal}) .catch(e => e instanceof typeerror && e.message === "failed to fetch" ?
Using the Resource Timing API - Web APIs
decodedbodysize returns the size (in octets) received from the fetch (http or cache) of the message body, after removing any applied content-codings.
Resource Timing API - Web APIs
decodedbodysize returns the size (in octets) received from the fetch (http or cache) of the message body, after removing any applied content-codings.
Response() - Web APIs
WebAPIResponseResponse
statustext: the status message associated with the status code, e.g., ok.
Response.statusText - Web APIs
the statustext read-only property of the response interface contains the status message corresponding to the status code (e.g., ok for 200).
Response - Web APIs
WebAPIResponse
response.statustext read only the status message corresponding to the status code.
Screen Wake Lock API - Web APIs
sync function to request a wake lock const requestwakelock = async () => { try { wakelock = await navigator.wakelock.request('screen'); // change up our interface to reflect wake lock active statuselem.textcontent = 'wake lock is active!'; } catch (err) { // if wake lock request fails - usually system related, such as battery statuselem.textcontent = `${err.name}, ${err.message}`; } } releasing wake lock the following example shows how to release the previously acquired wake lock.
Selection.containsNode() - Web APIs
console.log(window.getselection().containsnode(document.body, true)); find the hidden word in this example, a message appears when you select the secret word.
Selection.setBaseAndExtent() - Web APIs
telementbyid('foffset'); var button = document.queryselector('button'); var output = document.queryselector('.output'); var selection; button.onclick = function() { try { selection = document.getselection(); selection.setbaseandextent(one, aoffset.value, two, foffset.value); var text = selection.tostring(); output.textcontent = text; } catch(e) { output.textcontent = e.message; } } play with the live example below, setting different offset values to see how this affects the selection.
Sensor APIs - 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.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.
ServiceWorkerContainer.onerror - Web APIs
} example navigator.serviceworker.onerror = function(errorevent) { console.log(`received error message: ${errorevent.message}`); } ...
ServiceWorkerGlobalScope.onpushsubscriptionchange - Web APIs
this offers an opportunity to resubscribe in order to continue receiving push messages, if desired.
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.
Using Service Workers - Web APIs
note: as of firefox 44, when appcache is used to provide offline support for a page a warning message is now displayed in the console advising developers to use service workers instead (bug 1204581.) service workers should finally fix these issues.
SharedWorker() - Web APIs
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 our basic shared worker example (run shared ...
SpeechRecognitionError.error - Web APIs
examples var recognition = new speechrecognition(); recognition.onerror = function(event) { console.log('speech recognition error detected: ' + event.error); console.log('additional information: ' + event.message); } ...
SpeechRecognitionErrorEvent.error - Web APIs
examples var recognition = new speechrecognition(); recognition.onerror = function(event) { console.log('speech recognition error detected: ' + event.error); console.log('additional information: ' + event.message); } specifications specification status comment web speech apithe definition of 'error' in that specification.
SubmitEvent.submitter - Web APIs
let form = document.queryselector("form"); form.addeventlistener("submit", (event) => { let submitter = event.submitter; let handler = submitter.id; if (handler) { processorder(form, handler); } else { showalertmessage("an unknown or unaccepted payment type was selected.
SubmitEvent - Web APIs
let form = document.queryselector("form"); form.addeventlistener("submit", (event) => { let submitter = event.submitter; let handler = submitter.id; if (handler) { processorder(form, handler); } else { showalertmessage("an unknown or unaccepted payment type was selected.
TrackEvent - Web APIs
xt"; } else { trackkind = "unknown"; } switch(event.type) { case "addtrack": console.log("added a " + trackkind + " track"); break; case "removetrack": console.log("removed a " + trackkind + " track"); break; } } the event handler uses the javascript instanceof operator to determine which type of track the event occurred on, then outputs to console a message indicating what kind of track it is and whether it's being added to or removed from the element.
URL API - Web APIs
WebAPIURL API
you can also look up the values of individual parameters with the urlsearchparams object's get() method: let addr = new url("https://mysite.com/login?user=someguy&page=news"); try { loginuser(addr.searchparams.get("user")); gotopage(addr.searchparams.get("page")); } catch(err) { showerrormessage(err); } for example, in the above snippet, the username and target page are taken from the query and passed to appropriate functions that are used by the site's code to log in and route the user to their desired destination within the site.
ValidityState - Web APIs
customerror read only a boolean indicating whether the element's custom validity message has been set to a non-empty string by calling the element's setcustomvalidity() method.
WakeLock.request() - Web APIs
WebAPIWakeLockrequest
const requestwakelock = async () => { try { const wakelock = await navigator.wakelock.request('screen'); } catch (err) { // the wake lock request fails - usually system related, such low as battery console.log(`${err.name}, ${err.message}`); } } requestwakelock(); specifications specification status comment screen wake lock apithe definition of 'request()' in that specification.
WakeLock - Web APIs
WebAPIWakeLock
const requestwakelock = async () => { try { const wakelock = await navigator.wakelock.request('screen'); } catch (err) { // the wake lock request fails - usually system related, such low as battery console.log(`${err.name}, ${err.message}`); } } requestwakelock(); specifications specification status comment screen wake lock apithe definition of 'wakelock' in that specification.
WebGLContextEvent - Web APIs
webglcontextevent.statusmessage a read-only property containing additional information about the event.
WebGLRenderingContext.getProgramInfoLog() - Web APIs
return value a domstring that contains diagnostic messages, warning messages, and other information about the last linking or validation operation.
WebGLRenderingContext.makeXRCompatible() - Web APIs
*/ outputcanvas.addeventlistener("webglcontextrestored", (event) => { loadsceneresources(currentscene); }); async function onstartedxrsession(xrsession) { try { await gl.makexrcompatible(); } catch(err) { switch(err) { case aborterror: showsimplemessagebox("unable to transfer the game to your xr headset.", "cancel"); break; case invalidstateerror: showsimplemessagebox("you don't appear to have a compatible xr headset available.", "cancel"); break; default: handlefatalerror(err); break; } xrsession.end(); } } async function handlestartbuttonclick(event) { if (event.target.classlist.
Getting started with WebGL - Web APIs
if the browser does not support webgl, getcontext() will return null in which case we display a message to the user and exit.
WebRTC connectivity - Web APIs
this message does not need to be sent to the remote peer.
Using bounded reference spaces - Web APIs
as the user grows close to the boundary, you might warn them by displaying a message, flashing a warning indicator, playing an audio warning, or the like.
Fundamentals of WebXR - Web APIs
if you have any content that may be of risk to any users, you should provide a warning message.
Web Speech API - Web APIs
speechrecognitionerror represents error messages from the recognition service.
Functions and classes available to Web Workers - Web APIs
unknown no postmessage() yes, on dedicatedworkerglobalscope no no unknown no apis available in workers function functionality support in gecko (firefox) support in ie support in blink (chrome and opera) support in webkit (safari) broadcast channel api allows simple communication between browsing contexts (that is windows, tabs, frames, or iframes) with the same...
The structured clone algorithm - Web APIs
it is used internally to transfer data between workers via postmessage(), storing objects with indexeddb, or copying objects for other apis.
Window: animationstart event - Web APIs
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.
Window: beforeunload event - Web APIs
some browsers used to display the returned string in the confirmation dialog, enabling the event handler to display a custom message to the user.
Window: error event - Web APIs
r; justify-content: center; } .event-log { grid-area: log; } .event-log-contents { resize: none; } label, button { display: block; } button { height: 2rem; margin: .5rem; } img { width: 0; height: 0; } js const log = document.queryselector('.event-log-contents'); window.addeventlistener('error', (event) => { log.textcontent = log.textcontent + `${event.type}: ${event.message}\n`; console.log(event) }); const scripterror = document.queryselector('#script-error'); scripterror.addeventlistener('click', () => { const badcode = 'const s;'; eval(badcode); }); result specifications specification status ui events working draft ...
Window: load event - Web APIs
WebAPIWindowload event
bubbles no cancelable no interface event event handler property onload examples log a message when the page is fully loaded: window.addeventlistener('load', (event) => { console.log('page is fully loaded'); }); the same, but using the onload event handler property: window.onload = (event) => { console.log('page is fully loaded'); }; live example html <div class="controls"> <button id="reload" type="button">reload</button> </div> <div class="event-log"> <label>event log:</l...
Window.name - Web APIs
WebAPIWindowname
modern web applications hosting sensitive data should, however, not rely on window.name for cross-domain messaging but instead utilize the postmessage api.
Window: unhandledrejection event - Web APIs
bubbles no cancelable yes interface promiserejectionevent event handler property onunhandledrejection usage notes allowing the unhandledrejection event to bubble will eventually result in an error message being output to the console.
Window: unload event - Web APIs
window.addeventlistener('beforeunload', function(event) { console.log('i am the 2nd one.'); }); window.addeventlistener('unload', function(event) { console.log('i am the 4th and last one…'); }); </script> </head> <body> ☻ </body> </html> when the parent frame is unloaded, events will be fired in the order described by the console.log() messages.
WindowEventHandlers.onhashchange - Web APIs
if it equals #cool-feature, the script logs a message to the console.
WindowOrWorkerGlobalScope.crossOriginIsolated - Web APIs
the crossoriginisolated read-only property of the windoworworkerglobalscope interface returns a boolean value that indicates whether a sharedarraybuffer can be sent via a window.postmessage() call.
WindowOrWorkerGlobalScope.origin - Web APIs
examples executed from inside a worker script, the following snippet will log the worker's global scope's origin to the console each time it receives a message onmessage = function() { console.log(self.origin); }; if the origin is not a scheme/host/port tuple (say you are trying to run it locally, i.e.
WindowOrWorkerGlobalScope.setTimeout() - Web APIs
to implement a 0 ms timeout in a modern browser, you can use window.postmessage() as described here.
WindowOrWorkerGlobalScope - Web APIs
windoworworkerglobalscope.crossoriginisolated read only returns a boolean value that indicates whether a sharedarraybuffer can be sent via a window.postmessage() call.
Worker() - Web APIs
WebAPIWorkerWorker
examples the following code snippet shows creation of a worker object using the worker() constructor and subsequent usage of the object: var myworker = new worker('worker.js'); first.onchange = function() { myworker.postmessage([first.value,second.value]); console.log('message posted to worker'); } for a full example, see our basic dedicated worker example (run dedicated worker).
WorkerGlobalScope.console - Web APIs
so for example you could call console.log('test'); inside a worker (which would basically be the equivalent of self.console.log('test');, as these are being called on the worker scope, which can be referenced with workerglobalscope.self), to return a test message out to the browser console.
WorkerGlobalScope - Web APIs
for example: importscripts('foo.js', 'bar.js'); non-standard methods workerglobalscope.dump() allows you to write a message to stdout — i.e.
WritableStreamDefaultWriter.ready - Web APIs
function sendmessage(message, writablestream) { // defaultwriter is of type writablestreamdefaultwriter var defaultwriter = writablestream.getwriter(); var encoder = new textencoder(); var encoded = encoder.encode(message, {stream: true}); encoded.foreach(function(chunk) { // make sure the stream and its writer are able to // receive data.
How to check the security state of an XMLHTTPRequest over SSL - Web APIs
== ci.nsiwebprogresslistener.state_is_insecure) { dump("insecure connection\n"); } else if ((secinfo.securitystate & ci.nsiwebprogresslistener.state_is_broken) == ci.nsiwebprogresslistener.state_is_broken) { dump("unknown\n"); dump("\tsecurity description: " + secinfo.shortsecuritydescription + "\n"); dump("\tsecurity error message: " + secinfo.errormessage + "\n"); } } else { dump("\tno security info available for this channel\n"); } // print ssl certificate details if (secinfo instanceof ci.nsisslstatusprovider) { var cert = secinfo.queryinterface(ci.nsisslstatusprovider) .sslstatus.queryinterface(ci.nsisslstatus).servercert; dump("\tcommon name...
Using XMLHttpRequest - Web APIs
xt" name="lastname" /> </p> <p> <input type="submit" value="submit" /> </p> </fieldset> </form> <h3>enctype: text/plain</h3> <form action="register.php" method="post" enctype="text/plain" onsubmit="ajaxsubmit(this); return false;"> <fieldset> <legend>registration example</legend> <p> your name: <input type="text" name="user" /> </p> <p> your message:<br /> <textarea name="message" cols="40" rows="8"></textarea> </p> <p> <input type="submit" value="submit" /> </p> </fieldset> </form> <h3>enctype: multipart/form-data</h3> <form action="register.php" method="post" enctype="multipart/form-data" onsubmit="ajaxsubmit(this); return false;"> <fieldset> <legend>upload example</legend> <p> first name: <i...
XMLHttpRequest.sendAsBinary() - Web APIs
however, on google chrome, when you try to send an arraybuffer, the following warning message will appear: arraybuffer is deprecated in xmlhttprequest.send().
XMLHttpRequest.statusText - Web APIs
the read-only xmlhttprequest.statustext property returns a domstring containing the response's status message as returned by the http server.
ARIA live regions - Accessibility
alert error or warning message that flashes on the screen.
Using the aria-invalid attribute - Accessibility
(aid, asearchterm, amsg){ var elem = document.getelementbyid(aid); var invalid = (elem.value.indexof(asearchterm) < 0); if (invalid) { elem.setattribute("aria-invalid", "true"); updatealert(amsg); } else { elem.setattribute("aria-invalid", "false"); updatealert(); } } the snippet below shows the alert functions, which add (or remove) the error message: function updatealert(msg) { var oldalert = document.getelementbyid("alert"); if (oldalert) { document.body.removechild(oldalert); } if (msg) { var newalert = document.createelement("div"); newalert.setattribute("role", "alert"); newalert.setattribute("id", "alert"); var content = document.createtextnode(msg); newalert.appendchild(c...
ARIA: dialog role - Accessibility
for dialogs that only provide a basic message, it could be an "ok" button.
Basic form hints - Accessibility
the form entry would look something like this: var validate = function () { var emailelement = document.getelementbyid(emailfieldid); var valid = emailvalid(formdata.email); // returns true if valid, false otherwise emailelement.setattribute("aria-invalid", !valid); setelementbordercolour(emailelement, valid); // sets the border to red if second arg is false }; providing helpful error messages read how to use aria alerts to enhance forms.
Forms - Accessibility
the following pages provide various techniques for improving the accessibility of web forms: basic form hints: adding hints and descriptions for invalid or required fields alerts: using alerts to provide client-side validation error messages multi-part labels: enabling complex form labels with a control inside each label see also the yahoo!
ARIA - Accessibility
for example, aria enables accessible navigation landmarks in html4, javascript widgets, form hints and error messages, live content updates, and more.
Coordinate systems - CSS: Cascading Style Sheets
whenever the mouse enters, moves around inside, or exits the inner box, the corresponding event is handled by updating a set of informational messages within the box, listing out the current mouse coordinates in each of the four available coordinate systems.
animation - CSS: Cascading Style Sheets
WebCSSanimation
alue_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 cylon eye <div class="view_port"> <div class="polling_message"> listening for dispatches </div> <div class="cylon_eye"></div> </div> .polling_message { color: white; float: left; margin-right: 2%; } .view_port { background-color: black; height: 25px; width: 100%; overflow: hidden; } .cylon_eye { background-color: red; background-image: linear-gradient(to right, rgba(0, 0, 0, .9) 25%, rgba(0, 0, 0, .1) 50%, rgb...
<color> - CSS: Cascading Style Sheets
the wcag 2.0 recommendation strongly advises against using color as the only means of conveying a specific message, action, or result.
overscroll-behavior-y - CSS: Cascading Style Sheets
formal definition initial valueautoapplies tonon-replaced block-level elements and non-replaced inline-block elementsinheritednocomputed valueas specifiedanimation typediscrete formal syntax contain | none | auto examples preventing an underlying element from scrolling vertically .messages { height: 220px; overflow: auto; overscroll-behavior-y: contain; } see overscroll-behavior for a full example and explanation.
overscroll-behavior - CSS: Cascading Style Sheets
this can be stopped using overscroll-behavior-y (overscroll-behavior would also work) on the chat window, like this: .messages { height: 220px; overflow: auto; overscroll-behavior-y: contain; } we also wanted to get rid of the standard overscroll effects when the contacts are scrolled to the top or bottom (e.g.
Creating a cross-browser video player - Developer guides
when a video goes into fullscreen mode, it usually displays a message indicating that the user can press the esc key to exit fullscreen mode, so the code also needs to listen for relevant events in order to call the setfullscreendata() function to ensure the control styling is correct: document.addeventlistener('fullscreenchange', function(e) { setfullscreendata(!!(document.fullscreen || document.fullscreenelement)); }); document.addeventlistener('webkitfullscr...
Audio and Video Delivery - Developer guides
der.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); }); see mediarecorder api for more details.
DOM onevent handlers - Developer guides
note that the event parameter actually contains the error message as a string.
Index - Developer guides
WebGuideIndex
if you need to slightly alter the site’s message for mobile users, but want to reap the benefits of a responsive design, a hybrid approach may be your best bet.
A hybrid approach - Developer guides
if you need to slightly alter the site’s message for mobile users, but want to reap the benefits of a responsive design, a hybrid approach may be your best bet.
Parsing and serializing XML - Developer guides
parsing strings into dom trees this example converts an xml fragment in a string into a dom tree using a domparser: var smystring = '<a id="a"><b id="b">hey!</b></a>'; var oparser = new domparser(); var odom = oparser.parsefromstring(smystring, "application/xml"); // print the name of the root element or error message console.log(odom.documentelement.nodename == "parsererror" ?
HTML attribute: minlength - HTML: Hypertext Markup Language
once submission fails, some browsers will display an error message indicating the minimum length required and the current length.
HTML attribute: readonly - HTML: Hypertext Markup Language
t type="date" value="2020-01-01" readonly="readonly"/> <label>date</label> </div> <div class="group"> <input type="email" value="some value" readonly="readonly"/> <label>email</label> </div> <div class="group"> <input type="password" value="some value" readonly="readonly"/> <label>password</label> </div> <div class="group"> <textarea readonly="readonly">some value</textarea> <label>message</label> </div> result examples <fieldset> <legend>checkboxes buttons</legend> <p><label> <input type="checkbox" name="chbox" value="regular"> regular </label></p> <p><label> <input type="checkbox" name="chbox" value="readonly" readonly> readonly </label></p> <p><label> <input type="checkbox" name="chbox" value="disabled" disabled> disabled </label></p> </fieldset>...
<a>: The Anchor element - HTML: Hypertext Markup Language
WebHTMLElementa
linking to an email address to create links that open in the user's email program to let them send a new message, use the mailto: scheme: <a href="mailto:nowhere@mozilla.org">send email to nowhere</a> for details about mailto: urls, such as including a subject or body, see email links or rfc 6068.
<blockquote>: The Block Quotation element - HTML: Hypertext Markup Language
cite a url that designates a source document or message for the information quoted.
<body>: The Document Body element - HTML: Hypertext Markup Language
WebHTMLElementbody
onmessage function to call when the document has received a message.
<iframe>: The Inline Frame element - HTML: Hypertext Markup Language
WebHTMLElementiframe
cross-origin communication can be achieved using window.postmessage().
<input type="datetime-local"> - HTML: Hypertext Markup Language
te" min="2017-06-01t08:30" max="2017-06-30t16:30" pattern="[0-9]{4}-[0-9]{2}-[0-9]{2}t[0-9]{2}:[0-9]{2}" required> <span class="validity"></span> </div> <div> <input type="submit" value="book party!"> </div> <input type="hidden" id="timezone" name="timezone" value="-08:00"> </form> if you try submitting it, you'll see that the browser now displays an error message (and highlights the input as invalid) if your entry doesn't match the pattern nnnn-nn-nntnn:nn, where n is a number from 0 to 9.
<input type="month"> - HTML: Hypertext Markup Language
WebHTMLElementinputmonth
(summer months only, yyyy-mm)</label> <input id="month" type="month" name="month" min="2017-06" max="2017-09" required pattern="[0-9]{4}-[0-9]{2}"> <span class="validity"></span> </div> <div> <input type="submit" value="submit form"> </div> </form> if you try submitting it, you'll see that the browser now displays an error message (and highlights the input as invalid) if your entry doesn't match the pattern nnnn-nn, where n is a number from 0 to 9.
<input type="password"> - HTML: Hypertext Markup Language
WebHTMLElementinputpassword
it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message.
<input type="tel"> - HTML: Hypertext Markup Language
WebHTMLElementinputtel
it should be a word or short phrase that demonstrates the expected type of data, rather than an explanatory message.
<input type="time"> - HTML: Hypertext Markup Language
WebHTMLElementinputtime
intment time (opening hours 12:00 to 18:00): </label> <input id="appt-time" type="time" name="appt-time" min="12:00" max="18:00" required pattern="[0-9]{2}:[0-9]{2}"> <span class="validity"></span> </div> <div> <input type="submit" value="submit form"> </div> </form> if you try submitting it, you'll see that non-supporting browsers now display an error message (and highlight the input as invalid) if your entry doesn't match the pattern nn:nn, where n is a number from 0 to 9.
<noembed>: The Embed Fallback element (Obsolete) - HTML: Hypertext Markup Language
WebHTMLElementnoembed
examples the message inside <noembed> tag will appear only when your browser does not support <embed> tag.
<object> - HTML: Hypertext Markup Language
WebHTMLElementobject
standbyhtml 4 onlyobsolete since html5 a message that the browser can show while loading the object's implementation and data.
<q>: The Inline Quotation element - HTML: Hypertext Markup Language
WebHTMLElementq
cite the value of this attribute is a url that designates a source document or message for the information quoted.
<video>: The Video Embed element - HTML: Hypertext Markup Language
WebHTMLElementvideo
a fallback message is displayed if the video element isn't supported, but not if all sources fail.
HTTP authentication - HTTP
this could be a message like "access to the staging site" or similar, so that the user knows to which space they are trying to get access to.
Cross-Origin Resource Sharing (CORS) - HTTP
WebHTTPCORS
if a redirect occurs after a preflighted request, some browsers currently will report an error message such as the following.
Connection - HTTP
except for the standard hop-by-hop headers (keep-alive, transfer-encoding, te, connection, trailer, upgrade, proxy-authorization and proxy-authenticate), any hop-by-hop headers used by the message must be listed in the connection header, so that the first proxy knows it has to consume them and not forward them further.
Content-Length - HTTP
specifications specification title rfc 7230, section 3.3.2: content-length hypertext transfer protocol (http/1.1): message syntax and routing ...
Content-Location - HTTP
the site returns a generic success message confirming the post was published.
Content-Range - HTTP
the content-range response http header indicates where in a full body message a partial message belongs.
Content-Type - HTTP
it is used to encapsulate the boundaries of the multiple parts of the message.
Date - HTTP
WebHTTPHeadersDate
the date general http header contains the date and time at which the message was originated.
Digest - HTTP
WebHTTPHeadersDigest
the representation itself may be: fully contained in the response message body not at all contained in the message body (for example, in a response to a head request) partially contained in the message body (for example, in a response to a range request).
Expect-CT - HTTP
header type response header forbidden header name yes syntax expect-ct: report-uri="<uri>", enforce, max-age=<age> directives max-age the number of seconds after reception of the expect-ct header field during which the user agent should regard the host of the received message as a known expect-ct host.
SameSite cookies - HTTP
cookies without samesite default to samesite=lax recent versions of modern browsers provide a more secure default for samesite to your cookies and so the following message might appear in your console: some cookies are misusing the “samesite“ attribute, so it won’t work as expected.
TE - HTTP
WebHTTPHeadersTE
specifications specification title rfc 7230, section 4.3: te hypertext transfer protocol (http/1.1): message syntax and routing ...
Upgrade - HTTP
WebHTTPHeadersUpgrade
examples connection: upgrade upgrade: http/2.0, shttp/1.3, irc/6.9, rta/x11 connection: upgrade upgrade: websocket specifications specification hypertext transfer protocol (http/1.1): message syntax and routing (http/1.1)# header.upgrade hypertext transfer protocol (http/1.1): semantics and content (http/1.1)# status.426 hypertext transfer protocol version 2 (http/2) (http/2)# informational-responses ...
X-Forwarded-For - HTTP
x-forwarded-for is also an email-header indicating that an email-message was forwarded from another account.
DELETE - HTTP
WebHTTPMethodsDELETE
a 200 (ok) status code if the action has been enacted and the response message includes a representation describing the status.
POST - HTTP
WebHTTPMethodsPOST
as described in the http 1.1 specification, post is designed to allow a uniform method to cover the following functions: annotation of existing resources posting a message to a bulletin board, newsgroup, mailing list, or similar group of articles; adding a new user through a signup modal; providing a block of data, such as the result of submitting a form, to a data-handling process; extending a database through an append operation.
HTTP request methods - HTTP
WebHTTPMethods
trace the trace method performs a message loop-back test along the path to the target resource.
Protocol upgrade mechanism - HTTP
sec-websocket-accept included in the response message from the server during the opening handshake process when the server is willing to initiate a websocket connection.
101 Switching Protocols - HTTP
WebHTTPStatus101
the http 101 switching protocols response code indicates the protocol the server is switching to as requested by a client which sent the message including the upgrade request header.
201 Created - HTTP
WebHTTPStatus201
the new resource is effectively created before this response is sent back and the new resource is returned in the body of the message, its location being either the url of the request, or the content of the location header.
302 Found - HTTP
WebHTTPStatus302
this is useful when you want to give a response to a put method that is not the uploaded resource but a confirmation message such as: 'you successfully uploaded xyz'.
307 Temporary Redirect - HTTP
WebHTTPStatus307
this is useful when you want to give an answer to a put method that is not the uploaded resources, but a confirmation message (like "you successfully uploaded xyz").
400 Bad Request - HTTP
WebHTTPStatus400
the hypertext transfer protocol (http) 400 bad request response status code indicates that the server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
406 Not Acceptable - HTTP
WebHTTPStatus406
if a server returns such an error status, the body of the message should contain the list of the available representations of the resources, allowing the user to choose among them.
408 Request Timeout - HTTP
WebHTTPStatus408
note: some servers merely shut down the connection without sending this message.
416 Range Not Satisfiable - HTTP
WebHTTPStatus416
the 416 response message contains a content-range indicating an unsatisfied range (that is a '*') followed by a '/' and the current length of the resource.
Grammar and types - JavaScript
so, for example, you could define a variable as follows: var answer = 42; and later, you could assign the same variable a string value, for example: answer = 'thanks for all the fish...'; because javascript is dynamically typed, this assignment does not cause an error message.
Quantifiers - JavaScript
for example, given a string like "some <foo> <bar> new </bar> </foo> thing": /<.*>/ will match "<foo> <bar> new </bar> </foo>" /<.*?>/ will match "<foo>" examples repeated pattern var wordendingwithas = /\w+a+\b/; var delicatemessage = "this is spartaaaaaaa"; console.table(delicatemessage.match(wordendingwithas)); // [ "spartaaaaaaa" ] counting characters var singleletterword = /\b\w\b/g; var notsolongword = /\b\w{1,6}\b/g; var loooongword = /\b\w{13,}\b/g; var sentence = "why do i have to learn multiplication table?"; console.table(sentence.match(singleletterword)); // ["i"] console.table(sentence.match(notsolongword))...
Regular expressions - JavaScript
if the number is valid (matches the character sequence specified by the regular expression), the script shows a message thanking the user and confirming the number.
Using Promises - JavaScript
.then(() => morecriticalstuff()) .catch(e => console.error("critical failure: " + e.message)); note that the optional steps here are nested, not from the indentation, but from the precarious placement of the outer ( and ) around them.
Warning: -file- is being assigned a //# sourceMappingURL, but already has one - JavaScript
message warning: -file- is being assigned a //# sourcemappingurl, but already has one.
TypeError: invalid Array.prototype.sort argument - JavaScript
message typeerror: argument is not a function object (edge) typeerror: invalid array.prototype.sort argument (firefox) error type typeerror what went wrong?
Warning: 08/09 is not a legal ECMA-262 octal constant - JavaScript
message warning: syntaxerror: 08 is not a legal ecma-262 octal constant.
RangeError: radix must be an integer - JavaScript
message rangeerror: invalid argument (edge) rangeerror: radix must be an integer at least 2 and no greater than 36 (firefox) rangeerror: tostring() radix argument must be between 2 and 36 (chrome) error type rangeerror what went wrong?
SyntaxError: invalid regular expression flag "x" - JavaScript
message syntaxerror: syntax error in regular expression (edge) syntaxerror: invalid regular expression flag "x" (firefox) syntaxerror: invalid regular expression flags (chrome) error type syntaxerror what went wrong?
SyntaxError: return not in function - JavaScript
message syntaxerror: 'return' statement outside of function (edge) syntaxerror: return not in function (firefox) syntaxerror: yield not in function (firefox) error type syntaxerror.
TypeError: X.prototype.y called on incompatible type - JavaScript
message typeerror: 'this' is not a set object (edge) typeerror: function.prototype.tostring called on incompatible object (firefox) typeerror: function.prototype.bind called on incompatible target (firefox) typeerror: method set.prototype.add called on incompatible receiver undefined (chrome) typeerror: bind must be called on a function (chrome) error type typeerror what went wrong?
ReferenceError: can't access lexical declaration`X' before initialization - JavaScript
message referenceerror: use before delaration (edge) referenceerror: can't access lexical declaration `x' before initialization (firefox) referenceerror: 'x' is not defined (chrome) error type referenceerror what went wrong?
TypeError: can't access property "x" of "y" - JavaScript
message typeerror: unable to get property {x} of undefined or null reference (edge) typeerror: can't access property {x} of {y} (firefox) typeerror: {y} is undefined, can't access property {x} of it (firefox) typeerror: {y} is null, can't access property {x} of it (firefox) examples: typeerror: x is undefined, can't access property "prop" of it typeerror: x is null, can't access property "prop" of it typeerror: can't access property "prop" of undefined typeerror: can't access property "prop" of null error type typeerror.
TypeError: can't assign to property "x" on "y": not an object - JavaScript
message typeerror: can't assign to property "x" on {y}: not an object (firefox) typeerror: cannot create property 'x' on {y} (chrome) error type typeerror.
TypeError: can't define property "x": "obj" is not extensible - JavaScript
message typeerror: cannot create property for a non-extensible object (edge) typeerror: can't define property "x": "obj" is not extensible (firefox) typeerror: cannot define property: "x", object is not extensible.
TypeError: property "x" is non-configurable and can't be deleted - JavaScript
message typeerror: calling delete on 'x' is not allowed in strict mode (edge) typeerror: property "x" is non-configurable and can't be deleted.
TypeError: can't redefine non-configurable property "x" - JavaScript
message typeerror: cannot modify non-writable property {x} (edge) typeerror: can't redefine non-configurable property "x" (firefox) typeerror: cannot redefine property: "x" (chrome) error type typeerror what went wrong?
TypeError: cyclic object value - JavaScript
message typeerror: cyclic object value (firefox) typeerror: converting circular structure to json (chrome and opera) typeerror: circular reference in value argument not supported (edge) error type typeerror what went wrong?
TypeError: can't access dead object - JavaScript
message typeerror: can't access dead object error type typeerror what went wrong?
SyntaxError: applying the 'delete' operator to an unqualified name is deprecated - JavaScript
message syntaxerror: calling delete on expression not allowed in strict mode (edge) syntaxerror: applying the 'delete' operator to an unqualified name is deprecated (firefox) syntaxerror: delete of an unqualified identifier in strict mode.
Warning: String.x is deprecated; use String.prototype.x instead - JavaScript
message warning: string.charat is deprecated; use string.prototype.charat instead warning: string.charcodeat is deprecated; use string.prototype.charcodeat instead warning: string.concat is deprecated; use string.prototype.concat instead warning: string.contains is deprecated; use string.prototype.contains instead warning: string.endswith is deprecated; use string.prototype.endswith instead warning: string.includes is deprecated; use string.prototype.includes instead warning: string.indexof is deprecated; use string.prototype.index...
ReferenceError: deprecated caller or arguments usage - JavaScript
message typeerror: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context (edge) warning: referenceerror: deprecated caller usage (firefox) warning: referenceerror: deprecated arguments usage (firefox) typeerror: 'callee' and 'caller' cannot be accessed in strict mode.
Warning: expression closures are deprecated - JavaScript
message warning: expression closures are deprecated error type warning.
SyntaxError: "0"-prefixed octal literals and octal escape seq. are deprecated - JavaScript
message syntaxerror: octal numeric literals and escape characters not allowed in strict mode (edge) syntaxerror: "0"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the "0o" prefix instead error type syntaxerror in strict mode only.
SyntaxError: Using //@ to indicate sourceURL pragmas is deprecated. Use //# instead - JavaScript
message warning: syntaxerror: using //@ to indicate sourceurl pragmas is deprecated.
Warning: Date.prototype.toLocaleFormat is deprecated - JavaScript
message warning: date.prototype.tolocaleformat is deprecated; consider using intl.datetimeformat instead error type warning.
SyntaxError: test for equality (==) mistyped as assignment (=)? - JavaScript
message warning: syntaxerror: test for equality (==) mistyped as assignment (=)?
Warning: JavaScript 1.6's for-each-in loops are deprecated - JavaScript
message warning: javascript 1.6's for-each-in loops are deprecated; consider using es6 for-of instead error type warning what went wrong?
TypeError: setting getter-only property "x" - JavaScript
message typeerror: assignment to read-only properties is not allowed in strict mode (edge) typeerror: setting getter-only property "x" (firefox) typeerror: cannot set property "prop" of #<object> which has only a getter (chrome) error type typeerror in strict mode only.
SyntaxError: identifier starts immediately after numeric literal - JavaScript
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?
SyntaxError: illegal character - JavaScript
message syntaxerror: invalid character (edge) syntaxerror: illegal character (firefox) syntaxerror: invalid or unexpected token (chrome) error type syntaxerror what went wrong?
RangeError: invalid array length - JavaScript
message rangeerror: array length must be a finite positive integer (edge) rangeerror: invalid array length (firefox) rangeerror: invalid array length (chrome) rangeerror: invalid array buffer length (chrome) error type rangeerror what went wrong?
ReferenceError: invalid assignment left-hand side - JavaScript
message referenceerror: invalid assignment left-hand side error type referenceerror.
TypeError: invalid assignment to const "x" - JavaScript
message typeerror: invalid assignment to const "x" (firefox) typeerror: assignment to constant variable.
RangeError: invalid date - JavaScript
message rangeerror: invalid date (edge) rangeerror: invalid date (firefox) rangeerror: invalid time value (chrome) rangeerror: provided date is not in valid range (chrome) error type rangeerror what went wrong?
SyntaxError: for-in loop head declarations may not have initializers - JavaScript
message syntaxerror: for-in loop head declarations cannot have an initializer (edge) syntaxerror: for-in loop head declarations may not have initializers (firefox) syntaxerror: for-in loop variable declaration may not have an initializer.
SyntaxError: a declaration in the head of a for-of loop can't have an initializer - JavaScript
message syntaxerror: for-of loop head declarations cannot have an initializer (edge) syntaxerror: a declaration in the head of a for-of loop can't have an initializer (firefox) syntaxerror: for-of loop variable declaration may not have an initializer.
SyntaxError: JSON.parse: bad parsing - JavaScript
message syntaxerror: json.parse: unterminated string literal syntaxerror: json.parse: bad control character in string literal syntaxerror: json.parse: bad character in string literal syntaxerror: json.parse: bad unicode escape syntaxerror: json.parse: bad escape character syntaxerror: json.parse: unterminated string syntaxerror: json.parse: no number after minus sign syntaxerror: json.parse: unexpected non-digit syntaxerror: json.parse: missing digits after decimal point syntaxerror: json.parse: unterminated fractional number syntaxerror: json.parse: missing digits after exponent indicator syntaxerror: json.parse: missing digits after exponent sign syntaxerror: json.parse: exponent part is missing a...
URIError: malformed URI sequence - JavaScript
message urierror: the uri to be encoded contains invalid character (edge) urierror: malformed uri sequence (firefox) urierror: uri malformed (chrome) error type urierror what went wrong?
SyntaxError: missing ] after element list - JavaScript
message syntaxerror: missing ] after element list error type syntaxerror.
SyntaxError: missing : after property id - JavaScript
message syntaxerror: expected ':' (edge) syntaxerror: missing : after property id (firefox) error type syntaxerror what went wrong?
SyntaxError: missing } after function body - JavaScript
message syntaxerror: expected '}' (edge) syntaxerror: missing } after function body (firefox) error type syntaxerror what went wrong?
SyntaxError: missing } after property list - JavaScript
message syntaxerror: expected '}' (edge) syntaxerror: missing } after property list (firefox) error type syntaxerror what went wrong?
SyntaxError: missing formal parameter - JavaScript
message syntaxerror: missing formal parameter (firefox) error type syntaxerror what went wrong?
SyntaxError: missing = in const declaration - JavaScript
message syntaxerror: const must be initalized (edge) syntaxerror: missing = in const declaration (firefox) syntaxerror: missing initializer in const declaration (chrome) error type syntaxerror what went wrong?
SyntaxError: missing name after . operator - JavaScript
message syntaxerror: missing name after .
SyntaxError: missing ) after argument list - JavaScript
message syntaxerror: expected ')' (edge) syntaxerror: missing ) after argument list (firefox) error type syntaxerror.
SyntaxError: missing ) after condition - JavaScript
message syntaxerror: expected ')' (edge) syntaxerror: missing ) after condition (firefox) error type syntaxerror what went wrong?
SyntaxError: missing ; before statement - JavaScript
message syntaxerror: expected ';' (edge) syntaxerror: missing ; before statement (firefox) error type syntaxerror.
TypeError: More arguments needed - JavaScript
message typeerror: argument is not an object and is not null (edge) typeerror: object.create requires at least 1 argument, but only 0 were passed typeerror: object.setprototypeof requires at least 2 arguments, but only 0 were passed typeerror: object.defineproperties requires at least 1 argument, but only 0 were passed error type typeerror.
RangeError: repeat count must be non-negative - JavaScript
message rangeerror: argument out of range rangeerror: repeat count must be non-negative (firefox) rangeerror: invalid count value (chrome) error type rangeerror what went wrong?
TypeError: "x" is not a non-null object - JavaScript
message typeerror: invalid descriptor for property {x} (edge) typeerror: "x" is not a non-null object (firefox) typeerror: property description must be an object: "x" (chrome) typeerror: invalid value used in weak set (chrome) error type typeerror what went wrong?
TypeError: "x" has no properties - JavaScript
message typeerror: unable to get property {x} of undefined or null reference (edge) typeerror: null has no properties (firefox) typeerror: undefined has no properties (firefox) error type typeerror.
SyntaxError: missing variable name - JavaScript
message syntaxerror: missing variable name (firefox) syntaxerror: unexpected token = (chrome) error type syntaxerror what went wrong?
TypeError: can't delete non-configurable array element - JavaScript
message typeerror: can't delete non-configurable array element (firefox) typeerror: cannot delete property '2' of [object array] (chrome) error type typeerror what went wrong?
RangeError: argument is not a valid code point - JavaScript
message rangeerror: {0} is not a valid code point (firefox) rangeerror: invalid code point {0} (chromium) error type rangeerror what went wrong?
TypeError: "x" is not a constructor - JavaScript
message typeerror: object doesn't support this action (edge) typeerror: "x" is not a constructor typeerror: math is not a constructor typeerror: json is not a constructor typeerror: symbol is not a constructor typeerror: reflect is not a constructor typeerror: intl is not a constructor typeerror: atomics is not a constructor error type typeerror what went wrong?
TypeError: "x" is not a function - JavaScript
message typeerror: object doesn't support property or method {x} (edge) typeerror: "x" is not a function error type typeerror what went wrong?
ReferenceError: "x" is not defined - JavaScript
message referenceerror: "x" is not defined error type referenceerror.
RangeError: precision is out of range - JavaScript
message rangeerror: the number of fractional digits is out of range (edge) rangeerror: the precision is out of range (edge) rangeerror: precision {0} out of range (firefox) rangeerror: toexponential() argument must be between 0 and 20 (chrome) rangeerror: tofixed() digits argument must be between 0 and 20 (chrome) rangeerror: toprecision() argument must be between 1 and 21 (chrome) error type rangeerror what went wrong?
Error: Permission denied to access property "x" - JavaScript
message error: permission denied to access property "x" error type error.
TypeError: "x" is read-only - JavaScript
message typeerror: assignment to read-only properties is not allowed in strict mode (edge) typeerror: "x" is read-only (firefox) typeerror: 0 is read-only (firefox) typeerror: cannot assign to read only property 'x' of #<object> (chrome) typeerror: cannot assign to read only property '0' of [object array] (chrome) error type typeerror what went wrong?
SyntaxError: redeclaration of formal parameter "x" - JavaScript
message syntaxerror: let/const redeclaration (edge) syntaxerror: redeclaration of formal parameter "x" (firefox) syntaxerror: identifier "x" has already been declared (chrome) error type syntaxerror what went wrong?
TypeError: Reduce of empty array with no initial value - JavaScript
message typeerror: reduce of empty array with no initial value error type typeerror what went wrong?
SyntaxError: "x" is a reserved identifier - JavaScript
message syntaxerror: the use of a future reserved word for an identifier is invalid (edge) syntaxerror: "x" is a reserved identifier (firefox) syntaxerror: unexpected reserved word (chrome) error type syntaxerror what went wrong?
RangeError: repeat count must be less than infinity - JavaScript
message rangeerror: argument out of range (edge) rangeerror: repeat count must be less than infinity and not overflow maximum string size (firefox) rangeerror: invalid count value (chrome) error type rangeerror what went wrong?
Warning: unreachable code after return statement - JavaScript
message warning: unreachable code after return statement (firefox) error type warning what went wrong?
SyntaxError: "use strict" not allowed in function with non-simple parameters - JavaScript
message edge: cannot apply strict mode on functions with non-simple parameter list firefox: syntaxerror: "use strict" not allowed in function with default parameter syntaxerror: "use strict" not allowed in function with rest parameter syntaxerror: "use strict" not allowed in function with destructuring parameter chrome: syntaxerror: illegal 'use strict' directive in function with non-simple parameter list error type syntaxerror.
InternalError: too much recursion - JavaScript
message error: out of stack space (edge) internalerror: too much recursion (firefox) rangeerror: maximum call stack size exceeded (chrome) error type internalerror.
TypeError: invalid arguments - JavaScript
message typeerror: invalid arguments (firefox) error type typeerror what went wrong?
ReferenceError: assignment to undeclared variable "x" - JavaScript
message referenceerror: assignment to undeclared variable "x" (firefox) referenceerror: "x" is not defined (chrome) referenceerror: variable undefined in strict mode (edge) error type referenceerror warning in strict mode only.
ReferenceError: reference to undefined property "x" - JavaScript
message referenceerror: reference to undefined property "x" (firefox) error type (firefox only) referenceerror warning which is reported only if javascript.options.strict preference is set to true.
SyntaxError: Unexpected token - JavaScript
message syntaxerror: expected expression, got "x" syntaxerror: expected property name, got "x" syntaxerror: expected target, got "x" syntaxerror: expected rest argument name, got "x" syntaxerror: expected closing parenthesis, got "x" syntaxerror: expected '=>' after argument list, got "x" error type syntaxerror what went wrong?
TypeError: "x" is (not) "y" - JavaScript
message typeerror: unable to get property {x} of undefined or null reference (edge) typeerror: "x" is (not) "y" (firefox) examples: typeerror: "x" is undefined typeerror: "x" is null typeerror: "undefined" is not an object typeerror: "x" is not an object or null typeerror: "x" is not a symbol error type typeerror.
SyntaxError: function statement requires a name - JavaScript
message syntax error: expected identifier (edge) syntaxerror: function statement requires a name [firefox] syntaxerror: unexpected token ( [chrome] error type syntaxerror what went wrong?
SyntaxError: unterminated string literal - JavaScript
message syntaxerror: unterminated string constant (edge) syntaxerror: unterminated string literal (firefox) error type syntaxerror what went wrong?
TypeError: variable "x" redeclares argument - JavaScript
message typeerror: variable "x" redeclares argument (firefox) error type typeerror warning in strict mode only.
TypeError: cannot use 'in' operator to search for 'x' in 'y' - JavaScript
message typeerror: invalid operand to 'in' (edge) typeerror: right-hand side of 'in' should be an object, got 'x' (firefox) typeerror: cannot use 'in' operator to search for 'x' in 'y' (firefox, chrome) error type typeerror what went wrong?
TypeError: invalid 'instanceof' operand 'x' - JavaScript
message typeerror: invalid 'instanceof' operand "x" (firefox) typeerror: "x" is not a function (firefox) typeerror: right-hand side of 'instanceof' is not an object (chrome) typeerror: right-hand side of 'instanceof' is not callable (chrome) error type typeerror what went wrong?
TypeError: 'x' is not iterable - JavaScript
message typeerror: 'x' is not iterable (firefox, chrome) typeerror: 'x' is not a function or its return value is not iterable (chrome) error type typeerror what went wrong?
Default parameters - JavaScript
function callsomething(thing = something()) { return thing } let numberoftimescalled = 0 function something() { numberoftimescalled += 1 return numberoftimescalled } callsomething() // 1 callsomething() // 2 earlier parameters are available to later default parameters parameters defined earlier (to the left) are available to later default parameters: function greet(name, greeting, message = greeting + ' ' + name) { return [name, greeting, message] } greet('david', 'hi') // ["david", "hi", "hi david"] greet('david', 'hi', 'happy birthday!') // ["david", "hi", "happy birthday!"] this functionality can be approximated like this, which demonstrates how many edge cases are handled: function go() { return ':p' } function withdefaults(a, b = 5, c = b, d = go...
Error() constructor - JavaScript
syntax new error([message[, filename[, linenumber]]]) parameters messageoptional a human-readable description of the error.
Error.prototype.stack - JavaScript
html> <meta charset="utf-8"> <title>stack 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 woul...
Error.prototype.name - JavaScript
the name property, in addition to the message property, is used by the error.prototype.tostring() method to create a string representation of the error.
Error.prototype.toSource() - JavaScript
for example: (newname(message ,filename,linenumber)) where these attributes correspond to the respective properties of the error instance.
InternalError() constructor - JavaScript
syntax new internalerror([message[, filename[, linenumber]]]) parameters message optional.
InternalError - JavaScript
instance properties internalerror.prototype.message error message.
Object.create() - JavaScript
for example: a simple common debugging function: // display top-level property name:value pairs of given object function showproperties(obj){ for(var prop in obj){ console.log(prop + ": " + obj[prop] + "\n" ); } } not such simple results: (especially if silent error-trapping had hidden the error messages) ob={}; ob.po=oco; ob.pn=ocn; // create a compound object using the test objects from above as property values > showproperties( ob ) // display top-level properties - po: [object object] - error: cannot convert object to primitive value note that only first property gets shown.
Promise.any() - JavaScript
status: ${response.status}`); } else { return response.blob(); } }) } let coffee = fetchanddecode('coffee.jpg'); let tea = fetchanddecode('tea.jpg'); promise.any([coffee, tea]).then(value => { let objecturl = url.createobjecturl(value); let image = document.createelement('img'); image.src = objecturl; document.body.appendchild(image); }) .catch(e => { console.log(e.message); }); specifications specification promise.any ...
Promise.prototype.catch() - JavaScript
examples using and chaining the catch method var p1 = new promise(function(resolve, reject) { resolve('success'); }); p1.then(function(value) { console.log(value); // "success!" throw new error('oh, no!'); }).catch(function(e) { console.error(e.message); // "oh, no!" }).then(function(){ console.log('after a catch the chain is restored'); }, function () { console.log('not fired due to the catch'); }); // the following behaves the same as above p1.then(function(value) { console.log(value); // "success!" return promise.reject('oh, no!'); }).catch(function(e) { console.error(e); // "oh, no!" }).then(function(){ console.log('after a cat...
Promise.race() - JavaScript
e); // "three" // p3 is faster, so it fulfills }, function(reason) { // not called }); var p5 = new promise(function(resolve, reject) { settimeout(() => resolve('five'), 500); }); var p6 = new promise(function(resolve, reject) { settimeout(() => reject(new error('six')), 100); }); promise.race([p5, p6]) .then(function(value) { // not called }, function(error) { console.log(error.message); // "six" // p6 is faster, so it rejects }); specifications specification ecmascript (ecma-262)the definition of 'promise.race' in that specification.
RangeError() constructor - JavaScript
syntax new rangeerror([message[, filename[, linenumber]]]) parameters message optional human-readable description of the error.
RegExp.prototype.exec() - JavaScript
using exec() with regexp literals you can also use exec() without creating a regexp object explicitly: let matches = /(hello \s+)/.exec('this is a hello world!'); console.log(matches[1]); this will log a message containing 'hello world!'.
RegExp.prototype.test() - JavaScript
const str = 'hello world!'; const result = /^hello/.test(str); console.log(result); // true the following example logs a message which depends on the success of the test: function testinput(re, str) { let midstring; if (re.test(str)) { midstring = 'contains'; } else { midstring = 'does not contain'; } console.log(`${str} ${midstring} ${re.source}`); } using test() on a regex with the "global" flag when a regex has the global flag set, test() will advance the lastindex of the regex.
String.prototype.split() - JavaScript
after splitting the string, the function logs messages indicating the original string (before the split), the separator used, the number of elements in the array, and the individual array elements.
WebAssembly.instantiateStreaming() - JavaScript
this module can be instantiated again or shared via postmessage().
Nullish coalescing operator (??) - JavaScript
let count = 0; let text = ""; let qty = count || 42; let message = text || "hi!"; console.log(qty); // 42 and not 0 console.log(message); // "hi!" and not "" the nullish coalescing operator avoids this pitfall by only returning the second operand when the first one evaluates to either null or undefined (but no other falsy values): let mytext = ''; // an empty string (which is also a falsy value) let notfalsytext = mytext || 'hello world'; console.log(n...
async function - JavaScript
this runs 2 seconds after 1., immediately after 2., since fast is already resolved } function concurrentpromise() { console.log('==concurrent start with promise.all==') return promise.all([resolveafter2seconds(), resolveafter1second()]).then((messages) => { console.log(messages[0]) // slow console.log(messages[1]) // fast }) } async function parallel() { console.log('==parallel with await promise.all==') // start 2 "jobs" in parallel and wait for both of them to complete await promise.all([ (async()=>console.log(await resolveafter2seconds()))(), (async()=>console.log(await resolveafter1second()))() ]) } sequen...
import - JavaScript
const main = document.queryselector("main"); for (const link of document.queryselectorall("nav > a")) { link.addeventlistener("click", e => { e.preventdefault(); import('/modules/my-module.js') .then(module => { module.loadpageinto(main); }) .catch(err => { main.textcontent = err.message; }); }); } specifications specification ecmascript (ecma-262)the definition of 'imports' in that specification.
Authoring MathML - MathML
gecko-based instant messaging clients can integrate a javascript-based text-to-mathml converter (mentioned below) and then render the mathml expressions generated from the (plaintext) instant messages.
MathML element reference - MathML
mathml presentation elements a to z math <math> (top-level element) a <maction> (binded actions to sub-expressions) <maligngroup> (alignment group) <malignmark> (alignment points) e <menclose> (enclosed contents) <merror> (enclosed syntax error messages) f <mfenced> (parentheses) <mfrac> (fraction) g <mglyph> (displaying non-standard symbols) i <mi> (identifier) l <mlabeledtr> (labeled row in a table or a matrix) <mlongdiv> (long division notation) m <mmultiscripts> (prescripts and tensor indices) n <mn> (number) o <mo> (operator) <mover> (overscript) p <mpadded> (space around content) <mphantom> (i...
Image file type and format guide - Web media technologies
for example, apng is one of the formats supported when creating animated stickers for apple's imessage application (and the messages application on ios).
Optimizing startup performance - Web Performance
while you can use web workers to run even very large, long-duration chunks of javascript code asynchronously, there's a huge caveat that: workers don't have access to webgl or audio, and they can't send synchronous messages to the main thread, so you can't even proxy those apis to the main thread.
Introduction to progressive web apps - Progressive web apps (PWAs)
re-engaging with users through the use of system notifications and push messages, leading to more engaged users and better conversion rates.
The building blocks of responsive design - Progressive web apps (PWAs)
if you want a solution that works across general web apps, you could use the screen orientation api, and/or provide a message asking the user to rotate their screen if they are using the wrong orientation (for example, if window.innerwidth is larger than window.innerheight, assume the game is landscape mode and show a "please rotate" message.) viewport one last problem to mention for our example app is concerned with mobile browsers and media queries.
Progressive web apps (PWAs)
but instead of relying only on user actions, we can do more, using push messages and notifications to automatically re-engage and deliver new content whenever it is available.introduction to progressive web appsthis article provides an introduction to progressive web apps (pwas), discussing what they are and the advantages they offer over regular web apps.making pwas work offline with service workersin this article we took a simple look at how you can make your pwa work offl...
<a> - SVG: Scalable Vector Graphics
WebSVGElementa
necap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility xlink attributes most notably: xlink:title aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-s...
<circle> - SVG: Scalable Vector Graphics
WebSVGElementcircle
troke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-s...
<ellipse> - SVG: Scalable Vector Graphics
WebSVGElementellipse
troke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-s...
<foreignObject> - SVG: Scalable Vector Graphics
troke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-s...
<g> - SVG: Scalable Vector Graphics
WebSVGElementg
troke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-s...
<line> - SVG: Scalable Vector Graphics
WebSVGElementline
troke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-s...
<marker> - SVG: Scalable Vector Graphics
WebSVGElementmarker
troke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-s...
<path> - SVG: Scalable Vector Graphics
WebSVGElementpath
troke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-s...
<polygon> - SVG: Scalable Vector Graphics
WebSVGElementpolygon
troke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-s...
<polyline> - SVG: Scalable Vector Graphics
WebSVGElementpolyline
troke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-s...
<rect> - SVG: Scalable Vector Graphics
WebSVGElementrect
troke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-s...
<svg> - SVG: Scalable Vector Graphics
WebSVGElementsvg
troke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-s...
<symbol> - SVG: Scalable Vector Graphics
WebSVGElementsymbol
troke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-s...
<text> - SVG: Scalable Vector Graphics
WebSVGElementtext
ay, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-s...
<textPath> - SVG: Scalable Vector Graphics
WebSVGElementtextPath
troke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-s...
<tspan> - SVG: Scalable Vector Graphics
WebSVGElementtspan
ay, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, text-anchor, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-s...
<use> - SVG: Scalable Vector Graphics
WebSVGElementuse
troke-dasharray, stroke-dashoffset, stroke-linecap, stroke-linejoin, stroke-miterlimit, stroke-opacity, stroke-width, transform, vector-effect, visibility aria attributes aria-activedescendant, aria-atomic, aria-autocomplete, aria-busy, aria-checked, aria-colcount, aria-colindex, aria-colspan, aria-controls, aria-current, aria-describedby, aria-details, aria-disabled, aria-dropeffect, aria-errormessage, aria-expanded, aria-flowto, aria-grabbed, aria-haspopup, aria-hidden, aria-invalid, aria-keyshortcuts, aria-label, aria-labelledby, aria-level, aria-live, aria-modal, aria-multiline, aria-multiselectable, aria-orientation, aria-owns, aria-placeholder, aria-posinset, aria-pressed, aria-readonly, aria-relevant, aria-required, aria-roledescription, aria-rowcount, aria-rowindex, aria-rowspan, aria-s...
SVG In HTML Introduction - SVG: Scalable Vector Graphics
(another style rule makes an error message appear.) this approach has the following points in its favor: we have taken a regular html form that could have been part of an existing web site, and added an attractive, interactive background the approach is backwards compatible to browsers that do not support svg; simply, no background appears in them it's very simple and performs very well the picture dynamically sizes itself to the r...
How to fix a website with blocked mixed content - Web security
in any case, the best way to know if something is broken in firefox is to download the latest firefox edition, open different pages on your website with the web console open (enable the "security" messages) and see if anything related to mixed content is reported.
Securing your site - Web security
you should use a password-specific hashing algorithm (such as argon2, pbkdf2, scrypt or bcrypt) instead of message digest algorithms (such as md5 and sha).
Transport Layer Security - Web security
the tls 1.3 handshake is encrypted, except for the messages that are necessary to establish a shared secret.
Types of attacks - Web security
the web server reflects the injected script back to the user's browser, such as in an error message, search result, or any other response that includes data sent to the server as part of the request.
Using custom elements - Web Components
the connectedcallback() runs each time the element is added to the dom — here we run the updatestyle() function to make sure the square is styled as defined in its attributes: connectedcallback() { console.log('custom square element added to page.'); updatestyle(this); } the disconnectedcallback() and adoptedcallback() callbacks log simple messages to the console to inform us when the element is either removed from the dom, or moved to a different page: disconnectedcallback() { console.log('custom square element removed from page.'); } adoptedcallback() { console.log('custom square element moved to new page.'); } the attributechangedcallback() callback is run whenever one of the element's attributes is changed in some way.
Index - XSLT: Extensible Stylesheet Language Transformations
WebXSLTIndex
37 <xsl:message> element, reference, xslt, message the <xsl:message> element outputs a message (to the javascript console in ns) and optionally terminates execution of the stylesheet.
The Netscape XSLT/XPath Reference - XSLT: Extensible Stylesheet Language Transformations
(supported) xsl:attribute-set (supported) xsl:call-template (supported) xsl:choose (supported) xsl:comment (supported) xsl:copy (supported) xsl:copy-of (supported) xsl:decimal-format (supported) xsl:element (supported) xsl:fallback (not supported) xsl:for-each (supported) xsl:if (supported) xsl:import (mostly supported) xsl:include (supported) xsl:key (supported) xsl:message (supported) xsl:namespace-alias (not supported) xsl:number (partially supported) xsl:otherwise (supported) xsl:output (partially supported) xsl:param (supported) xsl:preserve-space (supported) xsl:processing-instruction xsl:sort (supported) xsl:strip-space (supported) xsl:stylesheet (partially supported) xsl:template (supported) xsl:text (partially supported) xsl:transfor...
Transforming XML with XSLT - XSLT: Extensible Stylesheet Language Transformations
xsl:attribute (supported) xsl:attribute-set (supported) xsl:call-template (supported) xsl:choose (supported) xsl:comment (supported) xsl:copy (supported) xsl:copy-of (supported) xsl:decimal-format (supported) xsl:element (supported) xsl:fallback (not supported) xsl:for-each (supported) xsl:if (supported) xsl:import (mostly supported) xsl:include (supported) xsl:key (supported) xsl:message (supported) xsl:namespace-alias (not supported) xsl:number (partially supported) xsl:otherwise (supported) xsl:output (partially supported) xsl:param (supported) xsl:preserve-space (supported) xsl:processing-instruction xsl:sort (supported) xsl:strip-space (supported) xsl:stylesheet (partially supported) xsl:template (supported) xsl:text (partially supported) xsl:transform (supported...
Compiling a New C/C++ Module to WebAssembly - WebAssembly
file://your_path/hello.html), you will end up with an error message along the lines of both async and sync fetching of the wasm failed.
Caching compiled WebAssembly modules - WebAssembly
rrmsg); return webassembly.instantiatestreaming(fetch(url)).then(results => { storeindatabase(db, results.module); return results.instance; }); }) }, note: it is for this kind of usage that webassembly.instantiate() returns both a module and an instance: the module represents the compiled code and can be stored/retrieved in idb or shared between workers via postmessage(); the instance is stateful and contains the callable javascript functions, therefore it cannot be stored/shared.
WebAssembly Concepts - WebAssembly
a module is stateless and thus, like a blob, can be explicitly shared between windows and workers (via postmessage()).
Loading and running WebAssembly code - WebAssembly
the object looks like this: { module : module // the newly compiled webassembly.module object, instance : instance // a new webassembly.instance of the module object } note: usually we only care about the instance, but it’s useful to have the module in case we want to cache it, share it with another worker or window via postmessage(), or simply create more instances.
Understanding WebAssembly text format - WebAssembly
shared memories as described above, you can create shared webassembly memory objects, which can be transferred between window and worker contexts using postmessage(), in the same fashion as a sharedarraybuffer.
Using the WebAssembly JavaScript API - WebAssembly
in addition, newer implementations can also create shared memories, which can be transferred between window and worker contexts using postmessage(), and used in multiple places.
Compiling an Existing C Module to WebAssembly - WebAssembly
depending on the size of your image, you might run into an error where wasm can't grow the memory enough to accommodate both the input and the output image: luckily, the solution to this problem is in the error message.