Skip to content

Commit

Permalink
change setTimeout script.onload
Browse files Browse the repository at this point in the history
  • Loading branch information
tilfin committed Jan 10, 2022
1 parent 320732d commit 25825e5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ if (document.body) {
if (!window.AESR_script) {
window.AESR_script = document.createElement('script');
AESR_script.src = chrome.extension.getURL('/js/attach_target.js');
document.body.appendChild(AESR_script);
setTimeout(() => {
AESR_script.onload = () => {
const infoJson = document.getElementById('AESR_info').dataset.content;
cb(JSON.parse(infoJson));
}, 50);
};
document.body.appendChild(AESR_script);
return true;
} else {
const infoJson = document.getElementById('AESR_info').dataset.content;
Expand Down

0 comments on commit 25825e5

Please sign in to comment.