<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Legibility/css, branch master</title>
<subtitle>A WebExtension that lets you override the CSS of any website</subtitle>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/Legibility/'/>
<entry>
<title>Remove css/example.com.css now that we now style application works</title>
<updated>2018-08-04T01:42:21+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-08-04T01:42:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/Legibility/commit/?id=4b4c06cfb4ec5b12d107e79610cae851c25fd24c'/>
<id>4b4c06cfb4ec5b12d107e79610cae851c25fd24c</id>
<content type='text'>
Remove this test file.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove this test file.
</pre>
</div>
</content>
</entry>
<entry>
<title>Apply CSS styles to a website</title>
<updated>2018-08-04T01:06:59+00:00</updated>
<author>
<name>Teddy Wing</name>
</author>
<published>2018-08-04T01:06:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.teddywing.com/Legibility/commit/?id=76f1058d353100c0e73720349da1c79f0aa2c193'/>
<id>76f1058d353100c0e73720349da1c79f0aa2c193</id>
<content type='text'>
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 `&lt;style&gt;` tag etc.

content.js:
Sent a message to the background script to insert CSS. Just using a
dummy message for now. In the future, this will be replaced with the
domain of the current page, which will be matched against the CSS
filename.

Additionally, we assign `browser` to `chrome` because stupidly, Chrome
doesn't expose its `chrome` objects as `browser` as in the WebExtensions
standard. Normally this should work in Firefox too, but I haven't tested
it yet. My guess is that I'll probably need to change the:

    var browser;

line to

    var browser = browser;

But we'll see when we start testing that.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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 `&lt;style&gt;` tag etc.

content.js:
Sent a message to the background script to insert CSS. Just using a
dummy message for now. In the future, this will be replaced with the
domain of the current page, which will be matched against the CSS
filename.

Additionally, we assign `browser` to `chrome` because stupidly, Chrome
doesn't expose its `chrome` objects as `browser` as in the WebExtensions
standard. Normally this should work in Firefox too, but I haven't tested
it yet. My guess is that I'll probably need to change the:

    var browser;

line to

    var browser = browser;

But we'll see when we start testing that.
</pre>
</div>
</content>
</entry>
</feed>
