Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Restore extra column which got removed in the last Google Keep update
// ==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
);
}
});
@qgustavor

This comment has been minimized.

Copy link
Owner Author

commented Jun 1, 2016

By the way the update was too sudden that I don't remember if it removed one or two columns. It adds space for just one column as seems two don't fit with the sidebar opened.

@OsakaWebbie

This comment has been minimized.

Copy link

commented Jun 3, 2016

It mystifies me that Keep doesn't just use the entire window area when the menu is hidden, but they didn't ask my opinion...

This is probably a dumb question, but how do I get my browser to include your little script? I normally use Firefox, if that matters.

@qgustavor

This comment has been minimized.

Copy link
Owner Author

commented Jun 4, 2016

@OsakaWebbie You can use Greasemonkey.

@OsakaWebbie

This comment has been minimized.

Copy link

commented Jun 4, 2016

Thanks, that worked. Now I'd like to ask about the other thing that you did for someone on Reddit: A command to hide the menu on Keep startup. It looks like you shared such code as a comment and then deleted it. I think it would be a good companion to the gist here.

@qgustavor

This comment has been minimized.

Copy link
Owner Author

commented Jun 7, 2016

This user script breaks the centering of popup notes. I thought Google would fix this issue before I posted it, but seems they still not fixed this. For me it's better having out of center notes than losing that extra column.

@OsakaWebbie Many of my gists are public, that one is published here.

@qgustavor

This comment has been minimized.

Copy link
Owner Author

commented Jun 14, 2016

"This user script breaks the centering of popup notes.": Fixed in 1.2

@oluc

This comment has been minimized.

Copy link

commented Jun 27, 2016

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
You can’t perform that action at this time.