Home (All Topics) → Technology → Software → AI-Created Software
The following is AI-generated (aka vibe-coded) software. The software is specific to my needs and my system and may not work for you or your system. Support is limited, but if you report a bug I'll certainly look into it. All code is provided in a zip file for you to review should you choose.
Clears Vivaldi’s cache (cached images and files) automatically: every few minutes, hours or days, whenever the browser starts or a profile is opened, or on demand. It can also clear sites’ offline caches, skip sites you choose, and back its settings up to a folder every few days.
Everything runs locally. The extension makes no network requests, reads no page content and has no host permissions. It never touches history, cookies, passwords or site logins.

vivaldi://extensions and turn on Developer mode.The options page opens after installing. Click the toolbar button to open it again.
Tick one or both triggers and click Save:
chrome.runtime.onStartup, which fires once per profile when that profile first opens: at browser start for the profile that opens then, and later for any other profile the moment you open a window for it.Clear cache now clears straight away. The Last cleared line shows when the last clear happened and what triggered it, or the error if it failed.
example.com means https://example.com; write http:// or a port to name a different origin. Each line is an exact origin, so example.com doesn’t cover www.example.com. Anything that isn’t an http(s) site is dropped on save.
Right-click the toolbar button and choose Never clear this site (or clear it again). It adds the current tab’s site (its exact origin, e.g. https://www.example.com) to “Never clear these sites”, or takes it off if it’s already there. The button briefly shows + (added) or − (removed), and hovering it says which site. On a page that isn’t an http(s) site, such as vivaldi:// pages, it shows ! and changes nothing.
Settings can be exported to a JSON file and imported again from the options page. Scheduled backups are saved into a folder inside Downloads every N days. Only the newest backup from each earlier day is kept, for as many days as the “Keep” setting allows. A restored file is checked the same way as the settings form, so a crafted file can’t store anything the form wouldn’t. The last-cleared time isn’t part of a backup.
| File | Purpose |
|---|---|
manifest.json |
Manifest V3, module service worker |
background.js |
Service worker: the clear alarm, the startup trigger, clearing, the toolbar menu, message handlers and scheduled backups |
lib.js |
Settings, sanitizeSettings, toggleKeepSite, alarm timing (alarmPlan, firstDelay), the browsingData arguments (removalArgs), backup file build and parse (tested in Node) |
options.html, options.js, options.css |
Options page |
shared/backup.js |
Shared backup helpers and scheduler, on globalThis.SharedBackup. A plain script, so the worker loads it with import and pages with <script>. Do not edit here |
shared/sender.js |
Shared message-sender and host checks. Do not edit here |
test_backup.mjs |
Node tests for lib.js and shared/: node test_backup.mjs |
test_worker.mjs |
Node tests that run background.js against a fake chrome: node test_worker.mjs |
screenshot.png |
The options page, for this README |
| Permission | Why |
|---|---|
activeTab |
Reading the current tab’s address, only when you choose the toolbar menu item |
contextMenus |
The “Never clear this site” item on the toolbar button’s right-click menu |
browsingData |
Clearing the cache (and, if chosen, Cache Storage) |
alarms |
The clear schedule, and the hourly check for whether a scheduled backup is due |
storage |
Settings and the last-cleared time |
downloads |
Saving scheduled backups and removing old ones |
chrome.browsingData.remove({ since: 0, excludeOrigins }, { cache: true, cacheStorage }).removalArgs in lib.js builds both arguments from the settings.clear-cache.syncAlarm runs on install, on every startup and whenever the settings change. alarmPlan keeps an alarm whose period already matches, removes it when the schedule is off, and otherwise creates it with the first delay counted from the last successful clear (firstDelay).clearCache runs one clear at a time and hands both callers the same result.onStartup can’t be tried out with Playwright: an extension loaded with --load-extension is installed afresh on every launch and gets onInstalled instead. Load it with Load unpacked and restart Vivaldi (or open a second profile) to try the startup trigger.
shared/sender.js. clear-now and backup-now are accepted only from the options page.sanitizeSettings. Kept sites are parsed with URL and stored as bare http(s) origins.activeTab, which Chrome grants for that one click. Text is written with textContent, never innerHTML.
node test_backup.mjs && node test_worker.mjs
1.0.0 — First version: clears the cache on a schedule (minutes, hours or days), at browser or profile start and on demand, with optional Cache Storage, kept sites, and settings backups.
1.1.0 — The toolbar button’s right-click menu adds the current site to “Never clear these sites”, or takes it off again.


Leave a Reply