Extension enabled mode is now being set correctly

This commit is contained in:
Tamius Han 2025-12-22 14:48:50 +01:00
parent 61972a7b2d
commit c2a6a3f082
5 changed files with 20 additions and 37 deletions

View File

@ -96,7 +96,6 @@ class Settings {
if (!changes.uwSettings) { if (!changes.uwSettings) {
return; return;
} }
console.log('new settings change.')
this.logger?.info('storageOnChange', "Settings have been changed outside of here. Updating active settings. Changes:", changes, "storage area:", area); this.logger?.info('storageOnChange', "Settings have been changed outside of here. Updating active settings. Changes:", changes, "storage area:", area);
// if (changes['uwSettings'] && changes['uwSettings'].newValue) { // if (changes['uwSettings'] && changes['uwSettings'].newValue) {
// this.logger?.log('info', 'settings',"[Settings::<storage/on change>] new settings object:", JSON.parse(changes.uwSettings.newValue)); // this.logger?.log('info', 'settings',"[Settings::<storage/on change>] new settings object:", JSON.parse(changes.uwSettings.newValue));

View File

@ -183,7 +183,6 @@ export class SiteSettings {
*/ */
private compileSettingsObject() { private compileSettingsObject() {
const {siteSettings, usesSettingsFor} = this.getSettingsForSite(this.options); const {siteSettings, usesSettingsFor} = this.getSettingsForSite(this.options);
console.log('got settings for site:', siteSettings, usesSettingsFor)
this.data = _cp(siteSettings); this.data = _cp(siteSettings);
this.usesSettingsFor = usesSettingsFor; this.usesSettingsFor = usesSettingsFor;

View File

@ -532,7 +532,11 @@ class VideoData {
let confirmAspectRatioRestore = false; let confirmAspectRatioRestore = false;
if (!this.video) { if (!this.video) {
this.logger.error('onVideoMutation', 'mutation was triggered, but video element is missing. Something is fishy. Terminating this uw instance.'); if (this.logger) {
this.logger.error('onVideoMutation', 'mutation was triggered, but video element is missing. Something is fishy. Terminating this uw instance.');
} else {
console.error('uw::onVideoMutation', 'mutation was triggered, but neither video nor logger exist. Something is ultra-fishy. UW instance will be terminated. This:', this);
}
this.destroy(); this.destroy();
return; return;
} }

View File

@ -105,8 +105,8 @@
<h3>Default settings</h3> <h3>Default settings</h3>
<SiteExtensionSettings <SiteExtensionSettings
:settings="settings" :settings="settings"
:siteSettings="siteSettings" :siteSettings="globalSettings"
:isDefaultConfiguration="false" :isDefaultConfiguration="true"
></SiteExtensionSettings> ></SiteExtensionSettings>
</template> </template>
@ -220,7 +220,13 @@ const AVAILABLE_TABS = {
{ id: 'default-extension-settings', label: 'Default settings' } { id: 'default-extension-settings', label: 'Default settings' }
] ]
}, },
'extensionSettings': {id: 'extensionSettings', label: 'Site and Extension options', icon: 'cogs' }, 'extension-settings': {
id: 'extensionSettings', label: 'Site and Extension options', icon: 'cogs',
children: [
{ id: 'default-extension-settings', label: 'Default settings' },
{ id: 'website-extension-list', label: 'Website settings', },
]
},
'siteSettings': {id: 'extensionSettings', label: 'Site and Extension options', icon: 'cogs' }, 'siteSettings': {id: 'extensionSettings', label: 'Site and Extension options', icon: 'cogs' },
'settings.player-element-settings': { id: 'settings.player-element-settings', label: 'Advanced video player options', icon: 'play-box-edit-outline' }, 'settings.player-element-settings': { id: 'settings.player-element-settings', label: 'Advanced video player options', icon: 'play-box-edit-outline' },
'window.player-element-settings': { id: 'window.player-element-settings', label: 'Advanced video player options', icon: 'play-box-edit-outline' }, 'window.player-element-settings': { id: 'window.player-element-settings', label: 'Advanced video player options', icon: 'play-box-edit-outline' },
@ -229,7 +235,7 @@ const AVAILABLE_TABS = {
'keyboardShortcuts': {id: 'keyboardShortcuts', label: 'Keyboard shortcuts', icon: 'keyboard-outline' }, 'keyboardShortcuts': {id: 'keyboardShortcuts', label: 'Keyboard shortcuts', icon: 'keyboard-outline' },
'playerDetection': {id: 'playerDetection', label: 'Player detection', icon: 'television-play'}, 'playerDetection': {id: 'playerDetection', label: 'Player detection', icon: 'television-play'},
'installed': { id: 'updated', label: 'Update completed', icon: 'monitor-arrow-down-variant'}, 'installed': { id: 'installed', label: 'Update completed', icon: 'monitor-arrow-down-variant'},
'updated': { id: 'updated', label: 'Update completed', icon: 'update'}, 'updated': { id: 'updated', label: 'Update completed', icon: 'update'},
'changelog': {id: 'changelog', label: 'What\'s new', icon: 'alert-decagram' }, 'changelog': {id: 'changelog', label: 'What\'s new', icon: 'alert-decagram' },
@ -240,7 +246,7 @@ const AVAILABLE_TABS = {
const TAB_LOADOUT = { const TAB_LOADOUT = {
'settings': [ 'settings': [
'extensionSettings', 'extension-settings',
'settings.player-element-settings', 'settings.player-element-settings',
'autodetectionSettings', 'autodetectionSettings',
'ui-settings', 'ui-settings',
@ -299,6 +305,7 @@ export default defineComponent({
BrowserDetect: BrowserDetect, BrowserDetect: BrowserDetect,
preventClose: false, preventClose: false,
siteSettings: null, siteSettings: null,
globalSettings: null,
} }
}, },
props: [ props: [
@ -336,6 +343,7 @@ export default defineComponent({
changelogTab.highlight = !this.settings.active?.whatsNewChecked; changelogTab.highlight = !this.settings.active?.whatsNewChecked;
} }
this.globalSettings = this.settings.getSiteSettings({site: '@global'});
if (this.site) { if (this.site) {
this.siteSettings = this.settings.getSiteSettings({site: this.site}); this.siteSettings = this.settings.getSiteSettings({site: this.site});
} }
@ -377,6 +385,7 @@ export default defineComponent({
console.warn('[uw:SettingsWindowContent] tab', tab, 'is not present in available tabs:', AVAILABLE_TABS, '— tabs for role', this.role, TAB_LOADOUT[this.role]); console.warn('[uw:SettingsWindowContent] tab', tab, 'is not present in available tabs:', AVAILABLE_TABS, '— tabs for role', this.role, TAB_LOADOUT[this.role]);
continue; continue;
} else { } else {
console.log('pushing tab:', tab, AVAILABLE_TABS[tab])
tabs.push(AVAILABLE_TABS[tab]); tabs.push(AVAILABLE_TABS[tab]);
} }
} }

View File

@ -310,13 +310,6 @@
</div> </div>
</div> </div>
<pre>
SITE SETTINGS: raw
{{JSON.stringify(siteSettings.raw)}}
SITE SETTINGS: data
{{JSON.stringify(siteSettings.data)}}
</pre>
</div> </div>
</template> </template>
@ -546,28 +539,7 @@ export default defineComponent({
setExtensionMode(component, event) { setExtensionMode(component, event) {
const option = event.target.value; const option = event.target.value;
this.siteSettings.set(component, option);
console.log('set extension mode - we received option', option, 'for component', component);
return;
if (option === 'complex') {
return;
}
if (component === 'enable' && !this.isDefaultConfiguration) {
this.setExtensionMode('enableAard', event);
this.setExtensionMode('enableKeyboard', event);
// in enableUI, 'enabled' is unused and 'theater' uses its place
if (option === 'enabled') {
this.setExtensionMode('enableUI', {target: {value: 'theater'}});
} else {
this.setExtensionMode('enableUI', event);
}
}
} }
} }