Remove Experimental / Deprecated Useless APIs

to remove useless APIs (either experimental or deprecated) like IdleDetector

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Remove Experimental / Deprecated Useless APIs
// @namespace    http://tampermonkey.net/
// @version      0.1.2
// @description  to remove useless APIs (either experimental or deprecated) like IdleDetector
// @author       CY Fung
// @match        https://*/*
// @match        http://*/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=greatest.deepsurf.us
// @grant               none
// @run-at              document-start
// @license             MIT
// @compatible          chrome
// @compatible          edge
// @compatible          firefox
// @compatible          safari
// @compatible          opera
// @unwrap
// @allFrames
// @inject-into page
// ==/UserScript==

(function () {
    'use strict';

    if (typeof IdleDetector === 'function') {
        try {
            IdleDetector = undefined;
        } catch (e) { }
        delete window.IdleDetector;
    }

    if (typeof webkitCancelAnimationFrame === 'function') {
        try {
            webkitCancelAnimationFrame = undefined;
        } catch (e) { }
        delete window.webkitCancelAnimationFrame;
    }

    if (typeof webkitRequestAnimationFrame === 'function') {
        try {
            webkitRequestAnimationFrame = undefined;
        } catch (e) { }
        delete window.webkitRequestAnimationFrame;
    }

    if (typeof styleMedia === 'function') {
        // This feature is deprecated/obsolete and should not be used.
        try {
            styleMedia = undefined;
        } catch (e) { }
        delete window.styleMedia;
    }

    if (typeof launchQueue === 'object') {
        // This feature is experimental. Use caution before using in production.
        try {
            launchQueue = undefined;
        } catch (e) { }
        delete window.launchQueue;
    }

    if (typeof webkitRequestFileSystem === 'function') {
        // This feature is deprecated/obsolete and should not be used.
        try {
            webkitRequestFileSystem = undefined;
        } catch (e) { }
        delete window.webkitRequestFileSystem;
    }

    if (typeof webkitResolveLocalFileSystemURL === 'function') {
        // This feature is non-standard and should not be used without careful consideration.
        try {
            webkitResolveLocalFileSystemURL = undefined;
        } catch (e) { }
        delete window.webkitResolveLocalFileSystemURL;
    }

    if (typeof VRDisplayEvent === 'function') {
        // This feature is deprecated/obsolete and should not be used.
        try {
            VRDisplayEvent = undefined;
        } catch (e) { }
        delete window.VRDisplayEvent;
    }

    if (typeof HTMLFrameSetElement === 'function') {
        // This feature is deprecated/obsolete and should not be used.
        try {
            HTMLFrameSetElement = undefined;
        } catch (e) { }
        delete window.HTMLFrameSetElement;
    }

    if (typeof CanMakePaymentEvent === 'function') {
        // This feature is experimental. Use caution before using in production.
        try {
            CanMakePaymentEvent = undefined;
        } catch (e) { }
        delete window.CanMakePaymentEvent;
    }


    if (typeof PositionSensorVRDevice === 'function') {
        // This feature is deprecated/obsolete and should not be used.
        try {
            PositionSensorVRDevice = undefined;
        } catch (e) { }
        delete window.PositionSensorVRDevice;
    }

    if (typeof PerformanceTiming === 'function') {
        // This feature is deprecated/obsolete and should not be used.
        try {
            PerformanceTiming = undefined;
        } catch (e) { }
        delete window.PerformanceTiming;
    }

    if (typeof navigation === 'function') {
        // This feature is experimental. Use caution before using in production.
        try {
            navigation = undefined;
        } catch (e) { }
        delete window.navigation;
    }




    /*

   let arr = ["navigation", "onsearch", "trustedTypes",
    "onappinstalled", "onbeforeinstallprompt", "onbeforexrselect", "oncancel", "oncontextlost", 
    "oncontextrestored", "onmousewheel", "onpointerrawupdate",
     "scheduler", "chrome", "credentialless", "launchQueue", 
     "onbeforematch", "onbeforetoggle", "originAgentCluster", 
     "oncontentvisibilityautostatechange", "openDatabase", "webkitRequestFileSystem", "webkitResolveLocalFileSystemURL"];

     */

    // Your code here...
})();