Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>plus feature could be, to create two function in bakcround page, one stops the music, and the other restarts it:</p> <pre><code>function stop(){ } function start(){ } </code></pre> <p>So, when the user opens main.html, there could be two icons with two listeners on it, each one could call background pages function, like:</p> <pre><code>var backgroundpage = chrome.extension.getBackgroundPage(); $("start_button").click(function(){ backgroundpage.start(); }); $("stop_button").click(function(){ backgroundpage.stop(); }); </code></pre> <p>:)</p> </blockquote> <p>Edit:</p> <p><strong>popup.html:</strong></p> <pre><code>&lt;html&gt;&lt;head&gt;&lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function(){ var bgp = chrome.extension.getBackgroundPage(); $("#start_btn").click(function(){ bgp.start(); }); $("#stop_btn").click(function(){ bgp.stop(); }); }); &lt;/script&gt; &lt;/head&gt;&lt;body&gt; &lt;div&gt; &lt;button type="button" id="start_btn"&gt;Start&lt;/button&gt; &lt;button type="button" id="stop_btn"&gt;Stop&lt;/button&gt; &lt;/div&gt; &lt;/body&gt;&lt;/html&gt; </code></pre> <p><strong>background.html:</strong></p> <pre><code>&lt;html&gt;&lt;head&gt;&lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; &lt;script&gt; var audio = new Audio('guitar.mp3'); audio.loop="loop"; audio.play(); function start(){ audio.play(); } function stop(){ audio.pause(); } &lt;/script&gt; &lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt; </code></pre> <p>And thats it :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload