USO can't handle POST requests for style json

This commit is contained in:
tophf 2018-03-13 17:23:47 +03:00
parent 64f18ab901
commit 40054902e9
2 changed files with 10 additions and 2 deletions

View File

@ -13,7 +13,10 @@ window.API_METHODS = Object.assign(window.API_METHODS || {}, {
saveStyle,
deleteStyle,
download: msg => download(msg.url),
download(msg) {
delete msg.method;
return download(msg.url, msg);
},
getPrefs: () => prefs.getAll(),
healthCheck: () => dbExec().then(() => true),

View File

@ -219,7 +219,12 @@
if (url.startsWith('#')) {
resolve(document.getElementById(url.slice(1)).textContent);
} else {
chrome.runtime.sendMessage({method: 'download', url}, result => {
chrome.runtime.sendMessage({
url,
method: 'download',
// USO can't handle POST requests for style json
body: null,
}, result => {
const error = result && result.__ERROR__;
if (error) {
alert('Error' + (error ? '\n' + error : ''));