Skip to content

Commit 680139e

Browse files
committed
Fix xhr
1 parent 6d7a2b3 commit 680139e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

AutoPatchWork.safariextension/js/background.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -385,16 +385,20 @@ function get_manifest(callback) {
385385
function init_css() {
386386
var url = 'css/AutoPatchWork.css';
387387
var xhr = new XMLHttpRequest();
388-
xhr.open('GET', url, false);
388+
xhr.open('GET', url, true);
389+
xhr.onload = function() {
390+
AutoPatchWork.save_css(xhr.responseText);
391+
};
389392
xhr.send(null);
390-
AutoPatchWork.save_css(xhr.responseText);
391393
}
392394
function init_barcss() {
393395
var url = 'css/AutoPatchWork.bar.css';
394396
var xhr = new XMLHttpRequest();
395-
xhr.open('GET', url, false);
397+
xhr.open('GET', url, true);
398+
xhr.onload = function() {
399+
AutoPatchWork.barcss = xhr.responseText;
400+
};
396401
xhr.send(null);
397-
AutoPatchWork.barcss = xhr.responseText;
398402
}
399403
function UpdateSiteinfo(callback, error_back, force) {
400404
var sso = 'http://os0x.heteml.jp/ss-onet/json/wedataAutoPagerizeSITEINFO.json';

0 commit comments

Comments
 (0)