Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Video Mascot
- // @version 1
- // @match https://*.ziemniachan.org/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- // Hardcode your video URL here
- const VIDEO_URL = 'https://ziemniachan.org/b/src/1784242411593.webm';
- // Create the video element
- const video = document.createElement('video');
- video.src = VIDEO_URL;
- // Set required attributes
- video.autoplay = true;
- video.muted = true; // Required by modern browsers for autoplay to work
- video.loop = true;
- video.controls = false; // Ensures controls are hidden
- // Apply styles for fixed bottom-right positioning
- Object.assign(video.style, {
- position: 'fixed',
- bottom: '0px',
- right: '0px',
- width: 'auto',
- height: '70%',
- zIndex: '2147483647',
- opacity: '0.9',
- pointerEvents: 'none' // Prevents the video from blocking clicks on the page beneath it
- });
- // Function to inject the video safely
- const injectVideo = () => {
- if (!document.body.contains(video)) {
- document.body.appendChild(video);
- }
- };
- // Append to body immediately if available, otherwise wait for DOMContentLoaded
- if (document.body) {
- injectVideo();
- } else {
- window.addEventListener('DOMContentLoaded', injectVideo);
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment