nascent / Instagram to greatfon Instagram Viewer link replacer

// ==UserScript==
// @name         Instagram to greatfon Instagram Viewer link replacer
// @namespace    http://instagram.com/
// @version      0.2
// @description  Replace all instagram profile links with greatfon instagram viewer, allowing viewing of Instagram links without an account
// @author       nascent
// @match      *://*/*
// @grant        none
// @updateURL https://openuserjs.org/meta/nascent/Instagram_to_greatfon_Instagram_Viewer_link_replacer.meta.js
// @license GPL-3.0-or-later
// ==/UserScript==

/*Changelog
 
* 0.1 Initial Release
* 0.2 regex fix
*/

(function() {
    'use strict';
    var anchors = document.getElementsByTagName("a");

    for (var i = 0; i < anchors.length; i++) {
        var link = anchors[i].href
        var newlink = link.replace(/instagram.com\//g, "greatfon.com/v/");
        anchors[i].href = newlink;
    }
})();