Skip to content

Commit

Permalink
append time string to external import requests to circumvent cache #556
Browse files Browse the repository at this point in the history
  • Loading branch information
ankit committed Aug 3, 2020
1 parent d25395b commit 42e2da9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/background/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ class BackgroundPageStyles {
getImportCss(url: string): Promise<string> {
return new Promise(resolve => {
const xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
// append current time to circumvent cache
const dateTime = new Date().getTime();
xhr.open('GET', `${url}?_=${dateTime}`, true);

xhr.onreadystatechange = () => {
if (xhr.readyState == 4) {
Expand Down

0 comments on commit 42e2da9

Please sign in to comment.