Skip to content

Commit

Permalink
remove protobuf.js + bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
gildas-lormeau committed Mar 4, 2022
1 parent 53e4bb2 commit 9a5138e
Show file tree
Hide file tree
Showing 15 changed files with 11 additions and 8,569 deletions.
2 changes: 1 addition & 1 deletion lib/extension-background.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/extension.js

Large diffs are not rendered by default.

7 changes: 0 additions & 7 deletions lib/protobuf.js

This file was deleted.

2 changes: 1 addition & 1 deletion lib/single-file.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"64": "src/extension/ui/resources/icon_64.png",
"128": "src/extension/ui/resources/icon_128.png"
},
"version": "1.0.59",
"version": "1.0.60",
"description": "__MSG_extensionDescription__",
"content_scripts": [
{
Expand Down
7 changes: 0 additions & 7 deletions rollup.config.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ export default [{
format: "iife",
plugins: []
}]
}, {
input: ["src/extension/lib/vendor/protobuf/protobuf.js"],
output: [{
file: "lib/protobuf.js",
format: "iife",
plugins: []
}]
}, {
input: ["src/extension/lib/single-file/browser-polyfill/chrome-browser-polyfill.js"],
output: [{
Expand Down
7 changes: 0 additions & 7 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,6 @@ export default [{
format: "iife",
plugins: [terser()]
}]
}, {
input: ["src/extension/lib/vendor/protobuf/protobuf.js"],
output: [{
file: "lib/protobuf.js",
format: "iife",
plugins: [terser()]
}]
}, {
input: ["src/extension/lib/single-file/browser-polyfill/chrome-browser-polyfill.js"],
output: [{
Expand Down
4 changes: 1 addition & 3 deletions src/extension/core/bg/background.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
<body>
<script src="/lib/chrome-browser-polyfill.js"></script>
<script src="/lib/extension-background.js"></script>
<script src="/lib/protobuf.js"></script>
<script src="/lib/single-file.js"></script>
<script src="/lib/infobar.js"></script>
<script src="/src/extension/core/common/page-proto.js"></script>
<script src="/lib/infobar.js"></script>
</body>

</html>
4 changes: 1 addition & 3 deletions src/extension/core/bg/business.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@ const TASK_PENDING_STATE = "pending";
const TASK_PROCESSING_STATE = "processing";

const extensionScriptFiles = [
"lib/protobuf.js",
"lib/infobar.js",
"lib/extension.js",
"/src/extension/core/common/page-proto.js"
"lib/extension.js"
];

const tasks = [];
Expand Down
4 changes: 2 additions & 2 deletions src/extension/core/bg/downloads.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* Source.
*/

/* global browser, singlefile, URL, protobuf, Response */
/* global browser, singlefile, URL, Response */

import * as config from "./config.js";
import * as bookmarks from "./bookmarks.js";
Expand Down Expand Up @@ -108,7 +108,7 @@ async function downloadTabPage(message, tab) {
if (skipped) {
ui.onEnd(tabId);
} else {
const pageData = protobuf.roots.default.Page.decode(singlefile.helper.flatten(contents));
const pageData = JSON.parse(singlefile.helper.flatten(contents).join(""));
const blob = await singlefile.processors.compression.process(pageData, {
insertTextBody: message.insertTextBody,
url: tab.url,
Expand Down
4 changes: 2 additions & 2 deletions src/extension/core/common/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* Source.
*/

/* global browser, infobar, protobuf */
/* global browser, infobar */

const MAX_CONTENT_SIZE = 8 * (1024 * 1024);

Expand All @@ -36,7 +36,7 @@ async function downloadPage(pageData, options) {
if (options.includeBOM) {
pageData.content = "\ufeff" + pageData.content;
}
const content = Array.from(protobuf.roots.default.Page.encode(pageData).finish());
const content = JSON.stringify(pageData);
for (let blockIndex = 0; blockIndex * MAX_CONTENT_SIZE < content.length; blockIndex++) {
const message = {
method: "downloads.download",
Expand Down
Loading

0 comments on commit 9a5138e

Please sign in to comment.