waitUntilExists

Is a small one function script, my most use one I use..

이 스크립트는 직접 설치하는 용도가 아닙니다. 다른 스크립트에서 메타 지시문 // @require https://update.greatest.deepsurf.us/scripts/386/5026/waitUntilExists.js을(를) 사용하여 포함하는 라이브러리입니다.

  1. // ==UserScript==
  2. // @name waitUntilExists
  3. // @version 1.0
  4. // @description Is a small one function script, my most use one I use..
  5. // ==/UserScript==
  6.  
  7. (function ($) {
  8. $.fn.waitUntilExists = function (handler, shouldRunHandlerOnce, isChild) {
  9. var found = 'found';
  10. var $this = $(this.selector);
  11. var $elements = $this.not(function () { return $(this).data(found); }).each(handler).data(found, true);
  12. if (!isChild) {
  13. (window.waitUntilExists_Intervals = window.waitUntilExists_Intervals || {})[this.selector] =
  14. window.setInterval(function () { $this.waitUntilExists(handler, shouldRunHandlerOnce,
  15. true); }, 500);
  16. } else if (shouldRunHandlerOnce && $elements.length) {
  17. window.clearInterval(window.waitUntilExists_Intervals[this.selector]);
  18. }
  19. return $this;
  20. }
  21. }(jQuery));