From 2818103c7d60aded352511fb3782de1f9d1732d5 Mon Sep 17 00:00:00 2001 From: mariusi7 Date: Tue, 8 Aug 2017 18:07:25 +0300 Subject: [PATCH] Update inject.js (#252) * Special case hbogo.* inject (same as Amazon) Closes: https://github.com/igrigorik/videospeed/issues/199 --- inject.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/inject.js b/inject.js index 8dd1323..80b0a8e 100644 --- a/inject.js +++ b/inject.js @@ -149,13 +149,14 @@ chrome.extension.sendMessage({}, function(response) { this.video.classList.add('vsc-initialized'); this.video.dataset['vscid'] = this.id; - switch (location.hostname) { - case 'www.amazon.com': + switch (true) { + case (location.hostname == 'www.amazon.com'): + case (/www\.hbogo\./).test(location.hostname): // insert before parent to bypass overlay this.parent.parentElement.insertBefore(fragment, this.parent); break; - case 'www.facebook.com': + case (location.hostname == 'www.facebook.com'): // set stacking context to same as parent's parent. // + default fallthrough this.parent.style.zIndex = 'auto';