Script Summary: Center aligns Youtube pages. Latest changes: [2013.07.13] Fixed issues with Inbox and Upload pages, and viewing as a guest user. Also, major code overhaul.
On 2012.12.06, Youtube introduced a new layout. Part of the changes include making the entire page left-aligned. If you use a large resolution, you might want to center align the page like it used to be. This is exactly what this script does.
Watch Page Centering
By default, the video watch pages are centered based on the page's contents. However, because the video player comes in various sizes and with optional playlist attachments, you may want to shift the video page slightly to the left or right to make it appear more centered for your particular viewing habits.
(1) Left shifted by 100px
(2) Right shifted by 100px
To shift the video page, set the following:
YC.watchshift = 1; // Left 100px
YC.watchshift = 2; // Left 80px
YC.watchshift = 3; // Left 60px
YC.watchshift = 4; // Left 40px
YC.watchshift = 5; // Left 20px
YC.watchshift = 6; // Centered (default)
YC.watchshift = 7; // Right 20px
YC.watchshift = 8; // Right 40px
YC.watchshift = 9; // Right 60px
YC.watchshift = 10; // Right 80px
YC.watchshift = 11; // Right 100px
Flex-Width Page Resizing
Some Youtube pages dynamically change width after page load (i.e. Channels, Dashboard, Video Manager, Analytics). These pages usually appear wider than normal Youtube pages.
(1) Dynamic sizing (default)
(2) Forced size (homepage width)
The default is Dynamic Sizing, as determined by Youtube's flex-width settings. You can change this to force specific page widths for flex-width pages by setting the following:
YC.flexsize = 1; // Homepage width
YC.flexsize = 2; // Slightly larger
YC.flexsize = 3; // Much larger
YC.flexsize = 4; // Video watch page width
YC.flexsize = 5; // Dynamic sizing (default)
Double Column Viewing
There is an option to widen the feed pages so you see two columns of videos instead of one. This affects the My Subscriptions, Watch Later, Watch History, What to Watch, and Social feeds.
Double Column Option
Double Column is off by default. To change it, set the following:
YC.doublecolumn = true; // Double column on
YC.doublecolumn = false; // Double column off (default)
|Search Results||Small Player|
|Large Player (854px)||Extra Large Player (1280px)|
|New Channel Layout|
|2.8.5||- Improvements to Double Column option.|
|2.8.4||- Default video watch page width set according to browser width instead of 1485px default, to prevent bottom scrollbar from appearing for smaller resolutions.|
|2.8.3||- Support for centering non-standard sized players (e.g. 1280px).|
|2.8.2||- Fix for old subscriptions page: youtube.com/my_subscriptions|
- Major overhaul. See userscripts.org/topics/128153|
- Added double column option.
|2.7.1||- Fix for Inbox, Analytics, and Upload pages.|
|2.7||- Fix for another Youtube change that broke the script.|
|2.6.2||- Playlist fix for small player.|
|2.6||- Fixed issue with Youtube changes to their CSS. Was causing video player to be shifted down/right.|
|2.5.3||- Fixed main page content size issue. userscripts.org/topics/127897|
|2.5.2||- Fix for 2.5 applied to 1280px player. Fixed issue switching between 1280px player and other player sizes.|
- Fix for Youtube changes to guide positioning (now inside page div) and classes (guide-expanded and guide-collapsed).|
- Added @updateURL and @downloadURL to metadata.
|2.4||- Changed the way watch page widths are calculated, due to dynamic player container widths when viewing playlists.|
|2.3.5||- Fix for content width when viewing playlists.|
|2.3.3||- Fix for content width and related videos positioning in response to recent Youtube changes.|
|2.3.2||- Fix for playlist bar when watching videos in a playlist. (Yes, Youtube changed this again.)|
|2.3.1||- Fix for playlist bar when watching videos in a playlist.|
|2.3||- Fix for new video watch page (content after video was being shifted to the left).|
|2.2.5||- Fixed 1280px "extra large" player centering (i.imgur.com/oxE87.png). See userscripts.org/topics/124160|
|2.2.4||- Removed debug messages that were accidentally left in from test versions.|
|2.2.3||- Fix for new Youtube watch page (video player was left-aligned). 2.2.2 was working for Chrome, but not Firefox; 2.2.3 should work for both.|
|2.2.1||- Handle flex-width pages that dynamically change width after page load.|
- Handle new flex-width pages (dashboard, video manager, analytics, etc.)|
- Fix for actions that cause guide to slideout and break video alignment.
|2.1||- Fix for new video watch page (content after video was being shifted to the left).|
|2.0||- Support for new channel layout (see last pic in screenshots).|
|1.9.4||- Fixes for Opera users.|
|1.9||- Updated script for recent Youtube changes to search bar and guide layout.|
- Run at document-start for faster centering as soon as DOM is loaded (except for Opera). |
- This should eliminate seeing the page "move" from left to center after loading, or at least make it less noticeable.
- Check to make sure script doesn't run in iframes (e.g. embedded videos).
- Center playlist bar when watching videos from a playlist.|
- Fixed guide position in largestyle 2 layout.
- Fixed issue with the video player being nudged out of position when the guide is expanded.|
- Added options for centering style of video watch page for finer customization.
- Minor tweaks to alignment of search bar and editing bar.
|1.5||- Center large video player.|
|1.4||- Center search results page.|
|1.3||- Minor tweaks to positioning of popout guide.|
|1.2||- Center the edit/manage navigation bar when viewing your own videos.|
|1.1||- Account for the guide popout.|
|1.0||- Initial release|