Last active
April 21, 2021 19:54
-
-
Save ahmic/7af9da9dd56b3bbed864193ec4d58905 to your computer and use it in GitHub Desktop.
Revisions
-
ahmic revised this gist
Apr 21, 2021 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -27,7 +27,9 @@ if (typeof document.querySelectorAll('[data-test-id="image-link"]')[0] !== 'unde var imglink = document.querySelectorAll('[data-test-id="image-link"]')[0].getElementsByTagName('img')[1].getAttribute('src'); menu = '<a href="https://novamaskica.netlify.app/#' + imglink + '" target="_blank" style="padding: 5px; font-size: 33px; display: block;">iPhone</a>'; menu = menu + '<a href="https://novamaskica.netlify.app/p20.html#' + imglink + '" target="_blank" style="padding: 5px; font-size: 33px; display: block;">P20 pro</a>'; menu = menu + '<a href="https://novamaskica.netlify.app/clear.html#' + imglink + '" target="_blank" style="padding: 5px; font-size: 33px; display: block;">Clear</a>'; } else { -
ahmic created this gist
Aug 7, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,95 @@ // ==UserScript== // @name Maskica Dizajn // @namespace http://www.webmonkey.com // @description A Greasemonkey script that finds h2 tags and creates a floating menu of them. // @include https://www.pinterest.com/ // @include https://www.pinterest.com // @include https://www.pinterest.com* // ==/UserScript== var menu = ''; setInterval(function(){ removeElementsByClass('imglinkkkkkk'); if (typeof document.querySelectorAll('[data-test-id="image-link"]')[0] !== 'undefined') { var imglink = document.querySelectorAll('[data-test-id="image-link"]')[0].getElementsByTagName('img')[1].getAttribute('src'); menu = '<a href="https://novamaskica.netlify.app/#' + imglink + '" target="_blank" style="padding: 5px; font-size: 33px;">Link</a>'; } else { menuobj = document.createElement('div'); menuobj.style.position = 'fixed'; menuobj.style.top = '170px'; menuobj.style.left = '50px'; menuobj.style.padding = '10px 20px'; menuobj.style.backgroundColor = '#3ebd1b'; menuobj.innerHTML = 'x'; menuobj.classList.add('imglinkkkkkk'); body = document.getElementsByTagName('body')[0]; //body.appendChild(menuobj); } // Create menu if (menu != '') { menuobj = document.createElement('div'); menuobj.classList.add('imglinkkkkkk'); menuobj.style.position = 'fixed'; menuobj.style.top = '170px'; menuobj.style.left = '50px'; menuobj.style.padding = '10px 20px'; menuobj.style.backgroundColor = '#3ebd1b'; menuobj.innerHTML = menu; body = document.getElementsByTagName('body')[0]; body.appendChild(menuobj); } }, 1000); function removeElementsByClass(className){ var elements = document.getElementsByClassName(className); while(elements.length > 0){ elements[0].parentNode.removeChild(elements[0]); } }