From 76f1058d353100c0e73720349da1c79f0aa2c193 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 4 Aug 2018 03:06:59 +0200 Subject: Apply CSS styles to a website A minimal prototype. manifest.json: * Include new content script * Ask permissions for all HTTP and HTTPS site css/.keep: This directory will be "empty" in the release version. Add a dummy file to ensure the directory appears in version control to make it clear that's where user stylesheet files should go. css/example.com.css: Sample CSS file to see that styles are getting applied correctly. background.js: Load the `example.com.css` file into the current tab's web page. It does this on a message from a content script. We do this because this file only gets executed once and we can't call `browser.tabs.insertCSS()` in the content script. While we could add the stylesheet directly in the content script, it seemed to me that it would be simpler to call `insertCSS()` instead of, say, adding a `