Get iframe inheritance to work in the popup
This commit is contained in:
parent
01d569f1b5
commit
090f112463
@ -463,7 +463,7 @@ export default {
|
|||||||
if (!this.site) {
|
if (!this.site) {
|
||||||
this.origin = event.origin;
|
this.origin = event.origin;
|
||||||
this.site = event.origin.split('//')[1];
|
this.site = event.origin.split('//')[1];
|
||||||
this.siteSettings = this.settings.getSiteSettings(this.site);
|
this.siteSettings = this.settings.getSiteSettings({site: this.site});
|
||||||
}
|
}
|
||||||
return this.handleProbe(event.data, event.origin); // handleProbe is defined in UIProbeMixin
|
return this.handleProbe(event.data, event.origin); // handleProbe is defined in UIProbeMixin
|
||||||
case 'uw-bus-tunnel':
|
case 'uw-bus-tunnel':
|
||||||
|
|||||||
@ -201,7 +201,7 @@ export default {
|
|||||||
}
|
}
|
||||||
this.site = config.site;
|
this.site = config.site;
|
||||||
// this.selectedSite = this.selectedSite || config.site.host;
|
// this.selectedSite = this.selectedSite || config.site.host;
|
||||||
this.siteSettings = this.settings.getSiteSettings(this.site.host);
|
this.siteSettings = this.settings.getSiteSettings({site: this.site.host});
|
||||||
this.eventBus.setupPopupTunnelWorkaround({
|
this.eventBus.setupPopupTunnelWorkaround({
|
||||||
origin: CommsOrigin.Popup,
|
origin: CommsOrigin.Popup,
|
||||||
comms: {
|
comms: {
|
||||||
|
|||||||
@ -376,6 +376,9 @@ button,
|
|||||||
padding-left: 35px;
|
padding-left: 35px;
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
.info-color {
|
||||||
|
color: $info-color;
|
||||||
|
}
|
||||||
|
|
||||||
.info::before {
|
.info::before {
|
||||||
content: "ⓘ";
|
content: "ⓘ";
|
||||||
|
|||||||
@ -205,7 +205,7 @@ export default {
|
|||||||
if (this.defaultTab) {
|
if (this.defaultTab) {
|
||||||
this.selectedTab = this.defaultTab;
|
this.selectedTab = this.defaultTab;
|
||||||
}
|
}
|
||||||
this.siteSettings = this.settings.getSiteSettings(this.site);
|
this.siteSettings = this.settings.getSiteSettings({site: this.site});
|
||||||
this.tabs.find(x => x.id === 'changelog').highlight = !this.settings.active?.whatsNewChecked;
|
this.tabs.find(x => x.id === 'changelog').highlight = !this.settings.active?.whatsNewChecked;
|
||||||
|
|
||||||
this.eventBus.subscribe(
|
this.eventBus.subscribe(
|
||||||
|
|||||||
@ -41,6 +41,7 @@
|
|||||||
<template v-if="hosts && tab === 'embeddedSites' && globalSettings">
|
<template v-if="hosts && tab === 'embeddedSites' && globalSettings">
|
||||||
<FrameSiteSettings
|
<FrameSiteSettings
|
||||||
v-if="settings"
|
v-if="settings"
|
||||||
|
:parentHost="site"
|
||||||
:hosts="hosts"
|
:hosts="hosts"
|
||||||
:settings="settings"
|
:settings="settings"
|
||||||
></FrameSiteSettings>
|
></FrameSiteSettings>
|
||||||
@ -196,7 +197,7 @@ export default {
|
|||||||
},
|
},
|
||||||
siteSettings() {
|
siteSettings() {
|
||||||
if (this.site) {
|
if (this.site) {
|
||||||
return this.settings?.getSiteSettings(this.site) ?? null;
|
return this.settings?.getSiteSettings({site: this.site}) ?? null;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
<li>Subdomains now inherit same settings as their parent domain by default</li>
|
<li>Subdomains now inherit same settings as their parent domain by default</li>
|
||||||
<li>Extension attempts to detect embedded content.</li>
|
<li>Extension attempts to detect embedded content.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 1rem; height: 0px;"></div>
|
<div style="width: 1rem; height: 0px;"></div>
|
||||||
<div class="min-w-[400px] max-w-[520px] grow shrink">
|
<div class="min-w-[400px] max-w-[520px] grow shrink">
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-for="host of hosts" :key="host" @click="selectedSite = host" class="flex flex-col container pointer hoverable" style="margin-top: 4px; padding: 0.5rem 1rem;">
|
<div v-for="host of hosts" :key="host" @click="selectedSite = host" class="flex flex-col container pointer hoverable" style="margin-top: 4px; padding: 0.5rem 1rem;">
|
||||||
<SiteListItem
|
<SiteListItem
|
||||||
|
:parentHost="parentHost"
|
||||||
:host="host"
|
:host="host"
|
||||||
:settings="settings"
|
:settings="settings"
|
||||||
></SiteListItem>
|
></SiteListItem>
|
||||||
@ -48,6 +49,7 @@ export default {
|
|||||||
},
|
},
|
||||||
props: [
|
props: [
|
||||||
'settings',
|
'settings',
|
||||||
|
'parentHost',
|
||||||
'hosts',
|
'hosts',
|
||||||
],
|
],
|
||||||
data() {
|
data() {
|
||||||
@ -81,7 +83,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectedSiteSettings() {
|
selectedSiteSettings() {
|
||||||
return this.settings?.getSiteSettings(this.selectedSite) ?? null;
|
return this.settings?.getSiteSettings({site: this.selectedSite}) ?? null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@ -121,7 +121,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectedSiteSettings() {
|
selectedSiteSettings() {
|
||||||
return this.settings?.getSiteSettings(this.selectedSite) ?? null;
|
return this.settings?.getSiteSettings({site: this.selectedSite}) ?? null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@ -140,13 +140,13 @@ export default {
|
|||||||
return status === 'disabled' ? 'color: #f00' : 'color: #1f8';
|
return status === 'disabled' ? 'color: #f00' : 'color: #1f8';
|
||||||
},
|
},
|
||||||
getSiteEnabledModes(site, component) {
|
getSiteEnabledModes(site, component) {
|
||||||
if (this.settings?.getSiteSettings(site).data[component]?.normal === ExtensionMode.Enabled) {
|
if (this.settings?.getSiteSettings({site: site}).data[component]?.normal === ExtensionMode.Enabled) {
|
||||||
return 'always';
|
return 'always';
|
||||||
}
|
}
|
||||||
if (this.settings?.getSiteSettings(site).data[component]?.theater === ExtensionMode.Enabled) {
|
if (this.settings?.getSiteSettings({site: site}).data[component]?.theater === ExtensionMode.Enabled) {
|
||||||
return 'T + FS';
|
return 'T + FS';
|
||||||
}
|
}
|
||||||
if (this.settings?.getSiteSettings(site).data[component]?.fullscreen === ExtensionMode.Enabled) {
|
if (this.settings?.getSiteSettings({site: site}).data[component]?.fullscreen === ExtensionMode.Enabled) {
|
||||||
return 'fullscreen';
|
return 'fullscreen';
|
||||||
}
|
}
|
||||||
return 'disabled';
|
return 'disabled';
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="this.siteSettings?.usesSettingsFor">
|
<div v-if="this.siteSettings?.usesSettingsFor">
|
||||||
<div v-if="this.siteSettings.usesSettingsFor === '@global'">Uses default settings</div>
|
<div v-if="this.siteSettings.usesSettingsFor === '@global'">Uses default settings</div>
|
||||||
<div v-else>Uses settings for: {{this.siteSettings.usesSettingsFor}}</div>
|
<div v-else>Uses settings for: <span class="info-color">{{this.siteSettings.usesSettingsFor}}</span></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row">
|
<div class="flex flex-row">
|
||||||
<small>
|
<small>
|
||||||
@ -35,10 +35,11 @@ export default {
|
|||||||
},
|
},
|
||||||
props: [
|
props: [
|
||||||
'settings',
|
'settings',
|
||||||
|
'parentHost',
|
||||||
'host',
|
'host',
|
||||||
],
|
],
|
||||||
created() {
|
created() {
|
||||||
this.siteSettings = this.settings.getSiteSettings(this.host);
|
this.siteSettings = this.settings.getSiteSettings({site: this.host, isIframe: this.parentHost && this.host !== this.parentHost, parentHostname: this.parentHost});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getSiteTypeColor(siteType) {
|
getSiteTypeColor(siteType) {
|
||||||
|
|||||||
@ -175,7 +175,7 @@ export default {
|
|||||||
this.enabledHosts = [];
|
this.enabledHosts = [];
|
||||||
|
|
||||||
for (const host of val) {
|
for (const host of val) {
|
||||||
const siteSettings = new SiteSettings(this.settings, host);
|
const siteSettings = new SiteSettings(this.settings, {site: host});
|
||||||
|
|
||||||
if (siteSettings.isEnabledForEnvironment(false, true) === ExtensionMode.Enabled) {
|
if (siteSettings.isEnabledForEnvironment(false, true) === ExtensionMode.Enabled) {
|
||||||
this.enabledHosts.push(host);
|
this.enabledHosts.push(host);
|
||||||
|
|||||||
@ -2049,7 +2049,7 @@ export class Aard {
|
|||||||
* Calculates video's current aspect ratio based on data in testResults.
|
* Calculates video's current aspect ratio based on data in testResults.
|
||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
private getAr() {
|
private getAr(): number {
|
||||||
const fileAr = this.video.videoWidth / this.video.videoHeight;
|
const fileAr = this.video.videoWidth / this.video.videoHeight;
|
||||||
const canvasAr = this.canvasStore.main.width / this.canvasStore.main.height;
|
const canvasAr = this.canvasStore.main.width / this.canvasStore.main.height;
|
||||||
|
|
||||||
|
|||||||
@ -128,7 +128,6 @@ export class SiteSettings {
|
|||||||
// `www.example.com`, this will also match `example.com`, `subdomain.example.com`, `nested.subdomain.example.com` ...
|
// `www.example.com`, this will also match `example.com`, `subdomain.example.com`, `nested.subdomain.example.com` ...
|
||||||
if (configUrlSegments[configUrlSegments.length - 1] === '*' || (configUrlSegments[configUrlSegments.length - 1] === 'www')) {
|
if (configUrlSegments[configUrlSegments.length - 1] === '*' || (configUrlSegments[configUrlSegments.length - 1] === 'www')) {
|
||||||
|
|
||||||
console.log('ss: comparing', configUrlSegments, urlSegments);
|
|
||||||
for (let i = 0; i < configUrlSegments.length - 1 && i < urlSegments.length; i++) {
|
for (let i = 0; i < configUrlSegments.length - 1 && i < urlSegments.length; i++) {
|
||||||
if (configUrlSegments[i] !== urlSegments[i]) {
|
if (configUrlSegments[i] !== urlSegments[i]) {
|
||||||
continue siteLoop;
|
continue siteLoop;
|
||||||
@ -144,7 +143,11 @@ export class SiteSettings {
|
|||||||
// If we're inside of an iframe, let's see whether we can use parent settings
|
// If we're inside of an iframe, let's see whether we can use parent settings
|
||||||
if (options.isIframe) {
|
if (options.isIframe) {
|
||||||
const potentialSettings = this.getSettingsForSite({site: options.parentHostname});
|
const potentialSettings = this.getSettingsForSite({site: options.parentHostname});
|
||||||
|
|
||||||
if (potentialSettings.siteSettings.applyToEmbeddedContent !== false) {
|
if (potentialSettings.siteSettings.applyToEmbeddedContent !== false) {
|
||||||
|
if (!potentialSettings.usesSettingsFor) {
|
||||||
|
potentialSettings.usesSettingsFor = options.parentHostname;
|
||||||
|
}
|
||||||
return potentialSettings;
|
return potentialSettings;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user