From b4120e3856e38e3ab166bce21fe7819731016c27 Mon Sep 17 00:00:00 2001 From: Night Date: Sun, 17 Sep 2017 23:37:15 -0700 Subject: [PATCH] beta support for twitch's beta site --- package.json | 2 +- src/index.js | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 68086d9495..35f9fc9d31 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "BetterTTV", "author": "Night", - "version": "7.0.26", + "version": "7.0.27", "description": "BetterTTV enhances Twitch with new features, bug fixes, and reduced clutter.", "main": "betterttv.js", "scripts": { diff --git a/src/index.js b/src/index.js index 8012f3c945..56ade40b01 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,16 @@ (() => { if (!String.prototype.includes || !Array.prototype.findIndex) return; - if (window.location.pathname.endsWith('.html')) return; + if (window.location.pathname.endsWith('.html') || window.location.hostname === 'player.twitch.tv') return; + + if (window.location.hostname === 'go.twitch.tv') { + const script = document.createElement('script'); + script.type = 'text/javascript'; + script.src = 'https://beta.betterttv.net/betterttv.js'; + const head = document.getElementsByTagName('head')[0]; + if (!head) return; + head.appendChild(script); + return; + } const Raven = require('raven-js');