From 037b95aded25762554dc3a224da6f7a9061d2004 Mon Sep 17 00:00:00 2001 From: Benedikt Ziemons Date: Sat, 30 Apr 2022 15:39:20 +0200 Subject: [PATCH] Remove left panel by DOM manipulation --- src/Ticket.vue | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Ticket.vue b/src/Ticket.vue index 572b7f2..47e39f4 100644 --- a/src/Ticket.vue +++ b/src/Ticket.vue @@ -134,7 +134,20 @@ export default { elementWebFrame.contentWindow.mxDispatcher.dispatch({ action: 'view_room', 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) }, },