USO can't handle POST requests for style json
This commit is contained in:
parent
64f18ab901
commit
40054902e9
|
@ -13,7 +13,10 @@ window.API_METHODS = Object.assign(window.API_METHODS || {}, {
|
||||||
saveStyle,
|
saveStyle,
|
||||||
deleteStyle,
|
deleteStyle,
|
||||||
|
|
||||||
download: msg => download(msg.url),
|
download(msg) {
|
||||||
|
delete msg.method;
|
||||||
|
return download(msg.url, msg);
|
||||||
|
},
|
||||||
getPrefs: () => prefs.getAll(),
|
getPrefs: () => prefs.getAll(),
|
||||||
healthCheck: () => dbExec().then(() => true),
|
healthCheck: () => dbExec().then(() => true),
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,12 @@
|
||||||
if (url.startsWith('#')) {
|
if (url.startsWith('#')) {
|
||||||
resolve(document.getElementById(url.slice(1)).textContent);
|
resolve(document.getElementById(url.slice(1)).textContent);
|
||||||
} else {
|
} 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__;
|
const error = result && result.__ERROR__;
|
||||||
if (error) {
|
if (error) {
|
||||||
alert('Error' + (error ? '\n' + error : ''));
|
alert('Error' + (error ? '\n' + error : ''));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user