Last active
February 1, 2021 18:59
-
-
Save shrddr/a67777d247c4a8553216f52cd3c1d1a5 to your computer and use it in GitHub Desktop.
This file contains 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 Changeset Links | |
// @namespace http://tampermonkey.net/ | |
// @version 1.1 | |
// @description adds achavi link to openstreetmap changeset page | |
// @author shrddr | |
// @match https://www.openstreetmap.org/* | |
// @grant none | |
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
function addLink(jNode) { | |
let path = window.location.pathname; | |
if (path.indexOf("/changeset/") === -1) return; | |
let changeset = path.replace("/changeset/", "") | |
//console.log('changeset:', changeset); | |
jNode.append(' (<a href="https://overpass-api.de/achavi/?changeset='+changeset+'">achavi</a>)'); | |
//console.log('jNode:', jNode); | |
} | |
waitForKeyElements("#sidebar_content h2", addLink); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment