{"action":"opened","issue":{"url":"https://api.github.com/repos/timdown/rangy/issues/349","labels_url":"https://api.github.com/repos/timdown/rangy/issues/349/labels{/name}","comments_url":"https://api.github.com/repos/timdown/rangy/issues/349/comments","events_url":"https://api.github.com/repos/timdown/rangy/issues/349/events","html_url":"https://github.com/timdown/rangy/issues/349","id":108411060,"number":349,"title":"Is there a way to use rangy.innerText(), Selection.toString() or Range.text() for XMLHttpRequest document?","user":{"login":"vsemozhetbyt","id":10393198,"avatar_url":"https://avatars.githubusercontent.com/u/10393198?v=3","gravatar_id":"","url":"https://api.github.com/users/vsemozhetbyt","html_url":"https://github.com/vsemozhetbyt","followers_url":"https://api.github.com/users/vsemozhetbyt/followers","following_url":"https://api.github.com/users/vsemozhetbyt/following{/other_user}","gists_url":"https://api.github.com/users/vsemozhetbyt/gists{/gist_id}","starred_url":"https://api.github.com/users/vsemozhetbyt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vsemozhetbyt/subscriptions","organizations_url":"https://api.github.com/users/vsemozhetbyt/orgs","repos_url":"https://api.github.com/users/vsemozhetbyt/repos","events_url":"https://api.github.com/users/vsemozhetbyt/events{/privacy}","received_events_url":"https://api.github.com/users/vsemozhetbyt/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-25T21:28:44Z","updated_at":"2015-09-25T21:28:44Z","closed_at":null,"body":"After reading [The poor, misunderstood innerText](http://perfectionkills.com/the-poor-misunderstood-innerText/) of kangax I've tried to use `innerText` for text scraping in the `XMLHttpRequest`. However I'run into this issue:\r\n\r\nhttps://code.google.com/p/chromium/issues/detail?id=536137\r\n\r\nThen I've tried to use **rangy** for this, however I've got errors for all the ways I could think of:\r\n\r\n```javascript\r\nconsole.log(rangy.innerText(node));\r\n```\r\n\r\n`Uncaught TypeError: Cannot read property 'getComputedStyle' of null`\r\n\r\n```javascript\r\n`const sel = rangy.getSelection(doc);`\r\n`sel.selectAllChildren(node);`\r\n`console.log(sel.toString());`\r\n```\r\n\r\n`Uncaught TypeError: Cannot read property 'document' of null`\r\n\r\n```javascript\r\n`const range = rangy.createRange(doc); // or createRangyRange`\r\n`range.selectNode(node);`\r\n`console.log(range.text());`\r\n```\r\n\r\n`Uncaught TypeError: Cannot read property 'getComputedStyle' of null`\r\n\r\nIt seems the lack of `Window` object for the `XMLHttpRequest` documents is the cause. Is there any worckaround for this purpose?"}}