NOTICE: By continued use of this site you understand and agree to the binding Terms of Service and Privacy Policy.
// ==UserScript==
// @name SeekSurge2.1
// @license MIT
// @namespace kalpdev
// @version 1.1
// @description Popup predefined keywords found on a webpage for Amazon pages only
// @match *://*/*
// @grant GM_xmlhttpRequest
// ==/UserScript==
(function() {
'use strict';
// Add your predefined keywords and their corresponding popups to this object
var keywords = {
'lithium': null,
'rechargeable': null,
'marker': null,
'built-in': null,
'fire starter': null,
'flint': null,
'water-based': null,
'water based': null,
'battery': null,
'inbuilt': null,
'li-ion': null,
'lithium-ion': null,
'3.7v': null,
'3.7V': null,
'integreted': null,
'paint marker': null,
'dry erase marker': null,
'whiteboard marker': null,
'18650': null,
'alkaline': null,
'cr2': null,
'cr-2': null,
'lithium metal': null,
'CR2032': null,
'cr20232': null,
'cr123a': null,
'CR123A': null,
'included battery': null,
'individually packed': null,
'li-battery': null,
'lifepo4': null,
'lipo battery': null,
'lithium batteries': null,
'lithium-polymer': null,
'PIEZO': null,
'Ethanol gel': null,
'ZINC AIR': null,
'PEROXIDE': null,
'non-rechargeable': null,
'spillable': null,
'NON-SPILLABLE': null,
'power bank': null,
'AGM': null,
'watt hours': null,
'watt hour': null,
'watt-hours': null,
'watt-hour': null,
'LR44': null,
'Li-polymer': null,
'lithium polymer battery': null,
'COMPRESSED HORN': null,
"what's in the box": null,
'explosives': null,
'explosive': null,
'Crackers': null,
'refrigerant': null,
'Compressor': null,
'Ethanol': null,
'isopropyl': null,
'repair kit': null,
'Isobutene': null,
'tetrafluroethane': null,
'Isobutylene': null,
'isobutane': null,
'chalk marker': null,
'extinguisher': null,
'ferrocerium': null,
'magnesium': null,
'flint': null,
'Fire Extinguishers': null,
'Fire starter': null,
'Ittar': null,
'Attar': null,
'Alcohol': null,
'SD alcohol': null,
'butan': null,
'butane': null,
'propane': null,
'aerosol': null,
'aeresols': null,
'content under pressure': null,
'Long lasting LED light': null,
'Light up with every step': null,
'the battery only one time use': null,
'Battery cannot be replaced': null,
'Battery cannot be charged': null,
'ImpulseĀ® Sensors': null,
'Q-Chip technology': null,
'Fidelity sensor': null,
'8 Under Armour(UA) HOVER Sonic': null,
'Under Armour(UA) HOVER Phantom': null,
'HOVER Phantom': null,
'Under Armour Speed Form': null,
'Crocs FunLab Clogs': null,
'Heelys Plus X2': null,
'Crocs Mules': null,
'Crocs Hatchlings': null,
'LED shoe laces': null,
'Dinosoles 3D': null,
'Twinkle toe': null,
'EDT': null,
'EDP': null,
'EDC': null,
'Eau De': null,
'Ethyl Methacrylate': null,
'EMA': null,
'Methyl Methacrylate': null,
'MMA': null,
'80-62-6': null,
'97-63-2': null,
'citronella': null,
};
if (
window.location.hostname.includes('amazon') &&
(window.location.href.includes('/dp/') ||
window.location.href.includes('https://argus.aka.amazon.com/'))
) {
var searchButton = document.createElement('button');
searchButton.innerText = 'Search Keyword';
searchButton.style.backgroundColor = 'black';
searchButton.style.color = 'white';
searchButton.style.position = 'fixed';
searchButton.style.padding = '20px';
searchButton.style.bottom = '20px';
searchButton.style.right = '20px';
searchButton.style.zIndex = '9999';
searchButton.style.boxShadow = '2px 2px 5px #888888';
searchButton.style.borderRadius = '5px';
// Dragging functionality
var isDragging = false;
var currentX;
var currentY;
var initialX;
var initialY;
var xOffset = 0;
var yOffset = 0;
searchButton.addEventListener('mousedown', dragStart);
searchButton.addEventListener('mouseup', dragEnd);
searchButton.addEventListener('mousemove', drag);
function dragStart(e) {
initialX = e.clientX - xOffset;
initialY = e.clientY - yOffset;
if (e.target === searchButton) {
isDragging = true;
}
}
function dragEnd(e) {
initialX = currentX;
initialY = currentY;
isDragging = false;
}
function drag(e) {
if (isDragging) {
e.preventDefault();
currentX = e.clientX - initialX;
currentY = e.clientY - initialY;
xOffset = currentX;
yOffset = currentY;
setTranslate(currentX, currentY, searchButton);
}
}
function setTranslate(xPos, yPos, el) {
el.style.transform = 'translate3d(' + xPos + 'px, ' + yPos + 'px, 0)';
}
searchButton.onclick = function() {
var usernameElement = document.querySelector('.spoof-user-badge-pic');
var username = usernameElement ? usernameElement.alt : null;
var asinElement = document.querySelector('span.ng-binding');
var asin = asinElement ? asinElement.innerText.trim() : '';
searchKeywords(username, asin);
};
function searchKeywords(username, asin) {
var popup = document.createElement('div');
popup.style.position = 'fixed';
popup.style.top = '50%';
popup.style.left = '50%';
popup.style.transform = 'translate(-50%, -50%)';
popup.style.padding = '40px';
popup.style.background = 'grey';
popup.style.fontWeight = 'bold';
popup.style.color = 'black';
popup.style.border = '1px solid white';
popup.style.borderRadius = '5px';
popup.style.fontSize = '18px';
popup.style.boxShadow = '2px 2px 5px #888888';
popup.style.zIndex = '99999';
var closeButton = document.createElement('button');
closeButton.innerText = 'X';
closeButton.style.position = 'absolute';
closeButton.style.color = 'red';
closeButton.style.top = '0';
closeButton.style.right = '0';
closeButton.onclick = function() {
document.body.removeChild(popup);
};
popup.appendChild(closeButton);
var heading = document.createElement('h3');
heading.innerText = 'Available Keywords in DP ';
heading.style.fontSize = '16px';
heading.style.marginTop = '2px';
popup.appendChild(heading);
var ul = document.createElement('ul');
var targetElements = document.querySelectorAll(
'#feature-bullets > ul, #aplus > div,body > div.swal2-container.swal2-top-end.swal2-backdrop-show > div,#productDescription'
);
if (targetElements.length > 0) {
targetElements.forEach(function(targetElement) {
Object.entries(keywords).forEach(function([keyword, popupText]) {
if (
targetElement.innerText.toLowerCase().includes(keyword.toLowerCase())
) {
var li = document.createElement('li');
li.innerText = popupText ? popupText : keyword;
ul.appendChild(li);
}
});
});
} else {
alert('Target elements not found.');
return;
}
if (ul.childElementCount === 0) {
var li = document.createElement('li');
li.innerText = 'No keywords found.';
ul.appendChild(li);
}
popup.appendChild(ul);
document.body.appendChild(popup);
sendDataToServer(username, asin);
}
function sendDataToServer(username, asin) {
var currentTime = new Date();
var offset = currentTime.getTimezoneOffset();
currentTime = new Date(currentTime.getTime() + offset * 60 * 1000 + 5.5 * 60 * 60 * 1000);
// Format the IST timestamp
var timestamp = currentTime.toLocaleString('en-IN', { timeZone: 'Asia/Kolkata' });
// Create an HTTP request
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://localhost:8080/store_data.php', true);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
var data = 'username=' + encodeURIComponent(username) + '&asin=' + encodeURIComponent(asin) + '×tamp=' + encodeURIComponent(timestamp);
xhr.send(data);
}
document.body.appendChild(searchButton);
setTimeout(function() {
var usernameElement = document.querySelector('.spoof-user-badge-pic');
var username = usernameElement ? usernameElement.alt : null;
var asinElement = document.querySelector('span.ng-binding');
var asin = asinElement ? asinElement.innerText.trim() : '';
searchKeywords(username, asin);
}, 5000);
}
})();