{"action":"opened","issue":{"url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/2448","repository_url":"https://api.github.com/repos/greasemonkey/greasemonkey","labels_url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/2448/labels{/name}","comments_url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/2448/comments","events_url":"https://api.github.com/repos/greasemonkey/greasemonkey/issues/2448/events","html_url":"https://github.com/greasemonkey/greasemonkey/issues/2448","id":187540409,"number":2448,"title":"How could the variable created inside function() inside GM_xmlhttpRequest be passed to outside?","user":{"login":"pendave","id":1331881,"avatar_url":"https://avatars.githubusercontent.com/u/1331881?v=3","gravatar_id":"","url":"https://api.github.com/users/pendave","html_url":"https://github.com/pendave","followers_url":"https://api.github.com/users/pendave/followers","following_url":"https://api.github.com/users/pendave/following{/other_user}","gists_url":"https://api.github.com/users/pendave/gists{/gist_id}","starred_url":"https://api.github.com/users/pendave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pendave/subscriptions","organizations_url":"https://api.github.com/users/pendave/orgs","repos_url":"https://api.github.com/users/pendave/repos","events_url":"https://api.github.com/users/pendave/events{/privacy}","received_events_url":"https://api.github.com/users/pendave/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-06T03:59:56Z","updated_at":"2016-11-06T03:59:56Z","closed_at":null,"body":"Help me please.\r\n\r\nHow could the variable created inside function() inside GM_xmlhttpRequest be passed to outside?\r\n\r\n> if(myElement.nextSibling.nextSibling.nextSibling.getAttribute(\"style\")==\"color:#1bdcbe\"){\r\n        href = \"https://xxxxxxxxxx.com/search?term=\"+info;\r\n        var ret = GM_xmlhttpRequest({\r\n            method: \"GET\",\r\n            url: href,\r\n            onload: function(res) {\r\n                //alert(res.responseText);\r\n                alert(eval('('+res.responseText+')').results[0].trackViewUrl);\r\n                trackUrl = eval('('+ res.responseText +')').results[0].trackViewUrl;\r\n            }\r\n        });\r\n        html =  myElement.nextSibling.nextSibling.nextSibling.innerHTML + \"&nbsp;&nbsp;&nbsp;&nbsp;<a href='\" + trackUrl + \"' target='_blank' class='btn'><span>Here</span></a>\";\r\n        myElement.nextSibling.nextSibling.nextSibling.innerHTML = html;\r\n    }\r\n\r\n\r\n![t5u 3_x j ff pnw 5l8g_r](https://cloud.githubusercontent.com/assets/1331881/20035259/374dba6c-a418-11e6-90d3-aab9ba06b551.png)\r\n\r\nEven I var that variable outside, no result...\r\n\r\n![t5u 3_x j ff pnw 5l8g_r](https://cloud.githubusercontent.com/assets/1331881/20035269/74237f08-a418-11e6-97ec-8e8605234cea.png)\r\n"}}
{"actor":{"display_login":"pendave"}}