prototype.js抑制

【「@run-at document-start」必須】Prototype JavaScript framework (prototype.js) による組み込みメソッド破壊について、Tampermonkey、およびViolent monkeyが干渉するバグを回避します。

Fra og med 13.03.2016. Se den nyeste version.

Dette script bør ikke installeres direkte. Det er et bibliotek, som andre scripts kan inkludere med metadirektivet // @require https://updategreasyfork.deno.dev/scripts/17932/112905/prototypejs%E6%8A%91%E5%88%B6.js

// ==UserScript==
// @name        prototype.js抑制
// @version     1.0.0
// @description 【「@run-at document-start」必須】Prototype JavaScript framework (prototype.js) による組み込みメソッド破壊について、Tampermonkey、およびViolent monkeyが干渉するバグを回避します。
// @license     Mozilla Public License Version 2.0 (MPL 2.0); https://www.mozilla.org/MPL/2.0/
// @compatible  Opera
// @compatible  Chrome
// @run-at      document-start
// @author      100の人
// @homepage    https://gf.zukizuki.org/users/137
// ==/UserScript==

(function () {
'use strict';

if (window.chrome && !Object.extend) {
	Object.defineProperty(Array, 'from', { writable: false });
	Object.defineProperty(Object, 'extend', {
		writable: false,
		value: function (destination, source) {
			for (var property in source) {
				let descriptor;
				if (property === 'toJSON' || property !== 'sub' && (descriptor = Object.getOwnPropertyDescriptor(destination, property)) && !descriptor.enumerable) {
					continue;
				}
				destination[property] = source[property];
			}
			return destination;
		},
	});
}

})();