diff --git a/README b/README index 63fd34b..f45ab77 100755 --- a/README +++ b/README @@ -26,6 +26,7 @@ Supported websites include * Seasonvar * Sopcast * SoundCloud + * Stormo.tv * StreamCloud * SVTPlay & Öppet Arkiv (Swedish TV Station) * Torrent diff --git a/js/content_scripts/stormotv-content-scripts.js b/js/content_scripts/stormotv-content-scripts.js new file mode 100644 index 0000000..0feaa1e --- /dev/null +++ b/js/content_scripts/stormotv-content-scripts.js @@ -0,0 +1,16 @@ + + +chrome.runtime.onMessage.addListener( + function(request, sender, sendResponse) { + var $video = $('video'); + if (request.action == "getVideoSrc") { + var videoSrc = + $video.find('source:first').attr('src') + || $video.attr('src') + ; + sendResponse({videoSrc: videoSrc}); + } else if (request.action == "onPlayback") { + $video[0].pause(); + } + } +); diff --git a/js/modules.js b/js/modules.js index 82f9675..c853c07 100755 --- a/js/modules.js +++ b/js/modules.js @@ -538,6 +538,25 @@ function getSoundcloudTrackId(url, callback) { }); } +var StormoTvModule = { + canHandleUrl: function(url) { + var validPatterns = [ + "^https?://(www\\.)?stormo\\.tv/videos/" + ]; + return urlMatchesOneOfPatterns(url, validPatterns); + }, + getMediaType: function() { + return 'video'; + }, + getPluginPath: function(url, getAddOnVersion, callback) { + chrome.tabs.sendMessage(currentTabId, {action: 'getVideoSrc'}, function (response) { + if (response) { + callback(response.videoSrc); + } + }); + } + }; + var StreamCloudModule = { canHandleUrl: function(url) { var validPatterns = [ @@ -922,6 +941,7 @@ var allModules = [ SolarmoviezModule, SopcastModule, SoundcloudModule, + StormoTvModule, StreamCloudModule, SVTOppetArkivModule, SVTPLAYModule, diff --git a/manifest.json b/manifest.json index 342e2e1..aefb8cb 100644 --- a/manifest.json +++ b/manifest.json @@ -89,6 +89,9 @@ }, { "matches": ["*://*.pornhub.com/*"], "js": ["js/jquery-2.1.4.min.js", "js/content_scripts/pornhub-content-scripts.js"] + }, { + "matches": ["*://*.stormo.tv/*"], + "js": ["js/jquery-2.1.4.min.js", "js/content_scripts/stormotv-content-scripts.js"] }], "web_accessible_resources": [ "images/*"