diff --git a/manifest.json b/manifest.json index 95293a42a..23d5c75e9 100644 --- a/manifest.json +++ b/manifest.json @@ -2081,6 +2081,10 @@ { "js": ["plugins/routard.js"], "matches": ["*://*.routard.com/*"] - } + }, + { + "js": ["plugins/podcasts_apple.js"], + "matches": ["*://podcasts.apple.com/*"] + } ] } diff --git a/plugins/podcasts_apple.js b/plugins/podcasts_apple.js new file mode 100644 index 000000000..b15229607 --- /dev/null +++ b/plugins/podcasts_apple.js @@ -0,0 +1,31 @@ +var hoverZoomPlugins = hoverZoomPlugins || []; +hoverZoomPlugins.push( { + name: 'podcasts_apple', + version: '1.0', + prepareImgLinks: function(callback) { + var name = this.name; + + $('button[id*="audio-controls-playback"]').on('mouseover', function() { + const link = $(this); + let data = link.data(); + + if (data.hoverZoomMouseOver) return; + data.hoverZoomMouseOver = true; + + if ($('audio')[0] == undefined) return; + const url = $('audio')[0].src; + + data.hoverZoomSrc = [url]; + callback(link, name); + + // Podcast is played iff the cursor is still over the player + if (link.data().hoverZoomMouseOver) + hoverZoom.displayPicFromElement(link, true); + + }).on('mouseleave', function () { + const link = $(this); + link.data().hoverZoomMouseOver = false; + }); + + } +});