Skip to content

Commit cf86842

Browse files
committed
refactor: remove notsamedomain code, needs work to migrate properly
1 parent 56693ba commit cf86842

6 files changed

Lines changed: 683 additions & 682 deletions

File tree

src/background/isolation.ts

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

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

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

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
@@ -51,8 +51,8 @@ export interface TmpTabOptions {
5151

5252
export type IsolationAction =
5353
| 'never'
54-
| 'notsamedomain'
55-
| 'notsamedomainexact'
54+
| 'notsamedomain' // legacy
55+
| 'notsamedomainexact' // legacy
5656
| 'always'
5757
| 'global';
5858

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)