Last active
June 27, 2019 19:25
-
-
Save chapterjason/63d2273f3d02a4ad40fd789101f8991d to your computer and use it in GitHub Desktop.
Revisions
-
chapterjason revised this gist
Jun 27, 2019 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // ==UserScript== // @name Automatic channel tab switch // @namespace http://tampermonkey.net/ // @version 0.5 // @description Switches automatically to the videos tab if a channel or user page is requested // @author Jason Schilling <[email protected]> // @updateURL https://gist.github.com/chapterjason/63d2273f3d02a4ad40fd789101f8991d/raw/auto-switch.js @@ -21,11 +21,11 @@ console.info("Automatic tab switch loaded!"); document.addEventListener('yt-navigate-start', function(event){ execute(event.detail.url); return false; }); function execute(url){ const parts = url.split('/').filter(notEmptyFilter); if(parts.length === 2 && (parts[0] === 'user' || parts[0] === 'channel')){ const target = location.href + '/videos'; @@ -34,5 +34,5 @@ } } execute(location.pathname); })(); -
chapterjason revised this gist
Jun 27, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // ==UserScript== // @name Automatic channel tab switch // @namespace http://tampermonkey.net/ // @version 0.4 // @description Switches automatically to the videos tab if a channel or user page is requested // @author Jason Schilling <[email protected]> // @updateURL https://gist.github.com/chapterjason/63d2273f3d02a4ad40fd789101f8991d/raw/auto-switch.js -
chapterjason revised this gist
Jun 27, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,7 @@ // @updateURL https://gist.github.com/chapterjason/63d2273f3d02a4ad40fd789101f8991d/raw/auto-switch.js // @downloadURL https://gist.github.com/chapterjason/63d2273f3d02a4ad40fd789101f8991d/raw/auto-switch.js // @match https://www.youtube.com/* // @run-at document-end // @grant none // ==/UserScript== -
chapterjason revised this gist
Jun 27, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // ==UserScript== // @name Automatic channel tab switch // @namespace http://tampermonkey.net/ // @version 0.3 // @description Switches automatically to the videos tab if a channel or user page is requested // @author Jason Schilling <[email protected]> // @updateURL https://gist.github.com/chapterjason/63d2273f3d02a4ad40fd789101f8991d/raw/auto-switch.js -
chapterjason revised this gist
Jun 27, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,7 @@ // @description Switches automatically to the videos tab if a channel or user page is requested // @author Jason Schilling <[email protected]> // @updateURL https://gist.github.com/chapterjason/63d2273f3d02a4ad40fd789101f8991d/raw/auto-switch.js // @downloadURL https://gist.github.com/chapterjason/63d2273f3d02a4ad40fd789101f8991d/raw/auto-switch.js // @match https://www.youtube.com/* // @grant none // ==/UserScript== -
chapterjason revised this gist
Jun 27, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ // ==UserScript== // @name Automatic channel tab switch // @namespace http://tampermonkey.net/ // @version 0.2 // @description Switches automatically to the videos tab if a channel or user page is requested // @author Jason Schilling <[email protected]> // @updateURL https://gist.github.com/chapterjason/63d2273f3d02a4ad40fd789101f8991d/raw/auto-switch.js -
chapterjason revised this gist
Jun 27, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,7 @@ // @version 0.1 // @description Switches automatically to the videos tab if a channel or user page is requested // @author Jason Schilling <[email protected]> // @updateURL https://gist.github.com/chapterjason/63d2273f3d02a4ad40fd789101f8991d/raw/auto-switch.js // @match https://www.youtube.com/* // @grant none // ==/UserScript== -
chapterjason revised this gist
Jun 27, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ // @namespace http://tampermonkey.net/ // @version 0.1 // @description Switches automatically to the videos tab if a channel or user page is requested // @author Jason Schilling <[email protected]> // @match https://www.youtube.com/* // @grant none // ==/UserScript== -
chapterjason revised this gist
Jun 27, 2019 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,7 +28,6 @@ const target = location.href + '/videos'; location.href = target location.replace(target); } } -
chapterjason created this gist
Jun 27, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,36 @@ // ==UserScript== // @name Automatic channel tab switch // @namespace http://tampermonkey.net/ // @version 0.1 // @description Switches automatically to the videos tab if a channel or user page is requested // @author Jason Schilling // @match https://www.youtube.com/* // @grant none // ==/UserScript== (function() { 'use strict'; function notEmptyFilter(item){ return item.length; } console.info("Automatic tab switch loaded!"); document.addEventListener('yt-navigate-start', function(event){ executeURL(event.detail.url); return false; }); function executeURL(url){ const parts = url.split('/').filter(notEmptyFilter); if(parts.length === 2 && (parts[0] === 'user' || parts[0] === 'channel')){ const target = location.href + '/videos'; location.href = target location.replace(target); } } executeURL(location.pathname); })();