TikTok Video Source Opener

Open TikTok video source in a new tab with Alt + Left Click on the video, works with infinite scrolling.

  1. // ==UserScript==
  2. // @name TikTok Video Source Opener
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.3
  5. // @description Open TikTok video source in a new tab with Alt + Left Click on the video, works with infinite scrolling.
  6. // @author LukysGaming
  7. // @match https://www.tiktok.com/*
  8. // @grant none
  9. // @run-at document-idle
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. // Function to handle the Alt + Left Click event
  16. const handleAltClick = (event) => {
  17. if (event.altKey && event.button === 0) {
  18. const videoElement = event.target.closest('video'); // Find the video element clicked on
  19.  
  20. if (videoElement) {
  21. const sourceURL = videoElement.querySelector('source')?.src || videoElement.src;
  22.  
  23. if (sourceURL) {
  24. // Open the video source URL in a new tab
  25. window.open(sourceURL, '_blank');
  26. } else {
  27. alert('Unable to find video source.');
  28. }
  29. }
  30. }
  31. };
  32.  
  33. // Add event listener to the entire document
  34. document.addEventListener('click', handleAltClick);
  35.  
  36. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址