javascript - Using JS (In FF-Pentadactyl), how to get a handle to site content like media players? -
using firefox web console (which can brought control shift k ) can access things flowplayers.
jwplayer().play(), example
the console offers autocompletion suggestions it. console in kind of, lack of words , knowledge, namespace? tried things like
content.document.getelementsbyname('flvplayer').item(0)
using pentadactyls js intepreter (accessed :js) seem give me player handle, or @ least prints out <html:object>
corresponds it. appending .play() doesn't work, though. it's not function.
what need emulate web-consoles way of doing it?
i realize might spoonfeedy question, if not acceptable i'd still appreciate pointed directions possibly discover solution myself reading.
i tried searching myself terms seem quite ambiguous , results people talking own sites, scripts running inside of 'namespace', not outside trying do. (unless wrong concepts of inside , outside here.)
cheers~~
the following command works me; defines command ypl
plays youtube video on page
command! ypl open javascript:(function() {content.document.getelementbyid('movie_player').playvideo()})()
another example: defines ytr
command takes integer argument , moves current time position of video amount in seconds
command! -nargs=1 ytr open javascript:(function(){var vid = content.document.getelementbyid('movie_player'); vid.seekto(vid.getcurrenttime() + (<args>), true)})()
i hope helps bit. when wrote while ago may have tried :js
, if didn't work used :open javascript:...
.
Comments
Post a Comment