As a result, it pops me up with the title of an issue (speaking of this particular issue, it would beHow to achieve Ctrl-t functionality).
Now, I want to use that value in a script with Pentadactyl. Thus, I add something like this to my .pentadactylrc
:javascript <<EOF
function dummyFu() {
var myElement = document.getElementsByClassName("js-issue-title");
alert(myElement["0"].firstChild.textContent);
}
EOF
map -silent <F5> -js dummyFu()
However, when run, it just says TypeError: myElement[0] is undefined.
I'm do not know much of JavaScript, unfortunately, so there's probably some mistake in my thinking? I just want to be able to get an element from a page by a class and then use it my script... Would be grateful for any suggestion, thanks.
Version:
Firefox.app in question is actually Firefox Extended Support Release, which still seems to be the latest Firefox available.
Issue:
Let's say I open a random issue page on a GitHub tracker (like this one), then I open Console in Firefox and run something like this:
As a result, it pops me up with the title of an issue (speaking of this particular issue, it would be
How to achieve Ctrl-t functionality
).Now, I want to use that value in a script with Pentadactyl. Thus, I add something like this to my
.pentadactylrc
However, when run, it just says
TypeError: myElement[0] is undefined
.I'm do not know much of JavaScript, unfortunately, so there's probably some mistake in my thinking? I just want to be able to get an element from a page by a class and then use it my script... Would be grateful for any suggestion, thanks.