• Stars
    star
    158
  • Rank 237,131 (Top 5 %)
  • Language
    JavaScript
  • Created about 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Build browser extensions with Svelte (early prototype)

sveltekit-adapter-browser-extension

Adapter for SvelteKit which turns your app into a cross-platform browser extension.

Usage

Install with npm i -D sveltekit-adapter-browser-extension, then add the adapter to your svelte.config.js.

Some additional configuration is required for this adapter to work - you need to (1) set appDir to something without an underscore and (2) tell kit to prerender its pages by default:

// svelte.config.js
import adapter from 'sveltekit-adapter-browser-extension';

export default {
	kit: {
		adapter: adapter({
			// default options are shown
			pages: 'build', // the output directory for the pages of your extension
			assets: undefined, // the asset output directory is derived from pages if not specified explicitly
			fallback: undefined, // set to true to output an SPA-like extension
			manifestVersion: 3 // the version of the automatically generated manifest (Version 3 is required by Chrome).
		}),
		appDir: 'ext', // This is important - chrome extensions can't handle the default _app directory name.
		prerender: {
			default: true
		}
	}
};

Try it

An example barebone app exists at ./example-app. You can npm run build here and install the extension.

To try with your own app:

Install the adapter and npm run build. Go to your browser's extension page and install unpacked extension - point it at the build directory within your app.

If you get an error about _app being a disallowed folder, delete _app from within the build dir. It appears there sometimes and I'm not sure why - I'll fix as soon as possible!

Configuration

To specify your own manifest information (it will be merged with the generated one), simply have a manifest file local within your app directory.

Roadmap

I am looking for help to build and maintain this module. Roadmap is:

  • Specifying the type of extension via config
  • Allowing icons and such to be driven by configuration

License

MIT

More Repositories

1

sapper-authentication-demo

A demonstration of Auth with Sapper + JWT + Server Side Rendering + RBAC
JavaScript
100
star
2

svelte-box

A truffle box for svelte
JavaScript
61
star
3

sapper-ie

Sapper working in IE11/Edge
JavaScript
45
star
4

rollup-plugin-svg

SVG Plugin for rollupjs
JavaScript
30
star
5

grails-oauth-scribe

Grails Oauth plugin using the Scribe library
Groovy
23
star
6

svelte-meetup-talk-oct-2019

HTML
16
star
7

grails-ajax-uploader

The Grails Ajax-Uploader plugin is a Grails Tag Library which implements Andrew Valum's excellent file uploader. Supporting drag and drop, progress/status updates, multiple file uploads and more for your application. Visit http://www.grails.org/plugin/ajax-uploader for detailed documentation and feature list.
JavaScript
15
star
8

svelte-seed

A seed project for getting up and running super quick with svelte
HTML
14
star
9

nidus

Non-storing password store
JavaScript
12
star
10

hapi-svelte-views

Svelte view plugin for HapiJS, which supports SSR and CSR
JavaScript
9
star
11

github-backup

Backup github organisations with a single command
JavaScript
8
star
12

hapi-svelte

Svelte plugin for Hapi, including SSR - Experimental for now
JavaScript
7
star
13

hapda

Define Hapi route handlers for serverless endpoints on now / aws / sls / gcf
JavaScript
7
star
14

svelte-tree

A collapsible tree with context menus (aimara) modernised and built in svelte
JavaScript
5
star
15

jest-multi-test-result-processor

Allow the composition of test-result-processors in Jest so that you can produce multiple reports in a single test run
JavaScript
4
star
16

svelte-template-ie11-edge

A template / boilerplate for Svelte which works on IE11 and old Edge (Polyfills, buble)
JavaScript
4
star
17

grails-extra-validators

A collection of extended validators for grails, such as postcodes, urls, ip addresses and more. See the full list at the official plugin page: http://www.grails.org/plugin/extra-validators
Groovy
3
star
18

alexa-hapi-tv-skill

Example Alexa skill to turn my TV on and off using HapiJS
JavaScript
3
star
19

grails-social-sharing-plugin

Social bookmarking plugin which makes it easy for users to share your content on up to 140 different social media sites. See http://www.grails.org/plugin/sexy-bookmarks for detailed usage information
Groovy
3
star
20

unquirer

A wrapper for Inquirer to allow pre-answering questions with command line arguments
JavaScript
2
star
21

intercom-demo

A demo of Svelte Intercon
JavaScript
2
star
22

pipebin-cli

CLI for https://pipeb.in
JavaScript
2
star
23

websocket-tester

A run-once docker container for testing websocket endpoints as part of a CI build or locally
JavaScript
2
star
24

train-departures

Provides a national-rail like train departures board for your application. Data is pulled from the national rail website and displayed as if it were an LCD display board at a train station.
Groovy
2
star
25

grails-html-cleaner

HTML Cleaning plugin for Grails which can make use of either the jtidy or htmlcleaner projects, depending on preference.
Groovy
1
star
26

svelte-talk-context-api-march-2020

Talk for Svelte Meetup in March 2020 - The Context API
HTML
1
star
27

vercel-routing-issue-repro

JavaScript
1
star
28

test-probot

For testing probot interactions
1
star
29

parcel-plugin-prepack

Facebook Prepack for Parcel!
JavaScript
1
star
30

lingohub

Unofficial LingoHub client
JavaScript
1
star
31

svelte-typescript

Trying out official Svelte TypeScript support
JavaScript
1
star
32

codesandbox-sapper-template-v3

JavaScript
1
star
33

sapper-fetch-wrapper

Demonstrating an issue wrapping this.fetch
JavaScript
1
star
34

grails-console-enhancements

Console enhancements (colouring etc) for the grails console, and grails sysout.
Groovy
1
star
35

adapters-talk-november-2021

A lightning talk on sveltekit adapters
JavaScript
1
star
36

currentcost-monitor

Provides graphing and detailed logging from your CurrentCost CC128 energy usage meter.
JavaScript
1
star
37

grails-image-cropper

The Grails Image Cropping Plugin provides wysiwyg javascript-based visual cropping and resizing for images by utilising the JS Cropper library.
JavaScript
1
star
38

buildlight-milight

Use cheap led bulbs (LimitlessLED, MiLight) as build status indicators for CircleCI
JavaScript
1
star
39

fit-text

Automatically resizes text to its fit into its parent
JavaScript
1
star
40

express-jasmine-testem

Initial commit.
JavaScript
1
star
41

sapper-incongruous-layouts-issue

Reproduction of issue in Sapper > 0.28.6 where incongruous layouts cause preload to break
JavaScript
1
star
42

plugin-host

Host for testing all my plugins
1
star