Simon Willison’s Weblog

Subscribe

Posts tagged javascript, firefox

Filters: javascript × firefox × Sorted by date

Experimenting with local alt text generation in Firefox Nightly (via) The PDF editor in Firefox (confession: I did not know Firefox ships with a PDF editor) is getting an experimental feature that can help suggest alt text for images for the human editor to then adapt and improve on.

This is a great application of AI, made all the more interesting here because Firefox will run a local model on-device for this, using a custom trained model they describe as "our 182M parameters model using a Distilled version of GPT-2 alongside a Vision Transformer (ViT) image encoder".

The model uses WebAssembly with ONNX running in Transfomers.js, and will be downloaded the first time the feature is put to use.

# 2nd June 2024, 1:12 pm / accessibility, alt-text, firefox, javascript, mozilla, pdf, ai, webassembly, llms, transformers-js

New developer features in Firefox 75 (via) Firefox 75 just came out with a bunch of new developer features. My favourite is instant evaluation in the JavaScript console: any statement without side effects now shows a preview of its results as you type.

# 7th April 2020, 7:23 pm / firefox, javascript

Firefox Debugger Playground. Excellent hands-on tutorial to using the Firefox JavaScript debugger. I learned a bunch of neat tricks from this—including using conditional breakpoints to add temporary console.log statements—since that function returns undefined it won’t pause your code, but this saves you from having to remember to remove the lines from your source code later. I also didn’t know that the Firefox debugger can show the value of variables in paused code if you hover over them in the source pane. [UPDATE: Turns out Chrome DevTools do this as well—TIL]

# 28th November 2017, 4:01 pm / debuggers, firefox, javascript

HTML 5 audio player demo. Scott Andrew’s experiments with the HTML5 audio element (and jQuery)—straight forward and works a treat in Safari, but Firefox doesn’t support MP3. Presumably it’s not too hard to set up a fallback for Ogg.

# 1st February 2010, 9:58 am / audio, firefox, html5, javascript, jquery, mp3, ogg, safari, scott-andrew

Firefox 3.5 for developers. It’s out today, and the feature list is huge. Highlights include HTML 5 drag ’n’ drop, audio and video elements, offline resources, downloadable fonts, text-shadow, CSS transforms with -moz-transform, localStorage, geolocation, web workers, trackpad swipe events, native JSON, cross-site HTTP requests, text API for canvas, defer attribute for the script element and TraceMonkey for better JS performance!

# 30th June 2009, 6:08 pm / audio, browsers, canvas, crossdomain, csstransforms, dragndrop, firefox, firefox35, fonts, geolocation, html5, javascript, json, localstorage, mozilla, offlineresources, performance, textshadow, tracemonkey, video, webworkers

Browsing my browsing. Roo Reynolds used the MeeTimer Firefox extension to gather statistics on his browsing habits, then extracted data directly from the SQLite database and generated his own graphs using PHP and the canvas element.

# 10th April 2009, 8:48 am / canvas, firefox, javascript, meetimer, php, rooreynolds, sqlite

Magic properties make Firefox synchronously load the Java plugin. Even defining a function called sun() (or several other symbols) will trigger the Java VM to be loaded, dramatically hurting the performance of your page.

# 27th February 2009, 4:03 pm / firefox, java, javascript, mark-pilgrim, performance

ReferenceError: console is not defined. Since Firebug 1.2 you need to call window.loadFirebugConsole() in order for console.log and friends to work.

# 23rd December 2008, 10:22 pm / debugging, firebug, firefox, javascript

Browser Paint Events. The latest Firefox nightlies include a new MozAfterPaint event which fires after a portion of the page has been redrawn and provides co-ordinates of the affected rectangle. John Resig provides a neat bookmarklet that uses the new event to visualise repainting operations.

# 14th October 2008, 1:08 pm / firefox, javascript, john-resig, mozafterpaint, mozilla

querySelectorAll in Firefox 3.1. John Resig benchmarks the various JavaScript libraries’ support for querySelelectorAll, and finds an impressive 2-6x performance improvement over native DOM traversal. It’s worth clicking through to John’s experimental plugin for adding support to jQuery, which does a clever trick using __proto__ to convert the collection returned by querySelectorAll in to a jQuery object in browsers that support it.

# 21st August 2008, 9:50 am / firefox, javascript, john-resig, jquery, proto, queryselectorall, selectors

eval() Kerfuffle. The ability to read supposedly private variables in Firefox using a second argument to eval() will be removed in Firefox 3.1.

# 2nd July 2008, 9:24 pm / firefox, javascript, john-resig, privacy, security

Javascript protocol fuzz results. If your HTML sanitizer uses blacklisting rather than whitelisting here are a few more weird ways of injecting javascript: in to a link that you need to worry about—but you should really switch to whitelisting http:// and https:// instead.

# 30th June 2008, 3:57 pm / blacklisting, firefox, fuzztesting, html, javascript, sanitization, security, whitelisting

Module Pattern Provides No Privacy... at least not in JavaScript(TM) (via) JavaScript variables hidden inside a closure aren’t as hidden as I thought—it turns out you can pass a closure as the second argument to eval (at least in Firefox) and “steal” private variables back out of it.

# 27th June 2008, 7:01 pm / closures, firefox, javascript, modulepattern, pete-michaux

When Bugs Collide: Fixing Text Dimming in Firefox 2. Handy tips from Drew on fixing the glitchy text rendering in Firefox 2 when you animate opacity without breaking alpha-transparent PNGs in IE6.

# 19th June 2008, 6:09 pm / browsers, bugs, css, drew-mclellan, firefox, firefox2, ie6, javascript, jquery, opacity, pngs

Reading binary files using Ajax. There’s a simple trick for Firefox, and (amazingly) you can get IE to play along using a function written in VBScript.

# 22nd April 2008, 7:02 pm / ajax, binary, firefox, ie, javascript, vbscript, xmlhttprequest

Cross-Window Messaging. Now in Firefox 3 trunk, the HTML 5 specified ability for JavaScript to send messages between windows (or iframes) hosted on different domains. Fantastically powerful, but must be implemented with care to avoid accidentally processing bad messages from malicious third parties.

# 10th February 2008, 12 pm / crosswindowmessaging, firefox, firefox3, html5, javascript, john-resig

Cross-Site XMLHttpRequest (via) “Firefox 3 implements the W3C Access Control working draft, which gives you the ability to do XMLHttpRequests to other web sites”—you can mark a document as available for cross-domain requests using either an Access-Control HTTP header or an XML processing instruction.

# 9th January 2008, 11:57 pm / accesscontrol, ajax, crossdomain, firefox, firefox3, http, javascript, john-resig, mozilla, w3c, xml, xmlhttprequest

Jash: JavaScript Shell (via) An advanced JavaScript interactive shell bookmarklet that works in IE, Firefox, Opera and Safari.

# 9th December 2007, 12:36 pm / bookmarklet, firefox, gareth-rushgrove, ie, jash, javascript, opera, safari, shell

google-axsjax (via) “The AxsJAX framework can inject accessibility enhancements into existing Web 2.0 applications using any of several standard Web techniques”—including bookmarklets and Greasemonkey. The enhancements conform to W3C ARIA, supported by Firefox 2.0 and later.

# 14th November 2007, 5:18 pm / accessibility, ajax, aria, axsjax, bookmarklets, firefox, google, greasemonkey, javascript, w3c

In the long term, I want to replace JavaScript and the DOM with a smarter, safer design. In the medium term, I want to use something like Google Gears to give us vats with which we can have safe mashups. But in the short term, I recommend that you be using Firefox with No Script. Until we get things right, it seems to be the best we can do.

Douglas Crockford

# 7th November 2007, 3:36 pm / dom, douglas-crockford, firefox, google-gears, javascript, mashups, noscript, security

HTTPOnly cookie support in Firefox. Five years after the bug was filed, HTTPOnly cookie support has gone in to the Mozilla 1.8 branch. This is a defence in depth feature that has been in IE for years—it lets you set cookies that aren’t available to JavaScript, and hence can’t be hijacked in the event of an XSS flaw.

# 6th September 2007, 6:27 am / brad-fitzpatrick, firefox, httponly, ie, javascript, mozilla, security

The JavaScript alert(), confirm() and prompt() functions in Firefox, Opera and MSIE (but not Safari) will truncate the message after any null character. So an unsuspecting programmer who inserts user-provided text into one of these dialog boxes opens up an opportunity for the user to rewrite the bottom of the dialog box.

Neil Fraser

# 13th January 2007, 12:28 pm / firefox, javascript, neil-fraser, security

Firefox 1.5 developer highlights

Firefox 1.5 Beta 1 is out, and is the most exciting browser release in a very long time. It comes with the Gecko 1.8 rendering engine, which includes a ton of interesting new features. New in this version (unless you’ve been tinkering with the Deer Park series):

[... 719 words]

Firefox Counter. How the Firefox counter works.

# 28th April 2005, 6 pm / firefox, javascript