chrome.wallpaper.setWallpaper not working
chrome.wallpaper.setWallpaper not working
我还在学习chrome扩展/应用程序,我有这个问题与chrome。壁纸的api。我想把背景换成另一个,但是不行。是的,我正在运行chrome os版本43。
这是我的代码:
chrome.runtime.onStartup.addListener(function() {
chrome.wallpaper.setWallpaper({
"url": "file:///home/chronos/u-f083140cd056ce74510f1290350a468fee3a9377/Downloads/1080bokeh.jpg",
"layout": "CENTER_CROPPED",
"filename": "1080bokeh"
}, function() {});
});
我已经检查了文件位置是否存在。
在控制台上,我得到这个:
Unchecked runtime.lastError while running wallpaper.setWallpaper: Downloading wallpaper 1080bokeh.jpg failed. The response code is -1.
at chrome-extension://jiojpobpcbdplpiiallkhpehcdohgfij/background.js:17:20
有人能指出我做错了什么吗? 我很确定你不允许在Chrome扩展中指向file://
url。尝试将图像放在扩展的文件夹中,并相对于扩展的根目录引用它。
相关文章:
- $rootScope not working
- jQuery document.ready not working
- Javascript getElementsByTagName not working?
- JQuery.val( ) not working
- Tomcat websocket is not working
- Javascript JSON.parse not working
- NodeJS Multer is not working
- Regex not working
- Ember run.debounce not working
- AngularJs 1 not working
- document.getElementById.style.backgroundImage not working
- Rxjs5, distinct() is not working
- createOscillator noteOn not working
- Javascript - .getHours() not working
- Javascript setTimeout not working | onkeydown
- MongoDB $pull not working
- Express router.use not working
- JSONP not working
- window.opener not working in chrome & IE
- Backbone + RequireJS: Collection.each() is not working