Skip to content

Commit

Permalink
🐛 Fix detection of New YT on home page
Browse files Browse the repository at this point in the history
The elements on the home page are different so we need to detect that
page differently, otherwise we incorrectly fallback to Old YouTube.

Close #8
  • Loading branch information
dideler committed Nov 12, 2017
1 parent 9a0930d commit 13ef54d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,16 @@ const injectorFactory = {
},

_isNewInterface() {
return this._isNewVideoPage() || this._isNewHomePage();
},

_isNewVideoPage() {
return !!document.getElementById('polymer-app');
},

_isNewHomePage() {
return !!document.querySelector('ytd-app');
},
};

const isVideo = () => {
Expand Down

0 comments on commit 13ef54d

Please sign in to comment.