unpoly.com

There have been some maintenance releases: 3.14.3 Revalidation of expired content will now preserve the scroll positions of any viewports...

makandra dev

Hybrid search runs a vector query and a keyword query in parallel against the same documents and merges the two...

RAG is often equated with vector databases, embeddings, and semantic search. But RAG ("Retrieval-Augmented Generation") really is just 'put...

A page scanned upside down or sideways has the potential to confuse OCR engines and vision LLMs. While both are...

When an LLM is part of a request, you want to keep track of how much of the runtime was...

makandra dev

When an LLM model has vision capabilities, you can attach Base64-encoded images to chat messages, and it will load...

I recently ran into this issue when processing a massive backlog of documents. The server completely stalled, sometimes taking up...

You can report CSP violations to a log file. Note that there will be a lots of noise, that is...

When you load a with a nonce, that script can await import() additional sources from any hostname. The nonce is propagated automatically for the one purpose of importing more scripts. This is not related to strict-dynamic, which propagates nonces for any propose not limited to imports (e.g. inserting elements). Example We have a restrictive CSP that only allows nonces: Content-Security-Policy: default-src 'none'; script-src 'nonce-secret123' Our HTML loads script.js using that nonce: Our script.js imports other.js without a nonce: let other = await import('other.js') console.log("Look, script.js has imported %o", other) The import succeeds without a nonce, due to implicit nonce propagation. Why this is useful In modern build pipelines, code splitting (chunking) is implemented using dynamic imports. Nonce propagation allows us to use automatic chunking with restrictive, nonce-based CSPs without using strict-dynamic. E.g. esbuild automatically groups dynamically imported modules into chunks, and writes that chunk to disk. The compiled build has an await import('assets/chunk-NAXSMFJV.js'). There's no way to inject a nonce into that import(), but implicit nonce propagation still allows the request. Should I worry about this? It would require some truly strange code for user input to make it into an import() argument. I wouldn't lose sleep over this. Is this a browser bug? It is by design. Here are some sources: HTML Spec Section 8 (Web Application APIs) (search for "descendant script fetch options") Chromium test ensuring none propagation Firefox bug implementing nonce propagation CSP issue: Someone concerned about propagation being a vulnerability CSP issue: Proposal for import-src that went nowhere Are other CSP sources also propagated? No, only nonces. In particular host-based CSPs do not propagate trust. For example, you only allow scripts from our own host (no nonces): Content-Security-Policy: default-src 'none'; script-src 'self' Our HTML loads script.js from our own host: Our script.js imports other.js from a different host: let other = await import('https://other-host.com/other.js') This fails with a CSP violation: Executing inline script violates the following Content Security Policy directive 'script-src 'self''

Below is a strict, but still workable Content Security Policy for your Ruby on Rails project. Use this CSP if...

I recently encountered this error as I was trying to build assets: $ node esbuild.config.js .../node_modules/esbuild-plugin-browserslist/dist/resolveToEsbuildTarget.js:43 throw new Error('Could...

If you need to implement newsletter sending, rapidmail is a solid option. Support is very fast, friendly and helpful, and...

TypeScript basically uses structural typing, which is conceptually quite similar to duck typing, but with static compile-time type checking...

I use the Gemini web chat interface quite extensively. One thing that is tedious is giving it all the context...

Event listeners are called in the order of their registration: button.addEventListener('click', () => console.log("I run first")) button.addEventListener('click', () => console.log("I...

If you use the selenium-webdriver gem, it will sneakily phone home once every hour whenever you run a browser...

It's not possible to use variables in media queries with plain CSS. @media (max-width: var(--some-pixel-size...

When you query the browser for DOM elements, there are some footguns you should know about. Some lists are synchronized...

makandra dev
maketintsandshades.com

A simple web tool for generating lighter (tints) and darker (shades) versions of any HEX color value. Tip

Compatibility: Angular 20+ with Jasmine 5.x and Karma 6.x As a default Angular CLI auto-generates test bootstrap...

You want to prevent input to a form field, but all the solutions have side effects: The [readonly] attribute is...

developer.chrome.com

The File System Access API is a new capability of modern browsers that allows us to iterate over selected folders...

unpoly.com

Quick reference for passing data from Rails to JavaScript via Unpoly compilers. Haml Attribute Syntax # Ising hash rockets and string...

unpoly.com

Quick guide for frequently used compiler selector patterns of Unpoly. 1. BEM Component Pattern When: Reusable UI components with multiple...