Last active
June 27, 2016 09:12
-
-
Save qgustavor/14737d413a6d24dbeb0a4424bf2464cc to your computer and use it in GitHub Desktop.
Restore extra column which got removed in the last Google Keep update
This file contains 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 characters
// ==UserScript== | |
// @name Fix Google Keep columns | |
// @namespace üsersçrìpts@blio.tk | |
// @include https://keep.google.com/* | |
// @version 1.2 | |
// @grant none | |
// @run-at document-start | |
// ==/UserScript== | |
var originalGetter = Object.getOwnPropertyDescriptor(Element.prototype, 'clientWidth').get; | |
Object.defineProperty(document.documentElement, 'clientWidth', { | |
configurable: true, | |
enumerable: true, | |
get: function (){ | |
// 256 is the space for the extra collumn | |
// which got removed in last update | |
return originalGetter.call(document.documentElement) + ( | |
// Only add the extra space if the function which called | |
// was the one which handles columns (may break on update): | |
Error().stack.indexOf('prototype.init') === -1 ? 0 : 256 | |
); | |
} | |
}); |
I was looking for this. Thanks !
There seems to be a glitch:
when loading keep.google.com, it gets 4 columns.
Then if I adjust the width of the browser,
starting from a narrow width, and growing,
the number of columns is :
1,
then 2,
then 3, (so far so good)
then back to 2 (for a long way) (seems like a bug),
then back to 3 columns,
and it never reaches 4 columns even at full width (seems like a bug)
(I installed it together with your hide-google-keep-sidebar.user.js)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"This user script breaks the centering of popup notes.": Fixed in 1.2