This API is experimental. It is only available to Chrome users on the
dev channel.
chrome.wallpaper
Description: |
Use the chrome.wallpaper API to change the ChromeOS wallpaper.
|
Availability: |
Dev channel only.
|
Permissions: |
"wallpaper"
|
Manifest
You must declare the "wallpaper" permission in the app
manifest to use the wallpaper API.
For example:
{
"name": "My extension",
...
"permissions": [
"wallpaper"
],
...
}
Examples
For example, to set the wallpaper as the image at
http://example.com/a_file.png
, you can call
chrome.wallpaper.setWallpaper
this way:
chrome.wallpaper.setWallpaper(
{
'url': 'http://example.com/a_file.jpg',
'layout': 'CENTER_CROPPED',
'name': 'test_wallpaper'
}, function() {});
Summary
Methods |
setWallpaper −
chrome.wallpaper.setWallpaper(object details, function callback)
|
Methods
setWallpaper
chrome.wallpaper.setWallpaper(object details, function callback)
Sets wallpaper to the image at url or wallpaperData with the specified layout
Parameters |
object |
details |
binary |
(optional)
wallpaperData |
The jpeg or png encoded wallpaper image.
|
string |
(optional)
url |
The URL of the wallpaper to be set.
|
enum of "STRETCH" , "CENTER" , or "CENTER_CROPPED" |
layout |
The supported wallpaper layouts.
|
string |
name |
The file name of the saved wallpaper.
|
boolean |
(optional)
thumbnail |
True if a 128x60 thumbnail should be generated.
|
|
function |
callback |
The callback parameter should be a function
that looks like this:
function(binary thumbnail) {...};
binary |
(optional)
thumbnail |
The jpeg encoded wallpaper thumbnail. It is generated by resizing the wallpaper to 128x60.
|
|