[Pkg-mozext-commits] [greasemonkey] 04/30: Add support for `@run-at document-idle`.

David Prévot taffit at moszumanska.debian.org
Thu Nov 26 00:56:27 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository greasemonkey.

commit 759b12fa47aff6e867f6989941882effa99b7a72
Author: Anthony Lieuallen <arantius at gmail.com>
Date:   Fri Oct 23 12:46:02 2015 -0400

    Add support for `@run-at document-idle`.
    
    Fixes #2109
---
 content/framescript.js | 2 ++
 modules/parseScript.js | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/content/framescript.js b/content/framescript.js
index cd73b85..c36015f 100644
--- a/content/framescript.js
+++ b/content/framescript.js
@@ -52,6 +52,7 @@ function browserLoad(aEvent) {
     // #1696: document-element-inserted doesn't see about:blank
     runScripts('document-start', contentWin);
     runScripts('document-end', contentWin);
+    runScripts('document-idle', contentWin);
   }
 
   gScope.sendAsyncMessage("greasemonkey:DOMContentLoaded", {
@@ -69,6 +70,7 @@ function contentLoad(aEvent) {
   contentWin.removeEventListener('load', contentLoad, true);
 
   runScripts('document-end', contentWin);
+  GM_util.timeout(function() { runScripts('document-idle', contentWin); }, 50);
 }
 
 
diff --git a/modules/parseScript.js b/modules/parseScript.js
index 903b00f..30b7569 100644
--- a/modules/parseScript.js
+++ b/modules/parseScript.js
@@ -184,7 +184,7 @@ function setDefaults(script) {
   if (!script.updateURL && script.downloadURL) {
     script.updateURL = script.downloadURL;
   }
-  if ('document-start' != script._runAt && 'document-end' != script._runAt) {
+  if (!script._runAt || !script._runAt.match(/^document-(end|idle|start)$/)) {
     script._runAt = 'document-end';
   }
   if (script._includes.length == 0 && script._matches.length == 0) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/greasemonkey.git



More information about the Pkg-mozext-commits mailing list