@stemy/ngx-utils 19.5.23 → 19.5.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1931,24 +1931,30 @@ class LoaderUtils {
|
|
|
1931
1931
|
static { this.promises = {}; }
|
|
1932
1932
|
static loadScript(src, async = false, type = "text/javascript", parent) {
|
|
1933
1933
|
return LoaderUtils.loadElement(src, parent, () => {
|
|
1934
|
-
const time = new Date().getTime();
|
|
1935
1934
|
const script = document.createElement("script");
|
|
1936
1935
|
script.type = type;
|
|
1937
|
-
script.src = src
|
|
1936
|
+
script.src = LoaderUtils.updateSrc(src);
|
|
1938
1937
|
script.async = async;
|
|
1939
1938
|
return script;
|
|
1940
1939
|
});
|
|
1941
1940
|
}
|
|
1942
1941
|
static loadStyle(src, parent) {
|
|
1943
1942
|
return LoaderUtils.loadElement(src, parent, () => {
|
|
1944
|
-
const time = new Date().getTime();
|
|
1945
1943
|
const link = document.createElement("link");
|
|
1946
1944
|
link.rel = "stylesheet";
|
|
1947
1945
|
link.type = "text/css";
|
|
1948
|
-
link.href = src
|
|
1946
|
+
link.href = LoaderUtils.updateSrc(src);
|
|
1949
1947
|
return link;
|
|
1950
1948
|
});
|
|
1951
1949
|
}
|
|
1950
|
+
static updateSrc(src) {
|
|
1951
|
+
if (src?.startsWith("data:")) {
|
|
1952
|
+
return src;
|
|
1953
|
+
}
|
|
1954
|
+
const url = new URL(src);
|
|
1955
|
+
url.searchParams.set("time", String(Date.now()));
|
|
1956
|
+
return url.toString();
|
|
1957
|
+
}
|
|
1952
1958
|
static loadElement(src, parent, setup) {
|
|
1953
1959
|
const promises = LoaderUtils.promises;
|
|
1954
1960
|
parent = parent || document;
|