question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Resource.textContent() not implementable in Browser

See original GitHub issue

Right now Resource.textContent() isn’t implemented in the Browser (nor is .size obviously) because in the browser we can only deal with external data asynchronously.

Right now that means that a module like ceylon.locale cannot be used at all in a browser.

Futures aren’t part of the language module so it seems to me that the only thing we can do is to add asynchronous versions of the two members:

  • textContentAsync(encoding, callback) and
  • sizeAsync(callback)

The documentation should then state that it would be preferable to always use those for best compatibility across all possible platforms.

Wdyt @gavinking @chochos ?

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:1
  • Comments:25 (25 by maintainers)

github_iconTop GitHub Comments

1reaction
gavinkingcommented, Sep 25, 2017

I have some rubbish heuristics for that in the code already.

0reactions
chochoscommented, Sep 25, 2017

How do we detect text files?

Read more comments on GitHub >

github_iconTop Results From Across the Web

'innerText' works in IE, but not in Firefox - Stack Overflow
Update: I wrote a blog post detailing all the differences much better. Firefox uses W3C standard Node::textContent , but its behavior ...
Read more >
Text content that changes automatically can be paused ... - W3C
This rule checks that for any text content that regularly changes automatically, there are instruments to pause, stop, or hide it or to...
Read more >
The poor, misunderstood innerText - Perfection Kills
Few things are as misunderstood and misused on the web as innerText property. That quirky, non-standard way of element's text retrieval, ...
Read more >
Node.textContent - Web APIs | MDN
The textContent property of the Node interface represents the text content of the node and its descendants.
Read more >
A JavaScript implementation of innerText (not innerHtml) for ...
In the sick, twisted word of cross-browser DOM-based JavaScript, sometimes you ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found