-
-
Save M-rcus/8bba3d654767a6bfc8b8d83f1abb2ae9 to your computer and use it in GitHub Desktop.
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 Sproutvideos (*.vids.io) - Get video embed URL. | |
// @namespace github.com/M-rcus | |
// @match https://*.vids.io/videos/* | |
// @grant none | |
// @version 1.4.0 | |
// @author Marcus | |
// @description Gets the video embed URL for Sproutvideo. | |
// @updateUrl https://gist.github.com/M-rcus/8bba3d654767a6bfc8b8d83f1abb2ae9/raw/sproutvideo.user.js | |
// @downloadUrl https://gist.github.com/M-rcus/8bba3d654767a6bfc8b8d83f1abb2ae9/raw/sproutvideo.user.js | |
// ==/UserScript== | |
window.addEventListener('load', () => { | |
const player = document.querySelector('.sproutvideo-player'); | |
if (!player) | |
{ | |
return; | |
} | |
const url = player.src; | |
const container = document.querySelector('.video-title h1'); | |
const html = `<p>Embed URL: <a href="${url}" target="_blank">${url}</p>`; | |
container.insertAdjacentHTML('afterend', html); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment