Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Do not merge] Add 1 MB worth of sugarcoat resources #36

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/resources.json

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions filter_lists/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,13 @@
"title": "Brave Android-Specific Rules",
"format": "Standard",
"support_url": "https://github.com/brave/adblock-lists"
},
{
"uuid": "b0433353-1144-473c-8e25-19fb035024b7",
"url": "https://raw.githubusercontent.com/brave/adblock-lists/master/brave-lists/brave-sugarcoat.txt",
"title": "SugarCoat Rules",
"parse_redirect_urls": true,
"format": "Standard",
"support_url": "https://github.com/brave-experiments/sugarcoat-pipeline"
}
]
20 changes: 20 additions & 0 deletions generateMetadataJsonFromScriptResources.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const fs = require("fs");
const path = require("path");

const metadataJsonFile = "metadata.json";
const resourcesDir = "resources";

console.debug(`Creating ${metadataJsonFile}...`);
const resources = fs.readdirSync(resourcesDir);
const metadataList = resources.map((file) => {
return {
name: path.basename(file, ".js"),
aliases: [],
kind: { mime: "application/javascript" },
resourcePath: path.basename(file),
};
});

console.debug(`Writing ${metadataJsonFile}... `);
// Pretty print out
fs.writeFileSync(metadataJsonFile, JSON.stringify(metadataList, null, 4));
66 changes: 65 additions & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,2 +1,66 @@
[
]
{
"name": "sugarcoat-EXc2f2c81d843441bfbe3ef094a9cff39d-libraryCode_source.min-b2d095f00aca850075d265f4a81c8fb7.min",
"aliases": [],
"kind": {
"mime": "application/javascript"
},
"resourcePath": "sugarcoat-EXc2f2c81d843441bfbe3ef094a9cff39d-libraryCode_source.min-b2d095f00aca850075d265f4a81c8fb7.min.js"
},
{
"name": "sugarcoat-analytics-a14946c73def6bdaa93155f58435a82e.min",
"aliases": [],
"kind": {
"mime": "application/javascript"
},
"resourcePath": "sugarcoat-analytics-a14946c73def6bdaa93155f58435a82e.min.js"
},
{
"name": "sugarcoat-analytics.a113b136ebdce01cf16d-7f8d3e5b8a25cb57ea68a3cdbc78a58b.min",
"aliases": [],
"kind": {
"mime": "application/javascript"
},
"resourcePath": "sugarcoat-analytics.a113b136ebdce01cf16d-7f8d3e5b8a25cb57ea68a3cdbc78a58b.min.js"
},
{
"name": "sugarcoat-cmp2-a52bcd9059a7d75c4d5b8f66db49a380.min",
"aliases": [],
"kind": {
"mime": "application/javascript"
},
"resourcePath": "sugarcoat-cmp2-a52bcd9059a7d75c4d5b8f66db49a380.min.js"
},
{
"name": "sugarcoat-gpt-83c6e054eb06b453d56c97b9ddd181d6.min",
"aliases": [],
"kind": {
"mime": "application/javascript"
},
"resourcePath": "sugarcoat-gpt-83c6e054eb06b453d56c97b9ddd181d6.min.js"
},
{
"name": "sugarcoat-launch-EN3932511771fb4e5e9dd852ae89372b59.min-7754fade75bed02e4097bf3d7fff178c.min",
"aliases": [],
"kind": {
"mime": "application/javascript"
},
"resourcePath": "sugarcoat-launch-EN3932511771fb4e5e9dd852ae89372b59.min-7754fade75bed02e4097bf3d7fff178c.min.js"
},
{
"name": "sugarcoat-launch-ENbb9d0de7cc374dc99259df2c4b823cef.min-2eb9609b74432d652877d41a51a8d2ba.min",
"aliases": [],
"kind": {
"mime": "application/javascript"
},
"resourcePath": "sugarcoat-launch-ENbb9d0de7cc374dc99259df2c4b823cef.min-2eb9609b74432d652877d41a51a8d2ba.min.js"
},
{
"name": "sugarcoat-moatheader-7754008b0da848856cddb20094976335.min",
"aliases": [],
"kind": {
"mime": "application/javascript"
},
"resourcePath": "sugarcoat-moatheader-7754008b0da848856cddb20094976335.min.js"
}
]

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.