Skip to content

Instantly share code, notes, and snippets.

@joshinils
Last active August 1, 2021 03:38
Show Gist options
  • Save joshinils/a5fa735b0bc11933bdac8ac08be19de9 to your computer and use it in GitHub Desktop.
Save joshinils/a5fa735b0bc11933bdac8ac08be19de9 to your computer and use it in GitHub Desktop.
osm add deep history greasemonkey
// ==UserScript==
// @name Deep History osm.org
// @version 1
// @grant none
// @match https://www.openstreetmap.org/node/*
// @match https://www.openstreetmap.org/way/*
// @match https://www.openstreetmap.org/relation/*
// ==/UserScript==
var sidebar_content, newElement;
sidebar_content = document.getElementById('sidebar_content').getElementsByClassName("browse-section")[0];
if (sidebar_content) {
displayContainer = document.createElement('div');
displayContainer.style.border = "1px solid #CCC";
displayContainer.style.borderRadius = "3px";
anchor = document.createElement('a');
anchor.target = "_blank";
anchor.href = "https://osmlab.github.io/osm-deep-history/#" + window.location.pathname;
anchor.innerHTML = "<center>OSM Deep History</center>";
displayContainer.appendChild(anchor);
sidebar_content.parentNode.insertBefore(displayContainer, sidebar_content);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment