Birnbaum2001 / GCComment

7 stars 7 forks source link

Firefox does not handle directly TextNode from DOM over 4kB size breaking import from Dropbox. #17

Closed seblatre closed 8 years ago

seblatre commented 9 years ago

I am very found of GCComment which is highly useful for solving mystery by keeping track of our searches. However, doing so for very complex mystery caches can lead to text that exceed 4kb (4096) characters. The GCComment import code from XML (for Dropbox use) fails with such TextNode content too big (XML file from dropbox contains the right data but parser fails to load full data).

I have performed some testing with debug on my big cache's comment. With your code unmodified, and the following logs:

function parseXMLImport() {
...
    if (comments[i].childNodes[3].childNodes[0]) {
        var node = comments[i].childNodes[3].childNodes[0];
        var nodeValue = node.nodeValue;
        console.debug(nodeValue.length);
        ...
    }

I got the following output in my Firebug

4096

I have searched a bit over the web and found the textContentproperty but it didn't work better with my FF 38.0.5 so I still kept looking over the net and finally found on that forum comment: http://bytes.com/topic/net/answers/482760-problem-reading-large-amount-data-xml-tag#post1866941 So I added the following code:

xmlDoc.normalize();

and it begun to work well with the following log output

11051

Hope you will be able to fix that quickly. I have not tested the addition of this code in other browsers but it seems to be part of the standard.

lukeIam commented 9 years ago

Hi @seblatre,

thanks for report and the solution!

I'll add it to the next version.

seblatre commented 7 years ago

Thanks to have fixed this bug ;-)