Wayback Machine for Chrome Omnibox Colon Fix

Revert the URL encoding of colons by Chrome %s replacement to make it work with Wayback Machines search

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name            Wayback Machine for Chrome Omnibox Colon Fix
// @description     Revert the URL encoding of colons by Chrome %s replacement to make it work with Wayback Machines search
// @author          Archangel1C
// @license         GPL-3.0-only
// @namespace       https://github.com/Archangel1C
// @version         0.4
// @match           http*://web.archive.org/web/*
// @run-at          document-start
// @grant           none
// @compatible      chrome
// @contributionURL https://flattr.com/@Archangel1C
// ==/UserScript==
//
// Omnibox Search Engine URL: https://web.archive.org/web/*/%s
//
// Sources/Influences:
// - https://superuser.com/a/302179 for the JavaScript part
// - https://superuser.com/a/364060 for the GreaseMonkey part


(function() {
// debugger instruction lets Chrome stop here
//  debugger;

    // https://www.w3schools.com/js/js_strict.asp
    // https://stackoverflow.com/a/1335881/4423698
    'use strict';

    // avoid infinite recursion
    if(window.location.href.search(/%3A/gi) > -1) {
        window.location = window.location.href.replace(/%3A/gi, ":");
    }
})();