Last active
October 23, 2020 21:01
-
-
Save 0az/fe5e6befe6551797c25af62bbabe4e44 to your computer and use it in GitHub Desktop.
Add download link to Zoom Cloud Recordings' generated WebVTT.
This file contains 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
// ==UserScript== | |
// @name Download Zoom VTT | |
// @author 0az | |
// @version 0.0.2 | |
// @namespace https://github.com/0az | |
// | |
// @description Add download link to Zoom Cloud Recordings' generated WebVTT. | |
// @match *://*.zoom.us/rec/play/* | |
// @run-at document-idle | |
// @inject-into page | |
// ==/UserScript== | |
((document, window) => { | |
'use strict' | |
const transcriptUrl = window.__data__.transcriptUrl | |
if (!transcriptUrl) { | |
return | |
} | |
const downloadEl = document.querySelector('.download') | |
const spanEl = document.createElement('span') | |
spanEl.textContent = ' / ' | |
const linkEl = document.createElement('a') | |
linkEl.textContent = 'Transcript [WebVTT]' | |
linkEl.href = transcriptUrl | |
linkEl.classList.add('download-btn') | |
const styleEl = document.createElement('style') | |
styleEl.textContent = ` | |
.download > a { | |
display: inline-block; | |
color: #232323; | |
} | |
.download.download > a:hover { | |
display: inline-block; | |
color: #3e8def; | |
} | |
` | |
document.body.appendChild(styleEl) | |
// Restyle header | |
const headerEls = document.querySelectorAll('.r-header-row > *') | |
headerEls[1].classList.remove('zm-col-16') | |
headerEls[1].classList.add('zm-col-14') | |
headerEls[2].classList.remove('zm-col-4') | |
headerEls[2].classList.add('zm-col-6') | |
downloadEl.appendChild(spanEl) | |
downloadEl.appendChild(linkEl) | |
})(document, unsafeWindow || window) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment