macro-parameters 0.0.1 → 0.0.2
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.
- package/bundle.js +176 -0
- package/package.json +9 -4
- package/rollup.config.ts +13 -0
- package/script/utils.js +16 -0
- package/src/main.ts +167 -0
- package/tsconfig.json +5 -0
- package/index.js +0 -129
package/bundle.js
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
function getCookie(name) {
|
|
2
|
+
const reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
|
|
3
|
+
let arr;
|
|
4
|
+
let source =
|
|
5
|
+
document.cookie ||
|
|
6
|
+
(window.localStorage && window.localStorage.cookie) ||
|
|
7
|
+
"";
|
|
8
|
+
return (arr = source.match(reg)) ? unescape(arr[2]) : "";
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function getLocalStorage(name) {
|
|
12
|
+
if (typeof localStorage === "object") {
|
|
13
|
+
return localStorage.getItem(name)
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
var PlaceHolders = {
|
|
19
|
+
"[tv_domain]": function () {
|
|
20
|
+
return document.domain;
|
|
21
|
+
},
|
|
22
|
+
"[app_name]": function () {
|
|
23
|
+
return window.externalMacroParam && window.externalMacroParam.app_name;
|
|
24
|
+
},
|
|
25
|
+
"[bundle_id]": function () {
|
|
26
|
+
return window.externalMacroParam && window.externalMacroParam.bundle_id;
|
|
27
|
+
},
|
|
28
|
+
"[app_store_url]": function () {
|
|
29
|
+
return window.externalMacroParam && window.externalMacroParam.app_store_url;
|
|
30
|
+
},
|
|
31
|
+
"[src_page_url]": function () {
|
|
32
|
+
return encodeURIComponent(getLocationOrigin());
|
|
33
|
+
},
|
|
34
|
+
"[player_height]": function () {
|
|
35
|
+
return window.externalMacroParam && window.externalMacroParam.player_height;
|
|
36
|
+
},
|
|
37
|
+
"[player_width]": function () {
|
|
38
|
+
return window.externalMacroParam && window.externalMacroParam.player_width;
|
|
39
|
+
},
|
|
40
|
+
"[channel_no]": function () {
|
|
41
|
+
return window.externalMacroParam && window.externalMacroParam.channel_no;
|
|
42
|
+
},
|
|
43
|
+
"[channel_category]": function () {
|
|
44
|
+
return window.externalMacroParam && window.externalMacroParam.channel_category;
|
|
45
|
+
},
|
|
46
|
+
"[whale_ad_id]": function () {
|
|
47
|
+
// return WhaleADID;
|
|
48
|
+
},
|
|
49
|
+
"[relevant_ads]": function () {
|
|
50
|
+
// if (isWhaleOSGlobal) {
|
|
51
|
+
// return "true"
|
|
52
|
+
// }
|
|
53
|
+
// var reladvertStatus = false;
|
|
54
|
+
// var userAgent = navigator.userAgent.toUpperCase();
|
|
55
|
+
// if (userAgent.indexOf("AOC") > -1) {
|
|
56
|
+
// reladvertStatus = getCookie("relAdvert");
|
|
57
|
+
// } else {
|
|
58
|
+
// reladvertStatus = getCookie("relAdvert");
|
|
59
|
+
// }
|
|
60
|
+
// reladvertStatus = reladvertStatus == null ? false : reladvertStatus;
|
|
61
|
+
// return reladvertStatus;
|
|
62
|
+
},
|
|
63
|
+
"[device_dnt]": function () {
|
|
64
|
+
return (window.externalMacroParam && window.externalMacroParam.device_dnt) || (getCookie("relAdvert") == 'true' ? 0 : 1);
|
|
65
|
+
},
|
|
66
|
+
"[tv_brand]": function () {
|
|
67
|
+
//return getTvBrand();
|
|
68
|
+
},
|
|
69
|
+
"[cntry]": function () {
|
|
70
|
+
//return countryGlobal;
|
|
71
|
+
},
|
|
72
|
+
"[geo_ip_country]": function () {
|
|
73
|
+
//return geoIpCountryGlobal;
|
|
74
|
+
},
|
|
75
|
+
"[platform_id]": function () {
|
|
76
|
+
//return getProfileId();
|
|
77
|
+
},
|
|
78
|
+
"[device_user_agent]": function () {
|
|
79
|
+
var UA = navigator.userAgent;
|
|
80
|
+
return encodeURIComponent(UA);
|
|
81
|
+
},
|
|
82
|
+
"[device_ip_address]": function () {
|
|
83
|
+
return window.externalMacroParam && window.externalMacroParam.device_ip_address;
|
|
84
|
+
},
|
|
85
|
+
"[menu_language]": function () {
|
|
86
|
+
// if (langGlobal) {
|
|
87
|
+
// return (langGlobal.length > 2) ? langGlobal.slice(0, 2) : langGlobal;
|
|
88
|
+
// } else {
|
|
89
|
+
// return 'un';
|
|
90
|
+
// }
|
|
91
|
+
},
|
|
92
|
+
"[privacy_policy]": function () {
|
|
93
|
+
return window.externalMacroParam && window.externalMacroParam.privacy_policy;
|
|
94
|
+
},
|
|
95
|
+
"[whale_gdpr]": function () {
|
|
96
|
+
return window.externalMacroParam && window.externalMacroParam.whale_gdpr || (getCookie("relAdvert") == 'true' ? 1 : 0);
|
|
97
|
+
},
|
|
98
|
+
"[whale_gdpr_consent]": function () {
|
|
99
|
+
return getCookie("tcString") || getLocalStorage('default_tcString');
|
|
100
|
+
},
|
|
101
|
+
"[rnd]": function () {
|
|
102
|
+
return new Date().getTime();
|
|
103
|
+
},
|
|
104
|
+
"[ad_sdk_ver]": function () {
|
|
105
|
+
// return ZeasnADVersion;
|
|
106
|
+
},
|
|
107
|
+
"[time_zone]": function () {
|
|
108
|
+
return new Date().getTimezoneOffset();
|
|
109
|
+
},
|
|
110
|
+
"[google_pal]": function () {
|
|
111
|
+
// if (!(window as any).googleNonce && getCookie("googleNonce")) {
|
|
112
|
+
// return getCookie("googleNonce");
|
|
113
|
+
// }
|
|
114
|
+
// if ((window as any).googleNonce) {
|
|
115
|
+
// setCookie("googleNonce", (window as any).googleNonce, new Date(new Date().getTime() + 6 * 60 * 60 * 1000));
|
|
116
|
+
// }
|
|
117
|
+
// return (window as any).googleNonce || '';
|
|
118
|
+
return "1";
|
|
119
|
+
},
|
|
120
|
+
"[device_lmt]": function () {
|
|
121
|
+
return getCookie("relAdvert") === 'true' ? 0 : 1;
|
|
122
|
+
},
|
|
123
|
+
"[avod_id]": function () {
|
|
124
|
+
return "";
|
|
125
|
+
},
|
|
126
|
+
"[avod_title]": function () {
|
|
127
|
+
return "";
|
|
128
|
+
},
|
|
129
|
+
"[device_id]": function () {
|
|
130
|
+
return getCookie("deviceid") || getCookie("deviceId");
|
|
131
|
+
},
|
|
132
|
+
"[session_id]": function () {
|
|
133
|
+
return window.session_id;
|
|
134
|
+
},
|
|
135
|
+
"[usertag]": function () {
|
|
136
|
+
return getCookie("usertag");
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
function getLocationOrigin() {
|
|
140
|
+
return (location.origin ||
|
|
141
|
+
"".concat(location.protocol, "//").concat(location.host || location.hostname).concat(location.port));
|
|
142
|
+
}
|
|
143
|
+
function cleanPlaceholder(str) {
|
|
144
|
+
for (var k in PlaceHolders) {
|
|
145
|
+
var param = k.replace('[', '\\[').replace(']', '\\]');
|
|
146
|
+
str = str.replace(new RegExp(param, 'g'), PlaceHolders[k]() || "");
|
|
147
|
+
}
|
|
148
|
+
return replaceEmpty(str);
|
|
149
|
+
}
|
|
150
|
+
function replaceEmpty(content) {
|
|
151
|
+
var reg = /\[.*?\]/g;
|
|
152
|
+
return content.replace(reg, "");
|
|
153
|
+
}
|
|
154
|
+
var MacroSubstitution = /** @class */ (function () {
|
|
155
|
+
function MacroSubstitution() {
|
|
156
|
+
}
|
|
157
|
+
MacroSubstitution.prototype.set = function (params) {
|
|
158
|
+
if (!params) {
|
|
159
|
+
console.log("Invalid settings");
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
for (var key in params) {
|
|
163
|
+
if (params.hasOwnProperty(key)) {
|
|
164
|
+
console.log(key + ": " + params[key]);
|
|
165
|
+
this[key] = params[key];
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
MacroSubstitution.prototype.handle = function (str) {
|
|
170
|
+
console.log(cleanPlaceholder(str));
|
|
171
|
+
return cleanPlaceholder(str);
|
|
172
|
+
};
|
|
173
|
+
return MacroSubstitution;
|
|
174
|
+
}());
|
|
175
|
+
|
|
176
|
+
export { MacroSubstitution as default };
|
package/package.json
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "macro-parameters",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Provide unified macro parameter retrieval",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "src/main.ts",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"test": "
|
|
7
|
+
"test": "rollup --config rollup.config.ts --configPlugin typescript2"
|
|
8
8
|
},
|
|
9
9
|
"author": "caiyuanjia",
|
|
10
|
-
"license": "ISC"
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"rollup": "^4.21.1",
|
|
13
|
+
"rollup-plugin-typescript2": "^0.36.0",
|
|
14
|
+
"typescript": "^5.5.4"
|
|
15
|
+
}
|
|
11
16
|
}
|
package/rollup.config.ts
ADDED
package/script/utils.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export function getCookie(name) {
|
|
2
|
+
const reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
|
|
3
|
+
let arr;
|
|
4
|
+
let source =
|
|
5
|
+
document.cookie ||
|
|
6
|
+
(window.localStorage && window.localStorage.cookie) ||
|
|
7
|
+
"";
|
|
8
|
+
return (arr = source.match(reg)) ? unescape(arr[2]) : "";
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function getLocalStorage(name) {
|
|
12
|
+
if (typeof localStorage === "object") {
|
|
13
|
+
return localStorage.getItem(name)
|
|
14
|
+
}
|
|
15
|
+
return null;
|
|
16
|
+
}
|
package/src/main.ts
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { getCookie, getLocalStorage } from "../script/utils"
|
|
2
|
+
const PlaceHolders: any = {
|
|
3
|
+
"[tv_domain]"() {
|
|
4
|
+
return document.domain
|
|
5
|
+
},
|
|
6
|
+
"[app_name]"() {
|
|
7
|
+
return (window as any).externalMacroParam && (window as any).externalMacroParam.app_name;
|
|
8
|
+
},
|
|
9
|
+
"[bundle_id]"() {
|
|
10
|
+
return (window as any).externalMacroParam && (window as any).externalMacroParam.bundle_id;
|
|
11
|
+
},
|
|
12
|
+
"[app_store_url]"() {
|
|
13
|
+
return (window as any).externalMacroParam && (window as any).externalMacroParam.app_store_url;
|
|
14
|
+
},
|
|
15
|
+
"[src_page_url]"() {
|
|
16
|
+
return encodeURIComponent(getLocationOrigin());
|
|
17
|
+
},
|
|
18
|
+
"[player_height]"() {
|
|
19
|
+
return (window as any).externalMacroParam && (window as any).externalMacroParam.player_height;
|
|
20
|
+
},
|
|
21
|
+
"[player_width]"() {
|
|
22
|
+
return (window as any).externalMacroParam && (window as any).externalMacroParam.player_width;
|
|
23
|
+
},
|
|
24
|
+
"[channel_no]"() {
|
|
25
|
+
return (window as any).externalMacroParam && (window as any).externalMacroParam.channel_no;
|
|
26
|
+
},
|
|
27
|
+
"[channel_category]"() {
|
|
28
|
+
return (window as any).externalMacroParam && (window as any).externalMacroParam.channel_category;
|
|
29
|
+
},
|
|
30
|
+
"[whale_ad_id]"() {
|
|
31
|
+
// return WhaleADID;
|
|
32
|
+
},
|
|
33
|
+
"[relevant_ads]"() {
|
|
34
|
+
// if (isWhaleOSGlobal) {
|
|
35
|
+
// return "true"
|
|
36
|
+
// }
|
|
37
|
+
// var reladvertStatus = false;
|
|
38
|
+
// var userAgent = navigator.userAgent.toUpperCase();
|
|
39
|
+
// if (userAgent.indexOf("AOC") > -1) {
|
|
40
|
+
// reladvertStatus = getCookie("relAdvert");
|
|
41
|
+
// } else {
|
|
42
|
+
// reladvertStatus = getCookie("relAdvert");
|
|
43
|
+
// }
|
|
44
|
+
|
|
45
|
+
// reladvertStatus = reladvertStatus == null ? false : reladvertStatus;
|
|
46
|
+
// return reladvertStatus;
|
|
47
|
+
},
|
|
48
|
+
"[device_dnt]"() {
|
|
49
|
+
return ((window as any).externalMacroParam && (window as any).externalMacroParam.device_dnt) || (getCookie("relAdvert") == 'true' ? 0 : 1);
|
|
50
|
+
},
|
|
51
|
+
"[tv_brand]"() {
|
|
52
|
+
//return getTvBrand();
|
|
53
|
+
},
|
|
54
|
+
"[cntry]"() {
|
|
55
|
+
//return countryGlobal;
|
|
56
|
+
},
|
|
57
|
+
"[geo_ip_country]"() {
|
|
58
|
+
//return geoIpCountryGlobal;
|
|
59
|
+
},
|
|
60
|
+
"[platform_id]"() {
|
|
61
|
+
//return getProfileId();
|
|
62
|
+
},
|
|
63
|
+
"[device_user_agent]"() {
|
|
64
|
+
const UA = navigator.userAgent;
|
|
65
|
+
return encodeURIComponent(UA);
|
|
66
|
+
},
|
|
67
|
+
"[device_ip_address]"() {
|
|
68
|
+
return (window as any).externalMacroParam && (window as any).externalMacroParam.device_ip_address;
|
|
69
|
+
},
|
|
70
|
+
"[menu_language]"() {
|
|
71
|
+
// if (langGlobal) {
|
|
72
|
+
// return (langGlobal.length > 2) ? langGlobal.slice(0, 2) : langGlobal;
|
|
73
|
+
// } else {
|
|
74
|
+
// return 'un';
|
|
75
|
+
// }
|
|
76
|
+
},
|
|
77
|
+
"[privacy_policy]"() {
|
|
78
|
+
return (window as any).externalMacroParam && (window as any).externalMacroParam.privacy_policy;
|
|
79
|
+
},
|
|
80
|
+
"[whale_gdpr]"() {
|
|
81
|
+
return (window as any).externalMacroParam && (window as any).externalMacroParam.whale_gdpr || (getCookie("relAdvert") == 'true' ? 1 : 0);
|
|
82
|
+
},
|
|
83
|
+
"[whale_gdpr_consent]"() {
|
|
84
|
+
return getCookie("tcString") || getLocalStorage('default_tcString');
|
|
85
|
+
},
|
|
86
|
+
"[rnd]"() {
|
|
87
|
+
return new Date().getTime();
|
|
88
|
+
},
|
|
89
|
+
"[ad_sdk_ver]"() {
|
|
90
|
+
// return ZeasnADVersion;
|
|
91
|
+
},
|
|
92
|
+
"[time_zone]"() {
|
|
93
|
+
return new Date().getTimezoneOffset();
|
|
94
|
+
},
|
|
95
|
+
"[google_pal]"() {
|
|
96
|
+
// if (!(window as any).googleNonce && getCookie("googleNonce")) {
|
|
97
|
+
// return getCookie("googleNonce");
|
|
98
|
+
// }
|
|
99
|
+
// if ((window as any).googleNonce) {
|
|
100
|
+
// setCookie("googleNonce", (window as any).googleNonce, new Date(new Date().getTime() + 6 * 60 * 60 * 1000));
|
|
101
|
+
// }
|
|
102
|
+
// return (window as any).googleNonce || '';
|
|
103
|
+
return "1";
|
|
104
|
+
},
|
|
105
|
+
"[device_lmt]"() {
|
|
106
|
+
return getCookie("relAdvert") === 'true' ? 0 : 1
|
|
107
|
+
},
|
|
108
|
+
"[avod_id]"() {
|
|
109
|
+
return ""
|
|
110
|
+
},
|
|
111
|
+
"[avod_title]"() {
|
|
112
|
+
return ""
|
|
113
|
+
},
|
|
114
|
+
"[device_id]"() {
|
|
115
|
+
return getCookie("deviceid") || getCookie("deviceId")
|
|
116
|
+
},
|
|
117
|
+
"[session_id]"() {
|
|
118
|
+
return (window as any).session_id;
|
|
119
|
+
},
|
|
120
|
+
"[usertag]"() {
|
|
121
|
+
return getCookie("usertag")
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
function getLocationOrigin() {
|
|
125
|
+
return (
|
|
126
|
+
location.origin ||
|
|
127
|
+
`${location.protocol}//${location.host || location.hostname}${location.port
|
|
128
|
+
}`
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
function cleanPlaceholder(str: string) {
|
|
132
|
+
for (let k in PlaceHolders) {
|
|
133
|
+
let param = k.replace('[', '\\[').replace(']', '\\]');
|
|
134
|
+
str = str.replace(new RegExp(param, 'g'), PlaceHolders[k]() || "");
|
|
135
|
+
}
|
|
136
|
+
return replaceEmpty(str);
|
|
137
|
+
}
|
|
138
|
+
function replaceEmpty(content: string) {
|
|
139
|
+
const reg = /\[.*?\]/g;
|
|
140
|
+
return content.replace(reg, "")
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
class MacroSubstitution {
|
|
144
|
+
constructor() {
|
|
145
|
+
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
set(params: object) {
|
|
149
|
+
if (!params) {
|
|
150
|
+
console.log("Invalid settings");
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
for (let key in params) {
|
|
154
|
+
if (params.hasOwnProperty(key)) {
|
|
155
|
+
console.log(key + ": " + params[key]);
|
|
156
|
+
this[key] = params[key];
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
handle(str: string) {
|
|
162
|
+
console.log(cleanPlaceholder(str));
|
|
163
|
+
return cleanPlaceholder(str)
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
}
|
|
167
|
+
export default MacroSubstitution;
|
package/tsconfig.json
ADDED
package/index.js
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
const PlaceHolders = {
|
|
2
|
-
"[tv_domain]"() {
|
|
3
|
-
return document.domain
|
|
4
|
-
},
|
|
5
|
-
"[app_name]"() {
|
|
6
|
-
return window.externalMacroParam.app_name;
|
|
7
|
-
},
|
|
8
|
-
"[bundle_id]"() {
|
|
9
|
-
return window.externalMacroParam.bundle_id;
|
|
10
|
-
},
|
|
11
|
-
"[app_store_url]"() {
|
|
12
|
-
return window.externalMacroParam.app_store_url;
|
|
13
|
-
},
|
|
14
|
-
"[src_page_url]"() {
|
|
15
|
-
return encodeURIComponent(getLocationOrigin());
|
|
16
|
-
},
|
|
17
|
-
"[player_height]"() {
|
|
18
|
-
return window.externalMacroParam.player_height;
|
|
19
|
-
},
|
|
20
|
-
"[player_width]"() {
|
|
21
|
-
return window.externalMacroParam.player_width;
|
|
22
|
-
},
|
|
23
|
-
"[channel_no]"() {
|
|
24
|
-
return window.externalMacroParam.channel_no;
|
|
25
|
-
},
|
|
26
|
-
"[channel_category]"() {
|
|
27
|
-
return window.externalMacroParam.channel_category;
|
|
28
|
-
},
|
|
29
|
-
"[whale_ad_id]"() {
|
|
30
|
-
return WhaleADID;
|
|
31
|
-
},
|
|
32
|
-
"[relevant_ads]"() {
|
|
33
|
-
if (isWhaleOSGlobal) {
|
|
34
|
-
return "true"
|
|
35
|
-
}
|
|
36
|
-
var reladvertStatus = false;
|
|
37
|
-
var userAgent = navigator.userAgent.toUpperCase();
|
|
38
|
-
if (userAgent.indexOf("AOC") > -1) {
|
|
39
|
-
reladvertStatus = getCookie("relAdvert");
|
|
40
|
-
} else {
|
|
41
|
-
reladvertStatus = getCookie("relAdvert");
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
reladvertStatus = reladvertStatus == null ? false : reladvertStatus;
|
|
45
|
-
return reladvertStatus;
|
|
46
|
-
},
|
|
47
|
-
"[device_dnt]"() {
|
|
48
|
-
return window.externalMacroParam.device_dnt || (getCookie("relAdvert") == 'true' ? 0 : 1);
|
|
49
|
-
},
|
|
50
|
-
"[tv_brand]"() {
|
|
51
|
-
return getTvBrand();
|
|
52
|
-
},
|
|
53
|
-
"[cntry]"() {
|
|
54
|
-
return countryGlobal;
|
|
55
|
-
},
|
|
56
|
-
"[geo_ip_country]"() {
|
|
57
|
-
return geoIpCountryGlobal;
|
|
58
|
-
},
|
|
59
|
-
"[platform_id]"() {
|
|
60
|
-
return getProfileId();
|
|
61
|
-
},
|
|
62
|
-
"[device_user_agent]"() {
|
|
63
|
-
return encodeURIComponent(UA);
|
|
64
|
-
},
|
|
65
|
-
"[device_ip_address]"() {
|
|
66
|
-
return window.externalMacroParam.device_ip_address;
|
|
67
|
-
},
|
|
68
|
-
"[menu_language]"() {
|
|
69
|
-
if (langGlobal) {
|
|
70
|
-
return (langGlobal.length > 2) ? langGlobal.slice(0, 2) : langGlobal;
|
|
71
|
-
} else {
|
|
72
|
-
return 'un';
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
"[privacy_policy]"() {
|
|
76
|
-
return window.externalMacroParam.privacy_policy;
|
|
77
|
-
},
|
|
78
|
-
"[whale_gdpr]"() {
|
|
79
|
-
return window.externalMacroParam.whale_gdpr || (getCookie("relAdvert") == 'true' ? 1 : 0);
|
|
80
|
-
},
|
|
81
|
-
"[whale_gdpr_consent]"() {
|
|
82
|
-
return getCookie("tcString") || getLocalStorage('default_tcString') || tc.tcString;
|
|
83
|
-
},
|
|
84
|
-
"[rnd]"() {
|
|
85
|
-
return new Date().getTime();
|
|
86
|
-
},
|
|
87
|
-
"[ad_sdk_ver]"() {
|
|
88
|
-
return ZeasnADVersion;
|
|
89
|
-
},
|
|
90
|
-
"[time_zone]"() {
|
|
91
|
-
return new Date().getTimezoneOffset();
|
|
92
|
-
},
|
|
93
|
-
"[google_pal]"() {
|
|
94
|
-
if (!window.googleNonce && getCookie("googleNonce")) {
|
|
95
|
-
return getCookie("googleNonce");
|
|
96
|
-
}
|
|
97
|
-
if (window.googleNonce) {
|
|
98
|
-
setCookie("googleNonce", window.googleNonce, new Date(new Date().getTime() + 6 * 60 * 60 * 1000));
|
|
99
|
-
}
|
|
100
|
-
return window.googleNonce || '';
|
|
101
|
-
},
|
|
102
|
-
"[device_lmt]"() {
|
|
103
|
-
return getCookie("relAdvert") === 'true' ? 0 : 1
|
|
104
|
-
},
|
|
105
|
-
"[avod_id]"() {
|
|
106
|
-
return ""
|
|
107
|
-
},
|
|
108
|
-
"[avod_title]"() {
|
|
109
|
-
return ""
|
|
110
|
-
},
|
|
111
|
-
"[device_id]"() {
|
|
112
|
-
return getCookie("deviceid") || getCookie("deviceId")
|
|
113
|
-
},
|
|
114
|
-
"[session_id]"() {
|
|
115
|
-
return window.session_id;
|
|
116
|
-
},
|
|
117
|
-
"[usertag]"() {
|
|
118
|
-
return getCookie("usertag")
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
function getLocationOrigin() {
|
|
122
|
-
return (
|
|
123
|
-
location.origin ||
|
|
124
|
-
`${location.protocol}//${location.host || location.hostname}${
|
|
125
|
-
location.port
|
|
126
|
-
}`
|
|
127
|
-
);
|
|
128
|
-
}
|
|
129
|
-
console.log(PlaceHolders);
|