{"action":"created","issue":{"url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/1849","labels_url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/1849/labels{/name}","comments_url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/1849/comments","events_url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/1849/events","html_url":"https://github.com/greasemonkey/greasemonkey/issues/1849","id":24868938,"number":1849,"title":"At document-start time, some (unpredictable) parts of the document are already present","user":{"login":"kekkc","id":6283064,"avatar_url":"https://avatars.githubusercontent.com/u/6283064?v=3","gravatar_id":"","url":"https://api.github.com/users/kekkc","html_url":"https://github.com/kekkc","followers_url":"https://api.github.com/users/kekkc/followers","following_url":"https://api.github.com/users/kekkc/following{/other_user}","gists_url":"https://api.github.com/users/kekkc/gists{/gist_id}","starred_url":"https://api.github.com/users/kekkc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kekkc/subscriptions","organizations_url":"https://api.github.com/users/kekkc/orgs","repos_url":"https://api.github.com/users/kekkc/repos","events_url":"https://api.github.com/users/kekkc/events{/privacy}","received_events_url":"https://api.github.com/users/kekkc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/greasemonkey/greasemonkey/milestones/38","html_url":"https://github.com/greasemonkey/greasemonkey/milestones/Tracking%20Upstream","labels_url":"https://api.github.com/repos/greasemonkey/greasemonkey/milestones/38/labels","id":122469,"number":38,"title":"Tracking Upstream","description":"Bugs that we can't fix, we need Firefox to be fixed.","creator":{"login":"arantius","id":84729,"avatar_url":"https://avatars.githubusercontent.com/u/84729?v=3","gravatar_id":"","url":"https://api.github.com/users/arantius","html_url":"https://github.com/arantius","followers_url":"https://api.github.com/users/arantius/followers","following_url":"https://api.github.com/users/arantius/following{/other_user}","gists_url":"https://api.github.com/users/arantius/gists{/gist_id}","starred_url":"https://api.github.com/users/arantius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arantius/subscriptions","organizations_url":"https://api.github.com/users/arantius/orgs","repos_url":"https://api.github.com/users/arantius/repos","events_url":"https://api.github.com/users/arantius/events{/privacy}","received_events_url":"https://api.github.com/users/arantius/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":4,"state":"open","created_at":"2012-05-22T13:24:07Z","updated_at":"2015-07-31T14:54:41Z","due_on":null,"closed_at":null},"comments":25,"created_at":"2013-12-29T22:51:06Z","updated_at":"2015-08-20T21:48:23Z","closed_at":null,"body":"Hello all,\r\n\r\nthe following event for the add of the title tag is not fired on http://www.example.com/ (alert is not shown):\r\n\r\n    // ==UserScript==\r\n    // @name        rtzgrgd\r\n    // @namespace   fhdf\r\n    // @description fdhdrfhdrfg\r\n    // @version     1\r\n    // @include     http*\r\n    // @grant       none\r\n    // @run-at document-start\r\n    // ==/UserScript==\r\n\r\n    MutationObserver = window.MutationObserver;\r\n    var observer = new MutationObserver(function(mutations) {\r\n      mutations.forEach(function(mutation) {\r\n       \r\n        var addedNodes = mutation.addedNodes;\r\n        for (var i = 0; i < addedNodes.length; i++) {\r\n            if (addedNodes[i].nodeName == 'TITLE') {alert(\"Yes, script is active! Hurray!\");}\r\n        }\r\n       \r\n      });\r\n    });\r\n\r\n    // pass in the target node, as well as the observer options\r\n    observer.observe(document, {childList: true, subtree: true, attributes: true});\r\n\r\n\r\nHowever, if the source of http://www.example.com/ is saved locally and the script is added there (as <script..</script> without using GM), everything works, event fires, alert is shown:\r\n- see the attached example.com.htm\r\n\r\nBesides, the user.js script is even working in Chrome (added in settings>extensions). So I guess it's not a problem in FF or the code. Somehow GM seems to swallow up all events, without giving them back. I have this problem with several userscripts (on some sites they're simply not active). This drives me crazy, if anyone has an idea about the problem or workaround please help ;)\r\n\r\nTestcase to see that it's generally working without GM:\r\nhttps://groups.google.com/group/greasemonkey-users/attach/bf08c3c428beeaa6/example.com.htm?part=4&view=1\r\n\r\nUserscript for GM:\r\nhttps://groups.google.com/group/greasemonkey-users/attach/bf08c3c428beeaa6/rtzgrgd.user.js?part=5&view=1\r\n\r\nGreetz\r\n"},"comment":{"url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/comments/133187879","html_url":"https://github.com/greasemonkey/greasemonkey/issues/1849#issuecomment-133187879","issue_url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/1849","id":133187879,"user":{"login":"the8472","id":1065730,"avatar_url":"https://avatars.githubusercontent.com/u/1065730?v=3","gravatar_id":"","url":"https://api.github.com/users/the8472","html_url":"https://github.com/the8472","followers_url":"https://api.github.com/users/the8472/followers","following_url":"https://api.github.com/users/the8472/following{/other_user}","gists_url":"https://api.github.com/users/the8472/gists{/gist_id}","starred_url":"https://api.github.com/users/the8472/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/the8472/subscriptions","organizations_url":"https://api.github.com/users/the8472/orgs","repos_url":"https://api.github.com/users/the8472/repos","events_url":"https://api.github.com/users/the8472/events{/privacy}","received_events_url":"https://api.github.com/users/the8472/received_events","type":"User","site_admin":false},"created_at":"2015-08-20T21:48:23Z","updated_at":"2015-08-20T21:48:23Z","body":"How about adding a new option based on `DOMWindowCreated` or `content-document-global-created`? Those who need their scripts to run really early can do so but must code defensively since objects might be missing, everyone else can just wait for `document-start`."}}