Discussions » Development

G-Chrome Bug Accessing Node (href) Property Value

§
Posted: 2016-10-15
Edited: 2016-10-15

G-Chrome Bug Accessing Node (href) Property Value

My deviantArt script (version 1.0.18) no longer works on G-Chrome. The bug is first raised here.

The error occurs at around line 203 and here is a copy of the section:

function GetNextPageURL(doc)
{
    var next = (doc.querySelector("#gmi-DoubleResourceStream")) ? doc.querySelector(".folderview-art > .pagination-wrapper li.next a.away") : doc.querySelector("#gallery_pager li.next a.away");
    
    if (next)
    {                
        console.log(next);
        nextPageURL = next.href;
        console.log("NEXTPAGE: " + nextPageURL);
        return true;
    }

    pagerSwitch.value = -1;
    //pagerSwitch.className = "smbutton smbutton-dead";
    nextPageURL = null;
    return false;
}

The issue arises when I try to set the nextPageURL to next.href. For some unknown reason I am unable to access next.href (node property) value. Looking at the first console.log output the next has a value but when I check the nextPageURL in the console.log it is empty.

        nextPageURL = next.href; //No longer works on Chrome
        nextPageURL = next.getAttribute("href"); // Works fine

I found a way around it by using next.getAttribute("href") but the current issue will break a lot of scripts (mine and others).

Anyone know why this maybe occurring?
Thanks

§
Posted: 2016-10-22
Edited: 2016-10-22

I see. Thanks.

Post reply

Sign in to post a reply.