Skip to content

Commit f0f18e1

Browse files
committed
refactor: remove notsamedomain code, needs work to migrate properly
1 parent a469327 commit f0f18e1

File tree

6 files changed

+683
-682
lines changed

6 files changed

+683
-682
lines changed

src/background/isolation.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -634,20 +634,20 @@ export class Isolation {
634634
return true;
635635

636636
case 'notsamedomainexact':
637-
if (target !== origin) {
638-
this.debug(
639-
'[checkIsolationPreferenceAgainstUrl] isolating based on "notsamedomainexact"'
640-
);
641-
return true;
642-
}
637+
// if (target !== origin) {
638+
// this.debug(
639+
// '[checkIsolationPreferenceAgainstUrl] isolating based on "notsamedomainexact"'
640+
// );
641+
// return true;
642+
// }
643643

644644
case 'notsamedomain':
645-
if (!this.utils.sameDomain(origin, target)) {
646-
this.debug(
647-
'[checkIsolationPreferenceAgainstUrl] isolating based on "notsamedomain"'
648-
);
649-
return true;
650-
}
645+
// if (!this.utils.sameDomain(origin, target)) {
646+
// this.debug(
647+
// '[checkIsolationPreferenceAgainstUrl] isolating based on "notsamedomain"'
648+
// );
649+
// return true;
650+
// }
651651
}
652652
return false;
653653
}

src/background/mouseclick.ts

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
ClickType,
1111
ClickMessage,
1212
WebRequestOnBeforeRequestDetails,
13+
IsolationDomain,
1314
} from '~/types';
1415

1516
export class MouseClick {
@@ -100,7 +101,7 @@ export class MouseClick {
100101
): boolean => {
101102
if (preferences.action === 'always') {
102103
this.debug(
103-
'[checkClick] click handled based on preference "always"',
104+
'[checkClickPreferences] click handled based on preference "always"',
104105
preferences
105106
);
106107
return true;
@@ -117,46 +118,46 @@ export class MouseClick {
117118
}
118119

119120
if (preferences.action === 'notsamedomainexact') {
120-
if (parsedSenderTabURL.hostname !== parsedClickedURL.hostname) {
121-
this.debug(
122-
'[checkClickPreferences] click handled based on preference "notsamedomainexact"',
123-
preferences,
124-
parsedClickedURL,
125-
parsedSenderTabURL
126-
);
127-
return true;
128-
} else {
129-
this.debug(
130-
'[checkClickPreferences] click not handled based on preference "notsamedomainexact"',
131-
preferences,
132-
parsedClickedURL,
133-
parsedSenderTabURL
134-
);
135-
return false;
136-
}
121+
// if (parsedSenderTabURL.hostname !== parsedClickedURL.hostname) {
122+
// this.debug(
123+
// '[checkClickPreferences] click handled based on preference "notsamedomainexact"',
124+
// preferences,
125+
// parsedClickedURL,
126+
// parsedSenderTabURL
127+
// );
128+
// return true;
129+
// } else {
130+
// this.debug(
131+
// '[checkClickPreferences] click not handled based on preference "notsamedomainexact"',
132+
// preferences,
133+
// parsedClickedURL,
134+
// parsedSenderTabURL
135+
// );
136+
// return false;
137+
// }
137138
}
138139

139140
if (preferences.action === 'notsamedomain') {
140-
if (
141-
this.utils.sameDomain(
142-
parsedSenderTabURL.hostname,
143-
parsedClickedURL.hostname
144-
)
145-
) {
146-
this.debug(
147-
'[checkClickPreferences] click not handled from preference "notsamedomain"',
148-
parsedClickedURL,
149-
parsedSenderTabURL
150-
);
151-
return false;
152-
} else {
153-
this.debug(
154-
'[checkClickPreferences] click handled from preference "notsamedomain"',
155-
parsedClickedURL,
156-
parsedSenderTabURL
157-
);
158-
return true;
159-
}
141+
// if (
142+
// this.utils.sameDomain(
143+
// parsedSenderTabURL.hostname,
144+
// parsedClickedURL.hostname
145+
// )
146+
// ) {
147+
// this.debug(
148+
// '[checkClickPreferences] click not handled from preference "notsamedomain"',
149+
// parsedClickedURL,
150+
// parsedSenderTabURL
151+
// );
152+
// return false;
153+
// } else {
154+
// this.debug(
155+
// '[checkClickPreferences] click handled from preference "notsamedomain"',
156+
// parsedClickedURL,
157+
// parsedSenderTabURL
158+
// );
159+
// return true;
160+
// }
160161
}
161162

162163
this.debug('[checkClickPreferences] this should never happen');

src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ export interface TmpTabOptions {
5252

5353
export type IsolationAction =
5454
| 'never'
55-
| 'notsamedomain'
56-
| 'notsamedomainexact'
55+
| 'notsamedomain' // legacy
56+
| 'notsamedomainexact' // legacy
5757
| 'always'
5858
| 'global';
5959

src/ui/components/isolation/settings.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ export default mixins(mixin).extend({
5353
<option value="never">
5454
{{ t('optionsIsolationSettingsNever') }}
5555
</option>
56-
<option value="notsamedomain">
57-
{{ t('optionsIsolationSettingsNotSameDomain') }}
58-
</option>
59-
<option value="notsamedomainexact">
60-
{{ t('optionsIsolationSettingsNotSameDomainExact') }}
61-
</option>
56+
<!-- <option value="notsamedomain">-->
57+
<!-- {{ t('optionsIsolationSettingsNotSameDomain') }}-->
58+
<!-- </option>-->
59+
<!-- <option value="notsamedomainexact">-->
60+
<!-- {{ t('optionsIsolationSettingsNotSameDomainExact') }}-->
61+
<!-- </option>-->
6262
<option value="always">
6363
{{ t('optionsIsolationSettingsAlways') }}
6464
</option>

0 commit comments

Comments
 (0)