Chromium Blog
News and developments from the open source browser project
Building efficient apps and extensions with push messaging
Thursday, May 9, 2013
Event pages keep apps and extensions efficient by allowing them to respond to a variety of events such as timers or navigation to a particular site, without having to remain running persistently. But what if you need to respond to something that occurs outside of Chrome, such as a news alert, a message sent to a user or a stock hitting a price threshold? Until now, you had to do this by repeatedly polling a server. This process consumed bandwidth and reduced the battery life of your users’ machines. For a more efficient solution, starting today you can use
Google Cloud Messaging for Chrome
(GCM) - across all channels of Chrome.
GCM will be familiar to developers who have used
Google Cloud Messaging for Android
. To send a message, all you need to do is:
Request a token (channel ID) via
chrome.pushMessaging.getChannelId()
.
Pass the returned token to your server.
Whenever you need to send a message to your app or extension, post the message along with the token to the GCM server-side API.
Your message is then delivered in near real time to Chrome. This makes your event page wake up (if it’s not already running), and the message is delivered to your
chrome.pushMessaging.onMessage
listener.
To use GCM, your users must be signed into Chrome, as the service relies on an efficient push channel that’s only established for signed-in users. Messages are automatically delivered to all the devices where the user has signed in and installed your app/extension.
To add GCM to your app/extension, take a look at the
overview
of the service or start with some of the
sample apps
—and start pushing!
Posted by Mark Scott, Product Manager
Updates to manifest V1 Chrome Web Store items to be blocked in March
Wednesday, February 6, 2013
Last year, Chrome introduced
manifest V2
to Apps and Extension developers, which brings a variety of security and API improvements such as a default
Content Security Policy
. As of Chrome 18, manifest V1 was officially deprecated. At the time, we published our
manifest version support schedule
to give developers transparency and insight into our plans for migrating to the new version.
Today, we’re announcing a slight update to that schedule, to let developers know that they have until Monday, March 4, 2013 to make updates to their existing manifest V1-based items. After that date, the
Chrome Web Store
will
block all updates
to products based on manifest V1 unless the update includes switching it to manifest V2.
Developers are strongly encouraged to migrate their items to manifest V2 now. Follow the
migration tutorial
, and you can always contact us on the
chromium-apps forum
and
our G+ page
with any questions you may have.
Posted by Joe Marini, Developer Advocate
Build Chrome Packaged Apps with the MediaGalleries API
Tuesday, November 20, 2012
Many popular applications today help users consume, share, manage, and edit media content, as evidenced by the rise of web apps like
Google Play Music
and
YouTube
. For
Chrome packaged app developers
, the new
Media Galleries API
introduces a simple way for apps to access media stored on a user’s device (with the user’s permission, of course).
To use the API, you first have to determine what kind of permission your app needs to access user’s media:
read-only
: allows media content to be read, but not modified
read-write
: allows media content to be read and modified
add-files
: allows media to be added to the galleries but prevents modifying existing media files.
Currently, only read-only access is supported. Support for read-write and add-files will be introduced in a future release.
To retrieve media content, use
getMediaFilesystems()
. If this is the first time your app is accessing the user’s media libraries, the system will prompt the user to grant access:
You can also make your app explicitly ask the user to designate specific galleries. This is useful if, for example, your app is only interested in pictures. Once access is granted, your app can then retrieve a list of
LocalFileSystem
structures. At that point, you can use the
W3C FileSystem API
to access the media gallery content.
NOTE
: The file system APIs will only return files that the Chrome platform
natively supports
, and only the
asynchronous version
of the FileSystem API is currently supported.
We’re eager to see what great applications you will build with the Media Galleries API and the Chrome Packaged Apps platform. To get started, clone our
samples repository
and look at the Media Galleries
sample application
. Have questions or comments? Subscribe to
chromium-apps
and follow us on our
Google+ page
!
Posted by Joe Marini, Developer Advocate
Labels
accessibility
1
benchmarks
1
beta
1
blink
1
chrome apps
3
Chrome Frame
1
chrome web store
26
chromeframe
3
chromeos
3
chromium
3
cloud print
1
dart
8
devtools
11
extensions
23
gdd
1
googlechrome
12
html5
11
incognito
1
javascript
3
linux
2
mac
1
mobile
2
na
1
native client
8
New Features
5
octane
1
open web
2
releases
2
rlz
1
security
30
spdy
2
ssl
2
v8
5
web intents
1
webaudio
3
webgl
7
webkit
5
webp
5
webrtc
4
websockets
5
webtiming
1
Archive
2016
May
Apr
Mar
Feb
Jan
2015
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2014
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2013
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2012
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2011
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2010
Dec
Nov
Oct
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2009
Dec
Nov
Sep
Aug
Jul
Jun
May
Apr
Mar
Feb
Jan
2008
Dec
Nov
Oct
Sep
Feed
Follow @ChromiumDev
Give us feedback in our
Product Forums
.