davidmaxwaterman / bookmarks-sync-test

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sync-test

This extension is to implement middleware to facilitate testing of the sync extension from Panic (the Gun testing framework).

It works by implementing the browser.bookmarks API, and making it available to Panic so that bookmarks can be created/etc as would a user, and event listeners called as bookmarks are changed.

It would be installed in two browser instances, which would have their bookmarks synced by the sync extension via Gun - that is what is being tested.

Usage Notes

The extension manifest is defined in src/manifest.js and used by @samrum/vite-plugin-web-extension in the vite config.

Background, content scripts, options, and popup entry points exist in the src/entries directory.

Content scripts are rendered by src/entries/contentScript/renderContent.js which renders content within a ShadowRoot and handles style injection for HMR and build modes.

Otherwise, the project functions just like a regular Vite project.

Refer to @samrum/vite-plugin-web-extension for more usage notes.

Customize configuration

See Vite Configuration Reference.

Project Setup

npm install

Commands

Build

Development, HMR

Hot Module Reloading is used to load changes inline without requiring extension rebuilds and extension/page reloads

npm run dev

Development, Watch

Rebuilds extension on file changes. Requires a reload of the extension (and page reload if using content scripts)

npm run watch

Production

Minifies and optimizes extension build

npm run build

Load extension in browser

Loads the contents of the dist directory into the specified browser

npm run serve:chrome
npm run serve:firefox

About


Languages

Language:JavaScript 87.7%Language:HTML 6.9%Language:CSS 5.4%