Advertisement
AdamBlast

Baked: Auto-Click Embed

Jun 10th, 2023 (edited)
1,538
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.14 KB | Source Code | 0 0
  1. // ==UserScript==
  2. // @name        Baked: Auto-Click Embed
  3. // @description Clicks "Embed" button for untrusted content, whatever that means.
  4. // @version     1.0
  5. // @author      AdamBlast
  6. // @match       https://baked.live/*
  7. // @match       https://psp-tv.com/*
  8. // @exclude     https://baked.live/
  9. // @exclude     https://psp-tv.com/
  10. // @run-at      document-start
  11. // @grant       none
  12. // ==/UserScript==
  13.  
  14. window.addEventListener('load', function(){
  15.     clickEmbed;
  16.     setTimeout(clickEmbed, 1000);
  17.     setTimeout(clickEmbed, 2000);
  18.     setTimeout(clickEmbed, 3000);
  19.     setTimeout(clickEmbed, 4000);
  20.     setTimeout(clickEmbed, 5000);
  21.     setTimeout(clickEmbed, 6000);
  22.     // Hopefully the Embed button shows up within
  23.     // 6 seconds of the page fully loading.
  24. }, false);
  25.  
  26.  
  27. function clickEmbed(){
  28.     var btnTags = document.getElementsByTagName("button");
  29.     var searchText = "Embed";
  30.  
  31.     for (var i = 0; i < btnTags.length; i++) {
  32.         if (btnTags[i].innerText == searchText) {
  33.             //alert(btnTags[i].className) // className should be "btn btn-default"
  34.             btnTags[i].click()
  35.             break;
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement