Playing a sound in a Firefox add-on

前端 未结 3 1194
旧巷少年郎
旧巷少年郎 2020-12-16 23:08

I would like to create a simple add-on that would play a different MP3 recording every time the user double clicks a word in a webpage he is visiting and selects a special o

3条回答
  •  时光取名叫无心
    2020-12-16 23:21

    var window = require('sdk/window/utils').getMostRecentBrowserWindow();
    var audio = ('http://example.com/audio.mp3');
    audio.play();
    

提交回复
热议问题