line breaks in Notifications

2,432 views
Skip to first unread message

MonkoftheFunk

unread,
Aug 2, 2010, 1:31:44 PM8/2/10
to Chromium-extensions
Hi,
Are there line breaks in notifications that I can use to tidy up
things?
I've tired </br>, \n, \r

Thanks

Arne Roomann-Kurrik

unread,
Aug 3, 2010, 3:49:47 PM8/3/10
to MonkoftheFunk, Chromium-extensions
Have you tried making an HTML notification?  You should be able to use <br /> then.

~Arne



--
You received this message because you are subscribed to the Google Groups "Chromium-extensions" group.
To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.
For more options, visit this group at http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.


MonkoftheFunk

unread,
Aug 14, 2010, 9:14:10 PM8/14/10
to Chromium-extensions
Im using google extension notifications, still no luck with any line
break code i've used.

On Aug 3, 1:49 pm, Arne Roomann-Kurrik <kur...@chromium.org> wrote:
> Have you tried making an HTML notification?  You should be able to use <br
> /> then.
>
> ~Arne
>
>
>
> On Mon, Aug 2, 2010 at 10:31 AM, MonkoftheFunk <tobias...@gmail.com> wrote:
> > Hi,
> > Are there line breaks in notifications that I can use to tidy up
> > things?
> > I've tired </br>, \n, \r
>
> > Thanks
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@chromium.org<chromium-extensions%2Bunsubscr...@chromium.org>
> > .

Arne Roomann-Kurrik

unread,
Aug 16, 2010, 3:52:43 PM8/16/10
to MonkoftheFunk, Chromium-extensions
There's no such thing as a "google extension notification" - what extensions have access to are web notifications (http://dev.w3.org/2006/webapi/WebNotifications/publish/).

There are two flavors of web notification, one which is only text, and another which displays an HTML page.  The corresponding calls for these in Chrome are:

window.webkitNotifications.createNotification
window
.webkitNotifications.createHTMLNotification

respectively.  You should be able to use <br/> elements in the URL you pass to createHTMLNotification 

Here's an example which creates an HTML notification - http://www.thecssninja.com/demo/web_notifications/notification02.html

~Arne


To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.

MonkoftheFunk

unread,
Aug 16, 2010, 4:04:32 PM8/16/10
to Chromium-extensions
Sorry i thought i was in the google chrome extentions group.
These Desktop Notifications:
http://code.google.com/chrome/extensions/notifications.html
didn't know there were web notifications.

Tobias

On Aug 16, 1:52 pm, Arne Roomann-Kurrik <kur...@chromium.org> wrote:
> There's no such thing as a "google extension notification" - what extensions
> have access to are web notifications (http://dev.w3.org/2006/webapi/WebNotifications/publish/).
>
> There are two flavors of web notification, one which is only text, and
> another which displays an HTML page.  The corresponding calls for these in
> Chrome are:
>
> window.webkitNotifications.createNotification
> window.webkitNotifications.createHTMLNotification
>
> respectively.  You should be able to use <br/> elements in the URL you pass
> to createHTMLNotification
>
> Here's an example which creates an HTML notification -http://www.thecssninja.com/demo/web_notifications/notification02.html
>
> ~Arne
>
>
>
> On Sat, Aug 14, 2010 at 6:14 PM, MonkoftheFunk <tobias...@gmail.com> wrote:
> > Im using google extension notifications, still no luck with any line
> > break code i've used.
>
> > On Aug 3, 1:49 pm, Arne Roomann-Kurrik <kur...@chromium.org> wrote:
> > > Have you tried making an HTML notification?  You should be able to use
> > <br
> > > /> then.
>
> > > ~Arne
>
> > > On Mon, Aug 2, 2010 at 10:31 AM, MonkoftheFunk <tobias...@gmail.com>
> > wrote:
> > > > Hi,
> > > > Are there line breaks in notifications that I can use to tidy up
> > > > things?
> > > > I've tired </br>, \n, \r
>
> > > > Thanks
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Chromium-extensions" group.
> > > > To post to this group, send email to chromium-extensi...@chromium.org.
> > > > To unsubscribe from this group, send email to
> > > > chromium-extensions+unsubscr...@chromium.org<chromium-extensions%2Bunsubscr...@chromium.org>
> > <chromium-extensions%2Bunsubscr...@chromium.org<chromium-extensions%252Bunsubscr...@chromium.org>
>
> > > > .
> > > > For more options, visit this group at
>
> >http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@chromium.org<chromium-extensions%2Bunsubscr...@chromium.org>
> > .
> > For more options, visit this group at
> >http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.- Hide quoted text -
>
> - Show quoted text -

Goodwine

unread,
Aug 17, 2010, 12:13:58 PM8/17/10
to Chromium-extensions
Somewhere in the desktop notifications you can read:
"You create the notification window using a bit of JavaScript and,
optionally, an HTML page packaged inside your extension."

And below, in the API section you will be able to see:
The desktop notification API for extensions is the same one that is
available to normal web pages. As the following code shows, you first
create either a simple text notification or an HTML notification, and
then you show the notification.
----------------------------------------------------------------------------------------------------------------
// Create a simple text notification:
var notification = webkitNotifications.createNotification(
'48.png', // icon url - can be relative
'Hello!', // notification title
'Lorem ipsum...' // notification body text
);

// Or create an HTML notification:
var notification = webkitNotifications.createHTMLNotification(
'notification.html' // html url - can be relative
);

// Then show the notification.
notification.show();
----------------------------------------------------------------------------------------------------------------

I was wondering the same like 2 day ago haha so I had the answer
already ;)
> > >http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl...Hide quoted text -

Arne Roomann-Kurrik

unread,
Aug 17, 2010, 3:02:46 PM8/17/10
to Goodwine, Chromium-extensions
I wound up writing a sample to demonstrate this if anyone is interested:
http://github.com/kurrik/chrome-extensions/tree/master/notifications-html/

Here's a screenshot showing a notification with content split over two lines:
http://github.com/kurrik/chrome-extensions/blob/master/notifications-html/screenshot.png

~Arne


To post to this group, send email to chromium-...@chromium.org.
To unsubscribe from this group, send email to chromium-extens...@chromium.org.

MonkoftheFunk

unread,
Aug 17, 2010, 7:41:52 PM8/17/10
to Chromium-extensions
Thank you so much Arne for your help, wow ha I didnt see the HTML
Notification, thanks again for your patience.
Ha and thanks Goodwine, I'm glad to know that I'm not the only one who
missed that :P ... ha well missed it a few times when Arne tried to
explain it to me :s , ha :D
Tobias
Ps I am really enjoying making google extensions

On Aug 17, 1:02 pm, Arne Roomann-Kurrik <kur...@chromium.org> wrote:
> I wound up writing a sample to demonstrate this if anyone is interested:http://github.com/kurrik/chrome-extensions/tree/master/notifications-...
>
> Here's a screenshot showing a notification with content split over two
> lines:http://github.com/kurrik/chrome-extensions/blob/master/notifications-...
> > > > > <chromium-extensions%2Bunsubscr...@chromium.org<chromium-extensions%252Bunsubscr...@chromium.org>
> > <chromium-extensions%252Bunsubscr...@chromium.org<chromium-extensions%25252Bunsubscr...@chromium.org>
>
> > > > > > > .
> > > > > > > For more options, visit this group at
>
> >http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.
>
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > Groups
> > > > > "Chromium-extensions" group.
> > > > > To post to this group, send email to
> > chromium-extensi...@chromium.org.
> > > > > To unsubscribe from this group, send email to
> > > > > chromium-extensions+unsubscr...@chromium.org<chromium-extensions%2Bunsubscr...@chromium.org>
> > <chromium-extensions%2Bunsubscr...@chromium.org<chromium-extensions%252Bunsubscr...@chromium.org>
>
> > > > > .
> > > > > For more options, visit this group at
>
> >http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl...text -
>
> > > > - Show quoted text -
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Chromium-extensions" group.
> > To post to this group, send email to chromium-extensi...@chromium.org.
> > To unsubscribe from this group, send email to
> > chromium-extensions+unsubscr...@chromium.org<chromium-extensions%2Bunsubscr...@chromium.org>
> > .
> > For more options, visit this group at
> >http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl=en.

Goodwine

unread,
Aug 18, 2010, 11:45:42 AM8/18/10
to Chromium-extensions
I enjoy myself too xD
It will get hell a lot better/easier when HTML5 is finished and
imlpemented ;D
> > >http://groups.google.com/a/chromium.org/group/chromium-extensions/?hl...-
Reply all
Reply to author
Forward
0 new messages