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

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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, ":");
    }
})();