NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript== // @name PCA false // @author hamzehma // @namespace https://example.com/ // @version 1.0 // @description Pop up a message when the second instance of a specific element appears on the page with a specific message // @match https://argus.aka.amazon.com/* // @match http:/// // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; const keyElementSelector = '#dtSubmitAndNextButton'; const specificText = 'false'; const getSecondElement = () => { const elements = document.querySelectorAll('.text-weight-300.md-subhead.details-list-item-text.md-truncate'); return elements.length >= 2 ? elements[1] : null; }; const waitForElement = (selector, callback) => { const element = document.querySelector(selector); if (element) { callback(element); } else { setTimeout(() => { waitForElement(selector, callback); }, 500); } }; const checkForElement = (observer) => { const secondElement = getSecondElement(); if (secondElement && secondElement.textContent.includes(specificText)) { alert('CAREFUL! PCA False'); observer.disconnect(); setTimeout(() => { observer.observe(document.body, { childList: true, subtree: true }); }, 10000); } }; waitForElement(keyElementSelector, () => { const observer = new MutationObserver(() => checkForElement(observer)); observer.observe(document.body, { childList: true, subtree: true }); }); })();