Skip to content

Commit

Permalink
update readability, fix linting & signing (see #9)
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasGollenstede committed Dec 14, 2020
1 parent f204bb2 commit 49c9710
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion common/epub.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'node_modules/es6lib/string': { Guid, },
'node_modules/jszip/dist/jszip.min': JsZip,
Templates,
}) => {
}) => { /* globals setTimeout, */

const mimeType = mimeTypes.epub;

Expand Down
4 changes: 2 additions & 2 deletions content/collect/about-reader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(function(global) { 'use strict'; define(({ // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
}) => async function collect({ document = global.document, } = { }) {
}) => async function collect({ document = global.document, } = { }) { /* globals URL, */
/**
* Collects the contents of an about:reader view.
* @return {object} Options that can be passed as argument to the EPub constructor.
Expand Down Expand Up @@ -53,7 +53,7 @@ function toXML(element) {
async function pathPrefix(string) {
const hash = global.crypto.subtle // not available on HTTP sites
? new Uint8Array((await global.crypto.subtle.digest('SHA-1', new global.TextEncoder('utf-8').encode(string)))) // a deterministic name is better
: crypto.getRandomValues(new Uint8Array(16)); // but random also works
: global.crypto.getRandomValues(new Uint8Array(16)); // but random also works
return Array.from(hash).map((b => b.toString(16).padStart(2, '0'))).join('');
}

Expand Down
2 changes: 1 addition & 1 deletion content/collect/readability.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
'node_modules/web-ext-utils/browser/': { manifest, },
'shim!node_modules/readability/Readability:Readability': Readability,
aboutReader,
}) => async function collect({ document: srcDoc = global.document.cloneNode(true), url = srcDoc.URL, } = { }) {
}) => async function collect({ document: srcDoc = global.document.cloneNode(true), url = srcDoc.URL, } = { }) { /* globals URL, */
/**
* Collects the contents of any website that can be opened in the `about:reader` view.
* Since extensions can't access pages in reader mode any more, this emulates the reader mode
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"jszip": "github:Stuk/jszip#v3.1.5",
"multiport": "0.2.3",
"pbq": "0.5.0",
"readability": "github:mozilla/readability#26379fe",
"web-ext-build": "0.0.11",
"readability": "github:mozilla/readability#290724c68c93359139a4663d18460f6d26e192e6",
"web-ext-build": "0.0.12",
"web-ext-utils": "0.1.13"
},
"devDependencies": {
Expand All @@ -54,6 +54,7 @@
}
},
"eslintConfig": {
"extends": "./node_modules/eslintrc/web-ext.js"
"extends": "./node_modules/eslintrc/web-ext.js",
"root": true
}
}

0 comments on commit 49c9710

Please sign in to comment.