Created
March 5, 2024 23:53
-
-
Save ulasozguler/5275e64e57d9a8cc7bd7d7e57a0b57d0 to your computer and use it in GitHub Desktop.
Ferdium Slack screen share window workaround
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (config, Ferdium) => { | |
document.body.addEventListener("click", function (event) { | |
const qa = event.target.dataset.qa | |
const parentQA = event.target.parentElement?.dataset.qa | |
if (qa === "open-in-window" || parentQA === "open-in-window" || qa === "mini_player_open_in_new_window_button") { | |
toggleCustomStyles() | |
} | |
}) | |
function toggleCustomStyles() { | |
const styleId = "proper-screenshare-video-styles" | |
let styleElement = document.getElementById(styleId) | |
if (styleElement) { | |
styleElement.remove() | |
} else { | |
styleElement = document.createElement("style") | |
styleElement.id = styleId | |
styleElement.type = "text/css" | |
styleElement.innerHTML = ` | |
.p-huddle_sidebar_footer__container .p-file_drag_drop__container { | |
width: 89vw; | |
background: black; | |
} | |
.p-huddle_sidebar_footer__container .p-file_drag_drop__container video.p-presented_items_pane__screenshare, | |
.p-huddle_sidebar_footer__container .p-file_drag_drop__container .p-presented_items_pane__slider { | |
max-height: none; | |
} | |
.p-huddle_sidebar_footer__container .p-file_drag_drop__container .p-presented_items_pane__video { | |
width: auto !important; | |
height: 5vh !important; | |
} | |
.p-huddle_sidebar_footer__container .p-file_drag_drop__container .p-presented_items_pane__screenshare_overlay { | |
display: none; | |
} | |
.p-presented_items_pane__screenshare { | |
object-fit: contain; | |
} | |
` | |
document.head.appendChild(styleElement) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have improved the code so the image of the person sharing the screen doesn't take space: