|
metadata
[Kongregate Night Mode](http://zalbee.intricus.net/kong-nightmode.html) is a script which darkens the game page and background when you’re playing a game. The main difference between this and Cinematic Mode, is that this allows you access to chat, comments, high scores, etc. while in Night Mode.
Browser support: Chrome, Internet Explorer, Firefox (since v6)
I have updated my to work with Kongregate’s new layout. Now both the top and bottom halves of the game page are fully night-modified.

|
|
|
metadata
Change history:
Current version: v7 (Jan 19, 2014). Compatibility with Chat Line Highlighting script.
Older versions:
[K] NightMode v6 (Jan 8, 2014). Fixed Firefox!
[K] NightMode v5 (Jan 8, 2014)
[K] NightMode v4 (Dec 3, 2013). Fix for “newer” layout (gradient background) (Sorry for delay!)
[K] NightMode v3 (Mar 8, 2013). For Kongregate new layout
[K] NightMode v2 (Dec 11, 2012)
[K] NightMode v1 (Dec 4, 2012)
|
|
|
metadata
Are you going to try to make it Firefox compatible?
|
|
|
metadata
> *Originally posted by **[jim\_vierling](/forums/1/topics/328820?page=1#posts-6901628):***
>
> Are you going to try to make it Firefox compatible?
^ this!
|
|
|
metadata
You could make a userscript and inject CSS if you want to make it compatible with Chrome and Firefox. Something like this works on both browsers:
`
// ==UserScript==
// @name Kongregate Dark Pages
// @namespace tag://kongregate
// @description Turns the page dark :O
// @author UnknownGuardian
// @version 1.0.0
// @date 03.09.2013
// @include http://www.kongregate.com/games/*/*
// ==/UserScript==
function main()
{
console.log("init");
function init()
{
var rulesText = "#play.new_gamepage #primarywrap { background-color: #222222;}";
//obviously more rules here.
var head = document.getElementsByTagName('head')[0],
style = document.createElement('style'),
rules = document.createTextNode(rulesText);
style.type = 'text/css';
if(style.styleSheet)
style.styleSheet.cssText = rules.nodeValue;
else style.appendChild(rules);
head.appendChild(style);
}
init();
}
// This injects our script onto the page.
// Borrowed from: http://stackoverflow.com/a/2303228
var script = document.createElement('script');
script.appendChild(document.createTextNode('('+ main +')();'));
(document.body || document.head || document.documentElement).appendChild(script);
`
Chrome:
[](http://i.imgur.com/pSim4op.png)
Firefox:
[](http://i.imgur.com/Oz73tBv.png)
|
|
|
metadata
|
|
|
metadata
I do hope to have it working for Firefox eventually, and most likely that will be a UserScript like what UnknownGuardian posted. It’s something I haven’t done before though and I didn’t want to delay releasing this.
The bookmarklet method is really simple, because it only runs when the user clicks it. The userscript is always enabled, which adds more complexity, like timing. If the script automatically runs, when should it trigger? If too early, it won’t style everything, if too late, people will see a short delay where the page is still bright. Etc.
|
|
|
metadata
|
|
|
metadata
I adapted your code to an user script, I had to add some stuff because some of the styles weren’t being applied. It still needs some adjustements in the chat tab, and maybe some other thing that I missed, but it shouldn’t be much work. 5.13 a.m. over here, so that’s all I can do tonight: [http://pastie.org/6449530](http://pastie.org/6449530)
Tested on FF and Chrome.
**E:** Updated. I think it’s done:
[](http://easycaptures.com/fs/uploaded/570/7346598557.png "Click to enlarge") Install: [http://userscripts.org/scripts/show/161765](http://userscripts.org/scripts/show/161765)
For Chrome simply copy the sauce (the one from the userscript, not the pastie link) and save it as whatever.user.js, then load about:extensions and drag/drop the file in that tab.
Nice job, zAlbee.
|
|
|
metadata
Thanks Senekis, I was secretly hoping someone would convert that, so I wouldn’t have to! ;) Seriously though, nice work. I don’t expect working with the compressed code was pleasant. I can see where the styles are missing, because they are the same places where I took a shortcut to save characters by not writing the full CSS rule (e.g. tags). It’s very minor though.
|
|
|
metadata
I downloaded it, but where do I get it to work? By the way, It also downloads the AOL toolbar and some playbrite thing.
|
|
|
metadata
You must have clicked an advertisement. Unfortunately you may have installed some adware. Do NOT click any “download” banners. There is a light green “Install” button in the top-right corner, that is what you should use.

|
|
|
metadata
OK. I installed Greasemonkey and the userscript, but I have no idea how to proceed from there to activate the night mode?
EDIT: It is working, I just didn’t know that it doesn’t work on the Kongregate homepage. Thanks for the script.
|
|
|
metadata
> *Originally posted by **[zAlbee](/forums/1/topics/328820?page=1#posts-6907228):***
>
> I don’t expect working with the compressed code was pleasant.
It was mostly search and replace, then fixing the issues caused by searching and replacing the wrong things. d:
|
|
|
metadata
Hey all,
After a long break, [Version 4](http://zalbee.intricus.net/kong-nightmode.html) of the bookmarklet for Chrome/IE is now released, and night mode should now be working correctly again. Give it a try!
Starting with this version, I’m maintaining a Git repository to track the changes to this script, and plan to release the (non-minified) source code, which should hopefully make it easier to maintain a second version for Firefox/Greasemonkey. Expect to see this soon.
Edit: Source is now up on [Github](https://github.com/zAlbee/kong-nightmode)
Cheers,
zAlbee
|
|
|
metadata
[Version 5](http://zalbee.intricus.net/kong-nightmode.html) is up. Fixes a bunch of smaller issues.
Changes:
- Fix award tab and publish date/gameplays
- Fix “Recommended Games” bg on hover and the tags inside it.
- Fix “Member Since”/“Location” color in USER INFO tab.
- Make lower High Scores table readable (but bright). Fix “Your Best Score”.
- Fix AWARD tab – high score awarded
|
|
|
metadata
Well played zALbee, but is there anyway to make it active automatically from page to page instead of clicking the bookmarklet every time?
|
|
|
metadata
Big fix: [version 6](http://zalbee.intricus.net/kong-nightmode.html) now works on Firefox! Tested working in Firefox 26, Chrome 32, IE 11. The script should also run slightly faster now. No other changes.
> *Originally posted by **[PetalmaneBaku](/forums/1/topics/328820?page=1#posts-7681470):***
>
> Well played zALbee, but is there anyway to make it active automatically from page to page instead of clicking the bookmarklet every time?
Yes, I would have to convert it to a GreaseMonkey script or Chrome extension, similar to what Senekis did a few months ago. I just haven’t done so yet.
|
|
|
metadata
> Install: [http://userscripts.org/scripts/show/161765](http://userscripts.org/scripts/show/161765)
> For Chrome simply copy the sauce (the one from the userscript, not the pastie link) and save it as whatever.user.js, then load about:extensions and drag/drop the file in that tab.
I did this, and enabled it, but it didn’t make it active when I went to a Kong page?
|
|
|
metadata
[Version 7](http://zalbee.intricus.net/kong-nightmode.html) is out!
- Fix conflict with Chat Line Highlighting script affecting whisper background colours.
- Add green colour for highlighted message (used by Chat Line Highlighting). Fix even whispers.
- Fix “Room Moderator in…”
- Fix “Connecting to chat”
|
|
|
metadata
|
|
|
metadata
Works wonders on my profile page and the new application is WONDERFUL thank you!

|
|
|
metadata
Thanks a lot, it still works wonders even though latest post is 2014 :p
|
|
|
metadata
|