It's always been you, Canvas2D
https://developer.chrome.com/blog/canvas2d/ [developer.chrome.com]
2022-03-05 00:27
tags:
browser
graphics
javascript
update
web
Admittedly, the API is a bit behind the times when it comes to state-of-the-art 2D drawing. Fortunately we’ve been hard at work implementing new features in Canvas2D to catch up to CSS, streamline ergonomics and improve performance.
source: HN
Google Docs in a clean-room browser
https://www.ekioh.com/devblog/google-docs-in-a-clean-room-browser/ [www.ekioh.com]
2021-09-20 17:32
tags:
browser
cloud
development
javascript
programming
turtles
web
Like Google Mail, Google Docs almost entirely consists of obfuscated JavaScript, some of it common between the two. Its HTML structure is quite simple, though it uses hidden iframes for various purposes (one for key input and another for calculating word widths, amongst others). Over the course of the couple of months I identified over 30 distinct issues that needed fixing, and I’ll discuss the more interesting ones in the second section of this blog.
As with Gmail, I believe Flow is the only browser engine written after Google Docs that can run Google Docs.
source: HN
The end of TenFourFox and what I've learned from it
http://tenfourfox.blogspot.com/2020/04/the-end-of-tenfourfox-and-what-ive.html [tenfourfox.blogspot.com]
2021-03-29 19:10
tags:
browser
development
javascript
mac
turtles
update
We’re running on fumes technologically as well. Besides various layout and DOM features we don’t support well like CSS grid, there are large JavaScript updates we’ll increasingly need which are formidably complex tasks. The biggest is async and await support which landed in Firefox 52, and which many sites now expect to run at all. However, at the time it required substantial changes to both JavaScript and the runtime environment and had lots of regressions and bugs to pick up. We have some minimal syntactic support for the feature but it covers only the simplest of use cases incompletely. There are also front end changes required to deal with certain minifiers (more about this in a moment) but they can all be traced back to a monstrous 2.5MB commit which is impossible to split up piecemeal. We could try to port 52ESR as a whole, but we would potentially suffer some significant regressions in the process, and because there is no Rust support for 32-bit PowerPC on OS X we couldn’t build anything past Firefox 54 anyway. All it does is just get us that much closer to an impenetrable dead end. It pains me to say so, but it’s just not worth it, especially if I, the browser’s only official beneficiary, am rarely using it personally these days. It’s best to hang it up here while the browser still works for most practical purposes and people can figure out their next move, rather than vainly struggling on with token changes until the core is totally useless.
source: HN
The Kilobyte's Gambit
https://vole.wtf/kilobytes-gambit/ [vole.wtf]
2021-03-07 23:23
tags:
gaming
interactive
javascript
Can you beat 1024 of javascript at chess?
source: HN
An Exploration of JSON Interoperability Vulnerabilities
https://labs.bishopfox.com/tech-blog/an-exploration-of-json-interoperability-vulnerabilities [labs.bishopfox.com]
2021-02-26 22:29
tags:
format
javascript
security
standard
text
turtles
The same JSON document can be parsed with different values across microservices, leading to a variety of potential security risks. If you prefer a hands-on approach, try the labs and when they scare you, come back and read on.
https://github.com/BishopFox/json-interop-vuln-labs/
source: HN
Floating Point in the Browser, Part 3: When x+y=x
https://randomascii.wordpress.com/2020/10/18/floating-point-in-the-browser-part-3-when-xyx/ [randomascii.wordpress.com]
2020-10-20 04:09
tags:
browser
bugfix
javascript
programming
series
That is, if you add a small number to a large number then if the small number is “too small” then the large number may (in the default/sane round-to-nearest mode) stay at the same value.
Because of this the loop spins endlessly and the push command runs until the array hits the size limits. If there were no size limits then the push command would keep running until the entire machine ran out of memory, so, yay?
The Great CoffeeScript to Typescript Migration of 2017
https://dropbox.tech/frontend/the-great-coffeescript-to-typescript-migration-of-2017 [dropbox.tech]
2020-05-16 04:58
tags:
development
javascript
programming
This post is longer than most. We wanted to capture the massive scope of migrating hundreds of thousands of lines of CoffeeScript to TypeScript. We share how we picked TypeScript in the first place, how we mapped out the migration, and when things didn’t go according to plan.
source: HN
is-promise post mortem
https://medium.com/javascript-in-plain-english/is-promise-post-mortem-cab807f18dcc [medium.com]
2020-04-28 17:17
tags:
development
javascript
library
testing
I had been intending to set up more of my projects to be automatically published via CI, instead of manually published from my local machine, but because is-promise is such a tiny library, I figured it probably wasn’t worth the effort. This was definitely a mistake. However, even if I had setup publishing via CI is-promise may not have had sufficiently thorough tests.
source: L
Porting to TypeScript Solved Our API Woes
https://www.executeprogram.com/blog/porting-to-typescript-solved-our-api-woes [www.executeprogram.com]
2020-04-09 05:14
tags:
development
javascript
programming
type-system
web
We ported our React frontend from JavaScript to TypeScript, but left the backend in Ruby. Eventually, we ported the backend to TypeScript too.
With the Ruby backend, we sometimes forgot that a particular API property held an array of strings, not a single string. Sometimes we changed a piece of the API that was referenced in multiple places but forgot to update one of those places. These are normal dynamic language problems in any system whose tests don’t have 100% test coverage. (And it will still happen even with 100% coverage; it’s just less likely.)
Fixing memory leaks in web applications
https://nolanlawson.com/2020/02/19/fixing-memory-leaks-in-web-applications/ [nolanlawson.com]
2020-02-21 15:33
tags:
garbage-collection
javascript
programming
web
Part of the bargain we struck when we switched from building server-rendered websites to client-rendered SPAs is that we suddenly had to take a lot more care with the resources on the user’s device. Don’t block the UI thread, don’t make the laptop’s fan spin, don’t drain the phone’s battery, etc. We traded better interactivity and “app-like” behavior for a new class of problems that don’t really exist in the server-rendered world.
One of these problems is memory leaks. A poorly-coded SPA can easily eat up megabytes or even gigabytes of memory, continuing to gobble up more and more resources, even as it’s sitting innocently in a background tab. At this point, the page might start to slow to a crawl, or the browser may just terminate the tab and you’ll see Chrome’s familiar “Aw, snap!” page.
Don't touch my clipboard
https://alexanderell.is/posts/taking-over-my-clipboard/ [alexanderell.is]
2020-02-18 05:07
tags:
browser
javascript
programming
ux
web
You can (but shouldn’t) change how people copy text from your website.
source: HN
The Curious Case of WebCrypto Diffie-Hellman on Firefox - Small Subgroups Key Recovery Attack on DH
https://blog.intothesymmetry.com/2020/01/the-curious-case-of-webcrypto-diffie.html [blog.intothesymmetry.com]
2020-01-16 02:08
tags:
browser
crypto
exploit
javascript
security
Mozilla Firefox prior to version 72 suffers from Small Subgroups Key Recovery Attack on DH in the WebCrypto’s API. The Firefox’s team fixed the issue removing completely support for DH over finite fields (that is not in the WebCrypto standard). If you find this interesting read further below.
source: green
Unintuitive JSON Parsing
https://nullprogram.com/blog/2019/12/28/ [nullprogram.com]
2019-12-30 23:30
tags:
compiler
format
javascript
Based on the title, could be just about anything...
The parser will not complain about leading zeros because JSON has no concept of leading zeros.
Unexpectedly a parse error, not a lex error.
Improving the Cryptography of the JavaScript Ecosystem
https://paragonie.com/blog/2019/10/improving-cryptography-javascript-ecosystem [paragonie.com]
2019-10-19 21:58
tags:
crypto
javascript
library
release
security
This month we released Sodium-Plus, a pluggable, cross-platform, type-safe interface for libsodium to make it easier to write safe and secure JavaScript cryptography code.
source: green
Remote Code Execution in Firefox beyond memory corruptions
https://frederik-braun.com/firefox-ui-xss-leading-to-rce.html [frederik-braun.com]
2019-09-29 18:52
tags:
browser
exploit
html
javascript
security
turtles
ux
Browsers are complicated enough to have attack surface beyond memory safety issues. This talk will look into injection flaws in the user interface of Mozilla Firefox, which is implemented in JS, HTML, and an XML-dialect called XUL. With an Cross-Site Scripting (XSS) in the user interface attackers can execute arbitrary code in the context of the main browser application process. This allows for cross-platform exploits of high reliability. The talk discusses past vulnerabilities and will also suggest mitigations that benefit Single Page Applications and other platforms that may suffer from DOM-based XSS, like Electron.
source: L
And it was Uphill Both Ways
https://thedailywtf.com/articles/and-it-was-uphill-both-ways [thedailywtf.com]
2019-09-25 21:23
tags:
html
javascript
retro
web
In fact, shortly after I made my own personal home page, full of <marquee> tags, creative abuse of the <font> tag, and a color scheme which was hot pink and neon green, I showed it to a friend, who condescendingly said, “What, you didn’t even use frames?” He made me mad enough that I almost deleted my Geocities account.
Nice look back at how we used to do things.
In this era, we’d call stuff like this “DHTML” (the D is for “dynamic”), and we traversed the DOM as a chain of properties, doing things like document.forms[0].inputs[0] to access fields on the form.
An introduction to D3.js
https://wattenberger.com/blog/d3 [wattenberger.com]
2019-09-04 11:39
tags:
graphics
javascript
programming
visualization
web
So, you want to create amazing data visualizations on the web and you keep hearing about D3.js. But what is D3.js, and how can you learn it? Let’s start with the question: What is D3? While it might seem like D3.js is an all-encompassing framework, it’s really just a collection of small modules.
source: L
The Baseline Interpreter: a faster JS interpreter in Firefox 70
https://hacks.mozilla.org/2019/08/the-baseline-interpreter-a-faster-js-interpreter-in-firefox-70/ [hacks.mozilla.org]
2019-08-30 18:17
tags:
browser
javascript
jit
perf
update
The Baseline Interpreter sits between the C++ interpreter and the Baseline JIT and has elements from both. It executes all bytecode instructions with a fixed interpreter loop (like the C++ interpreter). In addition, it uses Inline Caches to improve performance and collect type information (like the Baseline JIT).
source: HN
The story of a V8 performance cliff in React
https://v8.dev/blog/react-cliff [v8.dev]
2019-08-29 18:15
tags:
garbage-collection
javascript
jit
perf
programming
type-system
Previously, we discussed how JavaScript engines optimize object and array access through the use of Shapes and Inline Caches, and we’ve explored how engines speed up prototype property access in particular. This article describes how V8 chooses optimal in-memory representations for various JavaScript values, and how that impacts the shape machinery — all of which helps explain a recent V8 performance cliff in React core.
source: L
High-performance input handling on the web
https://nolanlawson.com/2019/08/11/high-performance-input-handling-on-the-web/ [nolanlawson.com]
2019-08-11 18:00
tags:
browser
html
javascript
perf
programming
ux
web
There is a class of UI performance problems that arise from the following situation: An input event is firing faster than the browser can paint frames.
In a previous post, I discussed Lodash’s debounce and throttle functions, which I find very useful for these kinds of situations. Recently however, I found a pattern I like even better, so I want to discuss that here.
Follow up: https://nolanlawson.com/2019/08/14/browsers-input-events-and-frame-throttling/
source: L