lauriys
lauriys

Reputation: 4792

Abnormally big WebKit notifications

I'm developing a Chrome extension, and I've noticed that Chrome started to do weird things to my notifications.

Exhibit A

I am talking about the huge whitespace thing (notification height should end at the blue bar).

It wasn't like that some time ago, it started to happen somewhere with the new Chrome releases.

Anyways, what could be the cause of this?

Source code of extension is at http://github.com/Maxorq/LastPlug

The most interesting parts would be:

js/notifications.js

$('#title').html(decodeURIComponent($.url().param('title')));
$('#message').html(decodeURIComponent($.url().param('message')));
$('#avatar').attr('src', $.url().param('avatar'));
$('#color').addClass("color_" + $.url().param('color'));

notification.html

<div id="content">
<img id="avatar" width="32" height="32" src="img/icon.png" />
<span id="title">Title</span><br />
<span id="message">Message</span>
</div>

js/background.js

var notification = webkitNotifications.createHTMLNotification('notification.html?title=' + title + '&message=' + message + '&avatar=' + avatar + '&color=' + color);

notification.show();

I'm using jQuery URL Parser from here: https://github.com/allmarkedup/jQuery-URL-Parser

The code is kinda complicated, so I won't paste all of it here; wondering if anyone else had same problem with huge notifications.

Upvotes: 5

Views: 632

Answers (1)

hawkfalcon
hawkfalcon

Reputation: 652

Im not sure if this will work in your case... but whenever I have had a bug with large empty spaces in chrome, adding <!doctype html> tags instead of just <html> fixed the problem. Not sure why, but it did. Hope this helps:)

Upvotes: 3

Related Questions