-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
4 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// ==UserScript== | ||
// @name AutoClick Disclaimer Button | ||
// @namespace http://tampermonkey.net/ | ||
// @version 1.0 | ||
// @description Auto click a disclaimer button | ||
// @author lainiwa | ||
// @match https://www.xvideos.com/* | ||
// @icon https://www.google.com/s2/favicons?sz=64&domain=xvideos.com | ||
// @grant none | ||
// ==/UserScript== | ||
|
||
(function() { | ||
'use strict'; | ||
|
||
// Function to click the button | ||
var clickButton = function() { | ||
var button = document.querySelector('.disclaimer-enter-straightsShortSiteName'); | ||
if(button){ | ||
button.click(); | ||
// Disconnect the observer after clicking the button | ||
observer.disconnect(); | ||
} | ||
}; | ||
|
||
// Create an observer instance | ||
var observer = new MutationObserver(clickButton); | ||
|
||
// Configuration of the observer | ||
var config = { childList: true, subtree: true }; | ||
|
||
// Pass in the target node, as well as the observer options | ||
observer.observe(document.body, config); | ||
|
||
})(); |