5

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.

Bergi
  • 630,263
  • 148
  • 957
  • 1,375
lauriys
  • 4,652
  • 7
  • 32
  • 40
  • 1
    Notifications work outside of extensions as well, so if you would be able to get a stand alone case on for example jsfiddle I am fairly sure I will either be able to help or point you to the right people@webkit/chrome for further help (or maybe a simple bug report might be enough to get if fixed, all depends on seeing it for myself). – David Mulder Jul 05 '12 at 23:01
  • Like @DavidMulder said, it's probably just some browser bug. I shows up normal for me. https://dl.dropbox.com/u/79993944/lastplug.JPG – Kerstomaat Jul 08 '12 at 16:59
  • I agree with @DavidMulder Please add to a jsFiddle so we can mess with it & test it ourselves to see if it may just be an old error or even a new browser bug. – gabeio Jul 12 '12 at 11:48

1 Answers1

3

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:)

hawkfalcon
  • 652
  • 1
  • 12
  • 24