-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TamperMonkey script to make getting the portal text easier #30
Comments
I've made some modifications based on your work. Now you just need to click the portal and click the “COPY” button in nav bar. Thanks for your sharing, saving lots of time. // ==UserScript==
// @name ingress-maxfield
// @namespace https://intel.ingress.com/
// @version 0.1
// @description try to take over the world!
// @author 3verness
// @match https://intel.ingress.com/
// @grant none
// ==/UserScript==
(function() {
'use strict';
var copyButton = document.createElement("div");
copyButton.className = 'nav_link';
copyButton.innerHTML = 'COPY';
copyButton.addEventListener("click", copyFunc)
function copyFunc(){
//debugger
Tj(document.querySelector("#header_maplink"), "show_box");
displaymaplink();
var title = document.querySelector("#portal_primary_title").textContent;
var link = document.querySelector("#maplink").value;
var s = title+';'+link;
const input = document.createElement('input');
document.body.appendChild(input);
input.setAttribute('value', s);
input.select();
if (document.execCommand('copy')) {
document.execCommand('copy');
}
document.body.removeChild(input);
}
document.querySelector("#nav").appendChild(copyButton);
})(); |
Hi! To disturb. Excuse me, on line 19, Tampermonkey will report an error for "Tj". How to deal with it? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Its ugly, its probably not perfect, but it works on everything I've used so far. It just allows you to easily copy the title and link of the portal to your clipboard. Click the portal, click the link button and voila you got it in your clipboard. Wasnt sure where else to share it.
The text was updated successfully, but these errors were encountered: