Skip to content

Commit

Permalink
v8.6
Browse files Browse the repository at this point in the history
  • Loading branch information
erosman authored Dec 11, 2023
1 parent 99b0ad6 commit 6e69959
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 5 deletions.
9 changes: 9 additions & 0 deletions src/content/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@

<h1 id="changelog">Changelog</h1>
<dl>

<dt>8.6</dt>
<dd>Fixed an issue with migrating database from older versions (#69)</dd>
<dd>Updated user interface to disable inapplicable options in proxies (#52)</dd>
<dd>Updated wildcard to regular expression conversion (#72)</dd>

<dt>8.5</dt>
<dd>Skipped</dd>

<dt>8.4</dt>
<dd>Added light/dark theme detection for badge background color (#61)</dd>
<dd>Enabled to run with "controlled_by_other_extensions" on Firefox (#68)</dd>
Expand Down
2 changes: 1 addition & 1 deletion src/content/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ <h4>Storage quotas for sync data</h4>


<h2>Proxy DNS <span>(Firefox only)</span></h2>
<p>Option to pass DNS to the SOCKS proxy when using SOCKS v5</p>
<p>Option to pass DNS to the SOCKS proxy when using SOCKS</p>

<h2>Limit WebRTC <span>(requires "privacy" permission)</span></h2>
<p>Toggle <a href="https://developer.mozilla.org/docs/Web/API/WebRTC_API" target="_blank">WebRTC</a> browser settings as it has been known to leak real IP</p>
Expand Down
2 changes: 1 addition & 1 deletion src/content/migrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export class Migrate {
const db = App.getDefaultPref();
db.sync = !!pref.sync;

const data = Object.values(pref).filter(i => Object.hasOwn(i, 'address'));
const data = Object.values(pref).filter(i => i && Object.hasOwn(i, 'address')); // null value causes an error
data.sort((a, b) => a.index - b.index); // sort by index

data.forEach(item => {
Expand Down
8 changes: 8 additions & 0 deletions src/content/options.css
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,14 @@ details.proxy[data-type="socks4"] :is(
pointer-events: none;
user-select: none;
}

details.proxy[data-type="socks5"][data-chrome] :is(
[data-i18n="username"], [data-id="username"],
[data-i18n="password"], .password) {
opacity: 0.3;
pointer-events: none;
user-select: none;
}
/* ----- hide/show elements ----- */

/* ----- Popup ----- */
Expand Down
4 changes: 3 additions & 1 deletion src/content/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,9 @@ class Proxies {
return;
}

pxy.dataset.type = item.type; // hide/show elements
// hide/show elements
pxy.dataset.type = item.type;
App.firefox || (pxy.dataset.chrome = true);

const id = item.type === 'pac' ? item.pac : `${item.hostname}:${item.port}`;
this.proxyCache[id] = item; // cache to find later
Expand Down
15 changes: 14 additions & 1 deletion src/content/pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,23 @@ export class Pattern {
if (str === '*') { return '\\S+'; }

// escape regular expression special characters, minus * ?
return str.replace(/[.+^${}()|[\]\\]/g, '\\$&')
str = str.replace(/[.+^${}()|[\]\\]/g, '\\$&')
.replace(/\*/g, '.*')
.replace(/\?/g, '.')
.replace(/:\/\/\.\*\\./g, '://(.*\\.)?');

// convert leading '://' or '.*://'
switch (true) {
case str.startsWith('://'):
str = '^[^:]+' + str;
break;

case str.startsWith('.*://'):
str = '^[^:]+' + str.substring(2);
break;
}

return str;
}

static getPassthrough(str) {
Expand Down
2 changes: 1 addition & 1 deletion src/content/sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class Sync {

static hasOldData(obj) {
// FP v3 OR FP v7
return Object.hasOwn(obj, 'settings') || Object.values(obj).some(i => Object.hasOwn(i, 'address'));
return Object.hasOwn(obj, 'settings') || Object.values(obj).some(i => i && Object.hasOwn(i, 'address'));
}

static async getSync(pref) {
Expand Down

0 comments on commit 6e69959

Please sign in to comment.