Skip to content

Instantly share code, notes, and snippets.

@Tiny-Giant
Last active December 18, 2015 23:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tiny-Giant/6059a2bdfb493ab0e6e4 to your computer and use it in GitHub Desktop.
Save Tiny-Giant/6059a2bdfb493ab0e6e4 to your computer and use it in GitHub Desktop.
Sets the title for every link as the URL for every link on the page which does not already have a title.
// ==UserScript==
// @name SE URL To Title
// @namespace http://github.com/Tiny-Giant
// @version 1.0.0.1
// @description Sets the title for every link as the URL for every link on the page which does not already have a title.
// @author @TinyGiant
// @include /^https?:\/\/.*\.?stack(overflow|exchange).com/.*$/
// @grant none
// ==/UserScript==
/* jshint -W097 */
window.addEventListener('load',function() {
'use strict';
var links = document.querySelectorAll('a'), i;
for (i in Object.keys(links)) if(!links[i].title) links[i].title = links[i].href;
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment