// ==UserScript== // @name snaptik tiktok button // @namespace Violentmonkey Scripts // @match https://www.tiktok.com/* // @grant none // @version 1.0 // @author minnie // @description 7/19/2024, 11:25:52 AM // @downloadURL none // ==/UserScript== window.onload = function() { const followBtn = document.querySelector("[data-e2e='browse-follow']"); if (followBtn) { var snaptikBtn = document.createElement('button'); snaptikBtn.innerHTML = 'Snaptik'; snaptikBtn.style.cssText = ` box-sizing: border-box; appearance: none; min-width: 96px; display: inline-flex; -webkit-box-pack: center; justify-content: center; -webkit-box-align: center; align-items: center; position: relative; border-style: solid; border-width: 1px; border-radius: 2px; font-family: var(--tux-fontFamilyParagraph); font-weight: var(--tux-fontWeightSemibold); text-decoration: none; cursor: pointer; background-clip: padding-box; font-size: 15px; height: 36px; padding-inline: 15px; color: var(--tux-colorConstTextInverse); background-color: var(--tux-colorPrimary); border-color: var(--tux-colorPrimary); margin-left: 10px; `; // Add the SVG next to the 'Snaptik' text const svg = ` `; // snaptikBtn.innerHTML += svg; // Append the new element after the 'followBtn' element followBtn.insertAdjacentElement('afterend', snaptikBtn); } snaptikBtn.addEventListener('click', () => { let currentLink = window.location.href; navigator.clipboard.writeText(currentLink).then(() => { console.log('Link copied to clipboard'); window.open('https://snaptik.app/en1', '_blank'); }).catch(err => { console.error('Could not copy text: ', err); }); }); }