🏠 Home 

Greasy Fork is available in English.

Furaffinity-Prototype-Extensions

Library to hold common prototype extensions for your Furaffinity Script

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.greasyfork.org/scripts/525666/1549449/Furaffinity-Prototype-Extensions.js

  1. // ==UserScript==
  2. // @name Furaffinity-Prototype-Extensions
  3. // @namespace Violentmonkey Scripts
  4. // @grant GM_info
  5. // @version 1.0.1
  6. // @author Midori Dragon
  7. // @description Library to hold common prototype extensions for your Furaffinity Script
  8. // @icon https://www.furaffinity.net/themes/beta/img/banners/fa_logo.png
  9. // @license MIT
  10. // @homepageURL https://greasyfork.org/scripts/525666-furaffinity-prototype-extensions
  11. // @supportURL https://greasyfork.org/scripts/525666-furaffinity-prototype-extensions/feedback
  12. // ==/UserScript==
  13. // jshint esversion: 8
  14. (() => {
  15. "use strict";
  16. var __webpack_modules__ = {
  17. 177: () => {
  18. Node.prototype.insertBeforeThis = function(newNode) {
  19. var _a;
  20. null === (_a = this.parentNode) || void 0 === _a || _a.insertBefore(newNode, this);
  21. };
  22. Node.prototype.insertAfterThis = function(newNode) {
  23. var _a;
  24. null === (_a = this.parentNode) || void 0 === _a || _a.insertBefore(newNode, this.nextSibling);
  25. };
  26. Node.prototype.getIndexOfThis = function() {
  27. if (null == this.parentNode) return -1;
  28. return Array.from(this.parentNode.children).indexOf(this);
  29. };
  30. Node.prototype.readdToDom = function() {
  31. var _a;
  32. const clone = this.cloneNode(false);
  33. null === (_a = this.parentNode) || void 0 === _a || _a.replaceChild(clone, this);
  34. return clone;
  35. };
  36. },
  37. 536: () => {
  38. String.prototype.trimEnd = function(toTrim) {
  39. if (null == toTrim) return "";
  40. if ("" === toTrim || "" === this) return this.toString();
  41. let r###lt = this.toString();
  42. for (;r###lt.endsWith(toTrim); ) r###lt = r###lt.slice(0, -toTrim.length);
  43. return r###lt;
  44. };
  45. String.prototype.trimStart = function(toTrim) {
  46. if (null == toTrim) return "";
  47. if ("" === toTrim || "" === this) return this.toString();
  48. let r###lt = this.toString();
  49. for (;r###lt.startsWith(toTrim); ) r###lt = r###lt.slice(toTrim.length);
  50. return r###lt;
  51. };
  52. }
  53. }, __webpack_module_cache__ = {};
  54. function __webpack_require__(moduleId) {
  55. var cachedModule = __webpack_module_cache__[moduleId];
  56. if (void 0 !== cachedModule) return cachedModule.exports;
  57. var module = __webpack_module_cache__[moduleId] = {
  58. exports: {}
  59. };
  60. __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
  61. return module.exports;
  62. }
  63. __webpack_require__.n = module => {
  64. var getter = module && module.__esModule ? () => module.default : () => module;
  65. __webpack_require__.d(getter, {
  66. a: getter
  67. });
  68. return getter;
  69. };
  70. __webpack_require__.d = (exports, definition) => {
  71. for (var key in definition) if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
  72. enumerable: true,
  73. get: definition[key]
  74. });
  75. };
  76. __webpack_require__.o = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);
  77. __webpack_require__(177), __webpack_require__(536);
  78. })();