The Problem
Users on IKEA product pages must manually locate, copy, and save the 3‑D model URL to obtain a .glb file. This extra step is repetitive and error‑prone, especially for non‑technical shoppers who want to preview furniture in their own 3‑D planning tools.
What This Does
The repository supplies a single Tampermonkey user script – ikea-3d-model-downloader.user.js – that runs in the browser on IKEA product pages. It injects a Download 3D button next to the existing View in 3D control and, when clicked, automatically fetches the model file and saves it with a name derived from the product title and colour. The accompanying README.md explains installation via Tampermonkey and shows a screenshot (sample.jpg). No other source files or build artefacts are present.
How It Is Wired
Execution begins when Tampermonkey loads ikea-3d-model-downloader.user.js into the page context (default @run-at document-end). The script:
- DOM discovery – locates the container that holds the IKEA “View in 3D” button using selectors such as
button[data-testid="view-3d"]. - Button injection – creates a new
<button>element, sets its text to “Download 3D”, and appends it to the same parent node. - Click handler – registers
onclickon the injected button. The handler: Builds the model URL by reading a hidden JSON payload (window.__INITIAL_STATE__or similar) that contains the GLB endpoint. Callsfetch(modelUrl)and awaits the response as anArrayBuffer. Wraps the buffer in aBlob(type: 'model/gltf-binary'), generates an object URL, creates a temporary<a>element withdownloadattribute set to[Product Name] - [Color].glb, triggers a click on that link, then revokes the object URL. Encloses the network call in atry { … } catch {}block; the catch is empty, silently discarding any errors (see Code Health).
There are no import statements, external modules, or circular dependencies – the script is self‑contained. All side effects (DOM mutation, network request, file download) originate from the single click handler, making the blast radius limited to the page in which it runs.
How To Use It
- Install the Tampermonkey extension for your browser.
- Add the script by opening the raw file URL:
https://github.com/apinanaivot/IKEA-3D-Model-Download-Button/raw/refs/heads/main/ikea-3d-model-downloader.user.js
Tampermonkey will prompt to create a new script; confirm and enable it.
- Navigate to any IKEA product page that displays a “View in 3D” button. The new “Download 3D” button appears automatically.
- Click the button; the model downloads to your default folder with a name like
BILLY – White.glb.
No build step, package manager, or configuration file is required.
Real‑World Use
A interior‑design consultancy can equip each designer’s browser with this script. When a client selects a piece on IKEA’s site, the designer clicks Download 3D, imports the resulting .glb into Blender, and quickly renders a client‑specific room layout without leaving the browser.
Code Health & Issues
- Medium – Empty catch block –
ikea-3d-model-downloader.user.jscontainscatch {}that swallows errors, preventing debugging of network or parsing failures. - Medium – High branching density – The same file has 80 branch points across 172 lines, making the click‑handler logic hard to follow and maintain.
- SDLC – No tests – Repository lacks any test files, so functional regressions are not automatically detected.
- SDLC – No CI pipeline – No
.github/workflows or other CI configuration present. - License – Missing – No
LICENSEfile, leaving usage and redistribution rights ambiguous.
The Bottom Line
The repo delivers a lightweight, single‑file browser extension that solves a clear user friction point on IKEA product pages. Its implementation is straightforward but suffers from limited error handling and dense conditional logic, and the project lacks any testing or licensing scaffolding. It is suitable for individual users or small teams who need quick 3‑D model access and are comfortable reviewing and possibly refactoring the script for robustness.