chrome.wallpaper
| Description: |
Use the chrome.wallpaper API to change the ChromeOS wallpaper.
|
| Availability: |
Since Chrome 43.
|
| Permissions: |
"wallpaper"
|
Important: This API works only on Chrome OS.
Manifest
You must declare the "wallpaper" permission in the app's 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',
'filename': 'test_wallpaper'
}, function() {});
Summary
| Types | |
|---|---|
| WallpaperLayout | |
| Methods | |
setWallpaper −
chrome.wallpaper.setWallpaper(object details, function callback)
| |
Types
WallpaperLayout
| Enum |
|---|
"STRETCH",
"CENTER",
or "CENTER_CROPPED"
|
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 |
|
|||||||||||||||
| function | callback |
The callback parameter should be a function that looks like this: function(binary thumbnail) {...};
|
|||||||||||||||