sfc-utils 1.4.134 → 1.4.135
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.
|
@@ -4,6 +4,16 @@ const LayoutScript = ({ domain }) => {
|
|
|
4
4
|
let domainString = "";
|
|
5
5
|
// Check if domain is string
|
|
6
6
|
if (domain && typeof domain === "string") {
|
|
7
|
+
// To handle multi-site publishing, we need to set the domain on client
|
|
8
|
+
if (typeof window !== "undefined") {
|
|
9
|
+
// Only save the text between https://www. and .com, ignore all text after that
|
|
10
|
+
try {
|
|
11
|
+
domain = window.location.href.match(/https:\/\/www\.(.*?)\.com/)[1];
|
|
12
|
+
} catch (err) {
|
|
13
|
+
// It's ok
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
// Fallback handling for domain
|
|
7
17
|
domain = domain.replace("https://www.", "").replace(".com", "");
|
|
8
18
|
domainString = `
|
|
9
19
|
var treg = treg || {};
|