Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Doubtnut Video Unlocker
- // @namespace http://CM-Of-Dholakpur.com/
- // @version 1.0
- // @description Adds an "Unlock Video" button and opens the link in a new tab when it's clicked
- // @match https://www.doubtnut.com/*
- // @grant none
- // ==/UserScript==
- (function() {
- // Create a new button element
- var unlockButton = document.createElement('button');
- // Set the button text and style
- unlockButton.textContent = 'Unlock Video';
- unlockButton.style.fontSize = '24px'; // Adjust the font size as needed
- unlockButton.style.position = 'fixed';
- unlockButton.style.top = '110px';
- unlockButton.style.left = '7%';
- unlockButton.style.transform = 'translateX(-50%)';
- unlockButton.style.zIndex = '9999';
- unlockButton.style.backgroundColor = 'black'; // Black background color
- unlockButton.style.color = 'white'; // White text color
- unlockButton.style.border = '2px solid red'; // Red border
- // Append the button to the document body
- document.body.appendChild(unlockButton);
- // Add a click event listener to the button
- unlockButton.addEventListener('click', function() {
- // Find the video element
- var videoElement = document.getElementById('content_video_html5_api');
- if (videoElement) {
- // Get the video source URL
- var videoUrl = videoElement.getAttribute('src');
- // Open the URL in a new tab
- window.open(videoUrl, '_blank');
- }
- });
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement