add https everywhere to Chromium extension loadout

Former-commit-id: e85eb22f91
Former-commit-id: 81114b318ee79ff86d0af24f7fd80629f2a1e1fb
This commit is contained in:
idk
2022-09-14 22:37:32 -04:00
parent 186ebd3539
commit 9a8c20b90c
6 changed files with 44 additions and 16 deletions

View File

@ -321,7 +321,7 @@ Linux(because the top command will be run and the script will exit).\n\nBoth det
<arg value="gcbommkclmclpchllfjekcdonpmejbdp" />
<arg value="-u=true"/>
<arg value="-o" />
<arg value="src/i2p.chromium.base.profile/extensions/https-everywhere.js.crx" />
<arg value="src/i2p.chromium.usability.profile/extensions/https-everywhere.js.crx" />
</exec>
</target>

File diff suppressed because one or more lines are too long

View File

@ -1384,6 +1384,7 @@ Parser.prototype.SelectorCompiler = class {
this.reDropScope = /^\s*:scope\s*(?=[+>~])/;
this.reIsDanglingSelector = /[+>~\s]\s*$/;
this.reIsCombinator = /^\s*[+>~]/;
this.reForgivingOps = /:has\(/;
this.regexToRawValue = new Map();
// https://github.com/gorhill/uBlock/issues/2793
this.normalizedOperators = new Map([
@ -1416,7 +1417,15 @@ Parser.prototype.SelectorCompiler = class {
}
// Can be used in a declarative CSS rule?
if ( asProcedural === false && this.sheetSelectable(raw) ) {
// https://github.com/uBlockOrigin/uBlock-issues/issues/2228
// Some operators are forgiving, so we need to exclude them for now
// as potentially declarative selectors until we validate that their
// arguments are themselves valid plain CSS selector.
if (
asProcedural === false &&
this.reForgivingOps.test(raw) === false &&
this.sheetSelectable(raw)
) {
out.compiled = raw;
return true;
}
@ -1444,7 +1453,7 @@ Parser.prototype.SelectorCompiler = class {
}
// Procedural selector?
const compiled = this.compileProceduralSelector(raw);
const compiled = this.compileProceduralSelector(raw, asProcedural);
if ( compiled === undefined ) { return false; }
out.compiled =
@ -1522,8 +1531,8 @@ Parser.prototype.SelectorCompiler = class {
return true;
}
compileProceduralSelector(raw) {
const compiled = this.compileProcedural(raw, true);
compileProceduralSelector(raw, asProcedural = false) {
const compiled = this.compileProcedural(raw, true, asProcedural);
if ( compiled !== undefined ) {
compiled.raw = this.decompileProcedural(compiled);
}
@ -1606,6 +1615,7 @@ Parser.prototype.SelectorCompiler = class {
if ( this.querySelectable(s) === false ) {
return this.compileProcedural(s);
}
return s;
}
compileUpwardArgument(s) {
@ -1737,7 +1747,7 @@ Parser.prototype.SelectorCompiler = class {
return raw.join('');
}
compileProcedural(raw, root = false) {
compileProcedural(raw, root = false, asProcedural = false) {
if ( raw === '' ) { return; }
const tasks = [];
@ -1781,20 +1791,28 @@ Parser.prototype.SelectorCompiler = class {
// Unbalanced parenthesis? An unbalanced parenthesis is fine
// as long as the last character is a closing parenthesis.
if ( pcnt !== 0 && c !== 0x29 ) { return; }
// Extract and remember operator/argument details.
const opname = raw.slice(opNameBeg, opNameEnd);
const oparg = raw.slice(opNameEnd + 1, i - 1);
const operator = this.normalizedOperators.get(opname) || opname;
// https://github.com/uBlockOrigin/uBlock-issues/issues/341#issuecomment-447603588
// Maybe that one operator is a valid CSS selector and if so,
// then consider it to be part of the prefix.
if ( this.querySelectable(raw.slice(opNameBeg, i)) ) { continue; }
// Extract and remember operator details.
let operator = raw.slice(opNameBeg, opNameEnd);
operator = this.normalizedOperators.get(operator) || operator;
// https://github.com/uBlockOrigin/uBlock-issues/issues/2228
// Maybe an operator is a valid CSS selector, but if it is
// "forgiving", we also need to validate that the argument itself
// is also a valid CSS selector.
if (
asProcedural === false &&
this.querySelectable(raw.slice(opNameBeg, i)) &&
this.querySelectable(oparg)
) {
continue;
}
// Action operator can only be used as trailing operator in the
// root task list.
// Per-operator arguments validation
const args = this.compileArgument(
operator,
raw.slice(opNameEnd + 1, i - 1)
);
const args = this.compileArgument(operator, oparg);
if ( args === undefined ) { return; }
if ( opPrefixBeg === 0 ) {
prefix = raw.slice(0, opNameBeg);

View File

@ -97,7 +97,7 @@
"storage": {
"managed_schema": "managed_storage.json"
},
"version": "1.44.0",
"version": "1.44.2",
"web_accessible_resources": [
"/web_accessible_resources/*"
]

View File

@ -77,6 +77,7 @@
getTargetingKeys: nooparrayfn,
getSlots: nooparrayfn,
refresh: noopfn,
removeEventListener: noopfn,
set: noopthisfn,
setCategoryExclusion: noopthisfn,
setCentering: noopfn,

View File

@ -438,15 +438,24 @@ public class I2PChromium extends I2PCommonBrowser {
"extensions/i2pchrome.js")
.getAbsolutePath() +
"," +
new File(I2PChromiumProfileBuilder.profileDirectory(),
"extensions/https-everywhere.js")
.getAbsolutePath() +
"," +
new File(I2PChromiumProfileBuilder.profileDirectory(),
"extensions/noscript.js")
.getAbsolutePath();
} else {
newArgs[31] = "--load-extension=" +
new File(I2PChromiumProfileBuilder.profileDirectory(),
"extensions/i2pchrome.js")
.getAbsolutePath() +
"," +
new File(I2PChromiumProfileBuilder.profileDirectory(),
"extensions/https-everywhere.js")
.getAbsolutePath() +
"," +
new File(I2PChromiumProfileBuilder.profileDirectory(),
"extensions/jshelter.js")
.getAbsolutePath() +