{"action":"created","issue":{"url":"https://api.github.com/repos/lodash/lodash/issues/1340","labels_url":"https://api.github.com/repos/lodash/lodash/issues/1340/labels{/name}","comments_url":"https://api.github.com/repos/lodash/lodash/issues/1340/comments","events_url":"https://api.github.com/repos/lodash/lodash/issues/1340/events","html_url":"https://github.com/lodash/lodash/pull/1340","id":94728015,"number":1340,"title":"Make sure root is the global object. Fix lodash in Firefox extensions","user":{"login":"iamolivinius","id":832245,"avatar_url":"https://avatars.githubusercontent.com/u/832245?v=3","gravatar_id":"","url":"https://api.github.com/users/iamolivinius","html_url":"https://github.com/iamolivinius","followers_url":"https://api.github.com/users/iamolivinius/followers","following_url":"https://api.github.com/users/iamolivinius/following{/other_user}","gists_url":"https://api.github.com/users/iamolivinius/gists{/gist_id}","starred_url":"https://api.github.com/users/iamolivinius/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iamolivinius/subscriptions","organizations_url":"https://api.github.com/users/iamolivinius/orgs","repos_url":"https://api.github.com/users/iamolivinius/repos","events_url":"https://api.github.com/users/iamolivinius/events{/privacy}","received_events_url":"https://api.github.com/users/iamolivinius/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lodash/lodash/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":20,"created_at":"2015-07-13T14:01:28Z","updated_at":"2015-08-17T03:42:40Z","closed_at":"2015-07-13T19:10:43Z","pull_request":{"url":"https://api.github.com/repos/lodash/lodash/pulls/1340","html_url":"https://github.com/lodash/lodash/pull/1340","diff_url":"https://github.com/lodash/lodash/pull/1340.diff","patch_url":"https://github.com/lodash/lodash/pull/1340.patch"},"body":"Lodash does not run within the content script of a Firefox Bootstraped extensions. Firefox add-on SDK extensions are not affected.\r\n\r\nThe basic problem is to get the correct `global` object.\r\n\r\nWithin the content script sandbox properties like `window` and `self` are available and refer to the current window/tab. Unfortunately `window` and `self` are not the global object inside the sandbox.\r\n\r\nFor example: \r\n\r\n```js\r\nwindow.Math === Math // false\r\nself.Math === Math   // false\r\n```\r\n\r\nhttps://github.com/lodash/lodash/blob/3.10.0/lodash.js#L274\r\n\r\nAt this point `root` has a reference to the wrong object. A working solution can be found here: https://github.com/zloirock/core-js/blob/master/modules/%24.js#L2\r\n\r\nFor more information and discussion, see: \r\n\r\nhttps://github.com/zloirock/core-js/pull/91\r\nhttps://github.com/zloirock/core-js/issues/86"},"comment":{"url":"https://api.github.com/repos/lodash/lodash/issues/comments/131671817","html_url":"https://github.com/lodash/lodash/pull/1340#issuecomment-131671817","issue_url":"https://api.github.com/repos/lodash/lodash/issues/1340","id":131671817,"user":{"login":"jdalton","id":4303,"avatar_url":"https://avatars.githubusercontent.com/u/4303?v=3","gravatar_id":"","url":"https://api.github.com/users/jdalton","html_url":"https://github.com/jdalton","followers_url":"https://api.github.com/users/jdalton/followers","following_url":"https://api.github.com/users/jdalton/following{/other_user}","gists_url":"https://api.github.com/users/jdalton/gists{/gist_id}","starred_url":"https://api.github.com/users/jdalton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdalton/subscriptions","organizations_url":"https://api.github.com/users/jdalton/orgs","repos_url":"https://api.github.com/users/jdalton/repos","events_url":"https://api.github.com/users/jdalton/events{/privacy}","received_events_url":"https://api.github.com/users/jdalton/received_events","type":"User","site_admin":false},"created_at":"2015-08-17T03:42:40Z","updated_at":"2015-08-17T03:42:40Z","body":"This will make it in to v4.0."}}