support passing debug data between content script and UI
This commit is contained in:
parent
3f8ea683ef
commit
7a5a4bddf8
@ -14,12 +14,18 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
uiVisible: true
|
||||
uiVisible: true,
|
||||
debugData: {
|
||||
resizer: {},
|
||||
player: {},
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState([
|
||||
'showUi'
|
||||
'showUi',
|
||||
'resizerDebugData',
|
||||
'playerDebugData'
|
||||
]),
|
||||
},
|
||||
watch: {
|
||||
@ -27,6 +33,12 @@ export default {
|
||||
if (visible !== undefined) {
|
||||
this.uiVisible = visible;
|
||||
}
|
||||
},
|
||||
resizerDebugData(newData) {
|
||||
this.debugData.resizer = newData;
|
||||
},
|
||||
playerDebugData(newData) {
|
||||
this.debugData.player = newData;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
@ -40,7 +40,9 @@ class PlayerUi extends UI {
|
||||
plugins: [
|
||||
VuexWebExtensions({
|
||||
persistentStates: [
|
||||
'showUi'
|
||||
'showUi',
|
||||
'resizerDebugData',
|
||||
'playerDebugData',
|
||||
],
|
||||
}),
|
||||
],
|
||||
@ -53,7 +55,13 @@ class PlayerUi extends UI {
|
||||
},
|
||||
'uw-set-ui-visible'(state, payload) {
|
||||
state['showUi'] = payload;
|
||||
}
|
||||
},
|
||||
'uw-set-player-debug-data'(state, payload) {
|
||||
state['playerDebugData'] = payload;
|
||||
},
|
||||
'uw-set-resizer-debug-data'(state, payload) {
|
||||
state['resizerDebugData'] = payload;
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
'uw-set-ui-visible'({commit}, payload) {
|
||||
@ -62,7 +70,13 @@ class PlayerUi extends UI {
|
||||
},
|
||||
'uw-toggle-ui'({commit}) {
|
||||
commit('uw-toggle-ui');
|
||||
}
|
||||
},
|
||||
'uw-set-player-debug-data'({commit}, payload) {
|
||||
commit('uw-set-player-debug-data ', payload);
|
||||
},
|
||||
'uw-set-resizer-debug-data'({commit}, payload) {
|
||||
commit('uw-set-resizer-debug-data ', payload);
|
||||
},
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -90,6 +104,12 @@ class PlayerUi extends UI {
|
||||
super.replace(this.getUiConfig(playerElement));
|
||||
}
|
||||
//#endregion
|
||||
|
||||
//#region debug methods
|
||||
updateDebugInfo(component, data) {
|
||||
this.vuexStore?.dispatch(`uw-set-${component}-debug-data`, data);
|
||||
}
|
||||
//#endregion
|
||||
}
|
||||
|
||||
if (process.env.CHANNEL !== 'stable'){
|
||||
|
Loading…
Reference in New Issue
Block a user