Last active
December 18, 2025 22:19
-
-
Save isra00/7611767f1275e71d2d8472d3c8426833 to your computer and use it in GitHub Desktop.
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 characters
| // ==UserScript== | |
| // @name Gmail Parkimeter Admin Search email | |
| // @author Israel Viana | |
| // @namespace https://admin.parkimeter.com | |
| // @version 0.1 | |
| // @description Adds a button for searching email senders in Parkimeter Admin | |
| // @match https://mail.google.com/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=githubusercontent.com | |
| // @grant none | |
| // ==/UserScript== | |
| (function () { | |
| 'use strict'; | |
| window.setInterval(function() { | |
| // Select all elements with the three attributes and grandparent h3 | |
| const elems = document.querySelectorAll('h3 > * > [data-hovercard-id][email][name]'); | |
| // Filter out elements whose next sibling is a link (to prevent adding the same infinite times) | |
| const filtered = [...elems].filter(el => { | |
| const next = el.nextElementSibling; // only consider element nodes | |
| return !next || next.tagName !== 'A'; | |
| }); | |
| if (typeof filtered[0] != "undefined") { | |
| const button = document.createElement('a'); | |
| button.textContent = 'Search in Admin'; | |
| Object.assign(button.style, { | |
| border: '1px solid #ff7900', | |
| borderRadius: '0.5em', | |
| background: 'white url(https://assets.parkimeter.com/images/logos/parkimeter-logo-icon-100.png) 0.3em center no-repeat', | |
| padding: '0.1em 0.5em 0.0em 1.9em', | |
| fontWeight: 'bold', | |
| color: '#ff7900', | |
| margin: '0 0.5em', | |
| backgroundSize: '1.3em', | |
| cursor: 'pointer', | |
| display: 'inline-block', | |
| textDecoration: 'none', | |
| }); | |
| button.class = "parkimeter-admin-contact"; | |
| let email = filtered[0].getAttribute("email").replace(/^<|>$/g, ''); | |
| button.href = "https://admin.parkimeter.com/search?type=email&term=" + encodeURI(email) + "&strict=on"; | |
| button.target = "_blank"; | |
| filtered[0].after(button); | |
| } | |
| }, 100); | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment