0

i'm trying to develop an extension for chrome. I'm quite new with javaScropts working. To understand what i'm trying to do: on this page there is a video, i can use the console to start and stop the video with this:

var p = jwplayer.apply();
p.play();
p.pause();

How can i write this command in a javascript extention?

EDIT: I've read your suggestion. But I'm really new with javascript, so it's difficult for me transpose those codes to my case. I want to point that i'm developing an extension, so i have to write a js that implement the code above as if i'm directly writing it into the console. Something like this (that of course it doesn't work):

$(window).ready(function() { 
    var p = jwplayer.apply();
    p.play();
});

I'm sorry for the stupid question, but it's my first experiment with javaScript.

Community
  • 1
  • 1
Giuseppe Angora
  • 833
  • 1
  • 10
  • 25
  • There are a lot of free guides online about how to make chrome extensions. I've done it before and it's really easy. A quick google will do you good. – TKoL Oct 24 '17 at 16:27
  • 1
    Possible duplicate of [Insert code into the page context using a content script](https://stackoverflow.com/questions/9515704/insert-code-into-the-page-context-using-a-content-script) – wOxxOm Oct 24 '17 at 16:35
  • Use method 2b from the linked answer and put only `var p = jwplayer.apply(); p.play();` inside function() – wOxxOm Oct 28 '17 at 00:45

0 Answers0