Remove left panel by DOM manipulation
This commit is contained in:
parent
10a54cf6ac
commit
037b95aded
|
@ -134,7 +134,20 @@ export default {
|
||||||
elementWebFrame.contentWindow.mxDispatcher.dispatch({
|
elementWebFrame.contentWindow.mxDispatcher.dispatch({
|
||||||
action: 'view_room',
|
action: 'view_room',
|
||||||
room_id: matrixInfoResponse.data.matrixChatRoom,
|
room_id: matrixInfoResponse.data.matrixChatRoom,
|
||||||
|
}, true)
|
||||||
|
|
||||||
|
// removes left panel by DOM manipulation
|
||||||
|
const matrixchat = elementWebFrame.contentDocument.getElementById('matrixchat')
|
||||||
|
console.debug(matrixchat)
|
||||||
|
const observerConfig = { attributes: false, childList: true, subtree: true }
|
||||||
|
const observer = new MutationObserver((mutationsList, observer) => {
|
||||||
|
console.debug('observer kicked', observer)
|
||||||
|
const leftPanelsByClass = elementWebFrame.contentDocument.getElementsByClassName('mx_LeftPanel_outerWrapper')
|
||||||
|
for (const leftPanel of leftPanelsByClass) {
|
||||||
|
leftPanel.remove()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
observer.observe(matrixchat, observerConfig)
|
||||||
}).catch(console.error)
|
}).catch(console.error)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue