Skip to content

Commit a961ca9

Browse files
author
shengyonggen
committed
Release 1.23.4
1 parent a2a5c09 commit a961ca9

25 files changed

+169
-179
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 1.23.4 (2022-09-09)
2+
1. 修复
3+
- 修复在较低版本的 `chrome``ie` 会报错,影响页面渲染无法正常显示的问题
4+
- 修复特殊场景下热力图打开报错的问题
5+
- 修复单页面场景下 `$WebPageLeave` 事件的 `$url_path``$url` 不一致的问题
6+
- 多域名打通 `_sasdk` 参数逻辑优化
7+
18
## 1.23.3 (2022-07-01)
29
1. 修复
310
-`init` 之后初始化渠道插件,渠道插件功能不生效的问题

core/sensorsdata.amd.min.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/sensorsdata.es6.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/sensorsdata.min.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/sensorsdata.mtp.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sat/sensorsdata-sat.amd.full.js

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -753,17 +753,6 @@
753753
};
754754
});
755755

756-
(function() {
757-
if (!String.prototype.replaceAll) {
758-
String.prototype.replaceAll = function(str, newStr) {
759-
if (Object.prototype.toString.call(str).toLowerCase() === '[object regexp]') {
760-
return this.replace(str, newStr);
761-
}
762-
return this.replace(new RegExp(str, 'g'), newStr);
763-
};
764-
}
765-
})();
766-
767756
function isFunction(arg) {
768757
if (!arg) {
769758
return false;
@@ -1941,7 +1930,7 @@
19411930

19421931
function getValid(data) {
19431932
if (data) {
1944-
return data.replaceAll(/\r\n/g, '');
1933+
return data.replace(/\r\n/g, '');
19451934
} else {
19461935
return false;
19471936
}
@@ -3151,7 +3140,7 @@
31513140
};
31523141

31533142
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
3154-
var sdkversion_placeholder = '1.23.3';
3143+
var sdkversion_placeholder = '1.23.4';
31553144
var domain_test_key = 'sensorsdata_domain_test';
31563145

31573146
var IDENTITY_KEY = {
@@ -8202,7 +8191,7 @@
82028191
source: 'sa-web-sdk',
82038192
type: 'v-is-vtrack',
82048193
data: {
8205-
sdkversion: '1.23.3'
8194+
sdkversion: '1.23.4'
82068195
}
82078196
},
82088197
'*'
@@ -8374,7 +8363,7 @@
83748363
}
83758364
}
83768365

8377-
var methods = ['setItem', 'deleteItem', 'getAppStatus', 'track', 'quick', 'register', 'registerPage', 'registerOnce', 'trackSignup', 'setProfile', 'setOnceProfile', 'appendProfile', 'incrementProfile', 'deleteProfile', 'unsetProfile', 'identify', 'login', 'logout', 'trackLink', 'clearAllRegister', 'clearPageRegister'];
8366+
var methods = ['setItem', 'deleteItem', 'getAppStatus', 'track', 'quick', 'register', 'registerPage', 'registerOnce', 'trackSignup', 'setProfile', 'setOnceProfile', 'appendProfile', 'incrementProfile', 'deleteProfile', 'unsetProfile', 'identify', 'login', 'logout', 'trackLink', 'clearAllRegister', 'clearPageRegister', 'bind', 'unbind', 'loginWithKey'];
83788367

83798368
function checkState() {
83808369
each(methods, function(method) {
@@ -9861,7 +9850,7 @@
98619850
var data = JSON.stringify(_.extend({
98629851
server_url: sd.para.server_url
98639852
}, originData));
9864-
data = data.replaceAll(/\r\n/g, '');
9853+
data = data.replace(/\r\n/g, '');
98659854
data = encodeURIComponent(data);
98669855
return 'sensorsanalytics://trackEvent?event=' + data;
98679856
}
@@ -10147,7 +10136,7 @@
1014710136
var data = {
1014810137
$title: document.title,
1014910138
$url: this._.getURL(this.url),
10150-
$url_path: this._.getURLPath(),
10139+
$url_path: this._.getURLPath(this._.URL(this.url).pathname),
1015110140
$referrer_host: referrer ? this._.getHostname(referrer) : '',
1015210141
$referrer: referrer,
1015310142
$viewport_position: viewport_position
@@ -10459,6 +10448,7 @@
1045910448
};
1046010449

1046110450
siteLinker.rewriteUrl = function(url, target) {
10451+
var _this = this;
1046210452
var reg = /([^?#]+)(\?[^#]*)?(#.*)?/;
1046310453
var arr = reg.exec(url),
1046410454
nurl = '';
@@ -10469,29 +10459,43 @@
1046910459
search = arr[2] || '',
1047010460
hash = arr[3] || '';
1047110461
var idIndex;
10462+
var sa_id = '_sasdk=' + this.getCurrenId();
10463+
var changeSaId = function(str) {
10464+
var arr = str.split('&');
10465+
var new_arr = [];
10466+
_this._.each(arr, function(val) {
10467+
if (val.indexOf('_sasdk=') > -1) {
10468+
new_arr.push(sa_id);
10469+
} else {
10470+
new_arr.push(val);
10471+
}
10472+
});
10473+
return new_arr.join('&');
10474+
};
10475+
1047210476
if (this.getPartHash(url)) {
1047310477
idIndex = hash.indexOf('_sasdk');
1047410478
var queryIndex = hash.indexOf('?');
1047510479
if (queryIndex > -1) {
1047610480
if (idIndex > -1) {
10477-
nurl = host + search + '#' + hash.substring(1, idIndex) + '_sasdk=' + this.getCurrenId();
10481+
nurl = host + search + '#' + hash.substring(1, idIndex) + changeSaId(hash.substring(idIndex, hash.length));
1047810482
} else {
10479-
nurl = host + search + '#' + hash.substring(1) + '&_sasdk=' + this.getCurrenId();
10483+
nurl = host + search + hash + '&' + sa_id;
1048010484
}
1048110485
} else {
10482-
nurl = host + search + '#' + hash.substring(1) + '?_sasdk=' + this.getCurrenId();
10486+
nurl = host + search + '#' + hash.substring(1) + '?' + sa_id;
1048310487
}
1048410488
} else {
1048510489
idIndex = search.indexOf('_sasdk');
1048610490
var hasQuery = /^\?(\w)+/.test(search);
1048710491
if (hasQuery) {
1048810492
if (idIndex > -1) {
10489-
nurl = host + '?' + search.substring(1, idIndex) + '_sasdk=' + this.getCurrenId() + hash;
10493+
nurl = host + '?' + changeSaId(search.substring(1)) + hash;
1049010494
} else {
10491-
nurl = host + '?' + search.substring(1) + '&_sasdk=' + this.getCurrenId() + hash;
10495+
nurl = host + search + '&' + sa_id + hash;
1049210496
}
1049310497
} else {
10494-
nurl = host + '?' + search.substring(1) + '_sasdk=' + this.getCurrenId() + hash;
10498+
nurl = host + '?' + sa_id + hash;
1049510499
}
1049610500
}
1049710501

dist/sat/sensorsdata-sat.amd.min.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/sat/sensorsdata-sat.es6.full.js

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -747,17 +747,6 @@ var sd = {};
747747
};
748748
});
749749

750-
(function() {
751-
if (!String.prototype.replaceAll) {
752-
String.prototype.replaceAll = function(str, newStr) {
753-
if (Object.prototype.toString.call(str).toLowerCase() === '[object regexp]') {
754-
return this.replace(str, newStr);
755-
}
756-
return this.replace(new RegExp(str, 'g'), newStr);
757-
};
758-
}
759-
})();
760-
761750
function isFunction(arg) {
762751
if (!arg) {
763752
return false;
@@ -1935,7 +1924,7 @@ var cookie = {
19351924

19361925
function getValid(data) {
19371926
if (data) {
1938-
return data.replaceAll(/\r\n/g, '');
1927+
return data.replace(/\r\n/g, '');
19391928
} else {
19401929
return false;
19411930
}
@@ -3145,7 +3134,7 @@ var debug = {
31453134
};
31463135

31473136
var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term';
3148-
var sdkversion_placeholder = '1.23.3';
3137+
var sdkversion_placeholder = '1.23.4';
31493138
var domain_test_key = 'sensorsdata_domain_test';
31503139

31513140
var IDENTITY_KEY = {
@@ -8196,7 +8185,7 @@ var vtrackMode = {
81968185
source: 'sa-web-sdk',
81978186
type: 'v-is-vtrack',
81988187
data: {
8199-
sdkversion: '1.23.3'
8188+
sdkversion: '1.23.4'
82008189
}
82018190
},
82028191
'*'
@@ -8368,7 +8357,7 @@ function detectMode() {
83688357
}
83698358
}
83708359

8371-
var methods = ['setItem', 'deleteItem', 'getAppStatus', 'track', 'quick', 'register', 'registerPage', 'registerOnce', 'trackSignup', 'setProfile', 'setOnceProfile', 'appendProfile', 'incrementProfile', 'deleteProfile', 'unsetProfile', 'identify', 'login', 'logout', 'trackLink', 'clearAllRegister', 'clearPageRegister'];
8360+
var methods = ['setItem', 'deleteItem', 'getAppStatus', 'track', 'quick', 'register', 'registerPage', 'registerOnce', 'trackSignup', 'setProfile', 'setOnceProfile', 'appendProfile', 'incrementProfile', 'deleteProfile', 'unsetProfile', 'identify', 'login', 'logout', 'trackLink', 'clearAllRegister', 'clearPageRegister', 'bind', 'unbind', 'loginWithKey'];
83728361

83738362
function checkState() {
83748363
each(methods, function(method) {
@@ -9855,7 +9844,7 @@ try {
98559844
var data = JSON.stringify(_.extend({
98569845
server_url: sd.para.server_url
98579846
}, originData));
9858-
data = data.replaceAll(/\r\n/g, '');
9847+
data = data.replace(/\r\n/g, '');
98599848
data = encodeURIComponent(data);
98609849
return 'sensorsanalytics://trackEvent?event=' + data;
98619850
}
@@ -10141,7 +10130,7 @@ try {
1014110130
var data = {
1014210131
$title: document.title,
1014310132
$url: this._.getURL(this.url),
10144-
$url_path: this._.getURLPath(),
10133+
$url_path: this._.getURLPath(this._.URL(this.url).pathname),
1014510134
$referrer_host: referrer ? this._.getHostname(referrer) : '',
1014610135
$referrer: referrer,
1014710136
$viewport_position: viewport_position
@@ -10453,6 +10442,7 @@ try {
1045310442
};
1045410443

1045510444
siteLinker.rewriteUrl = function(url, target) {
10445+
var _this = this;
1045610446
var reg = /([^?#]+)(\?[^#]*)?(#.*)?/;
1045710447
var arr = reg.exec(url),
1045810448
nurl = '';
@@ -10463,29 +10453,43 @@ try {
1046310453
search = arr[2] || '',
1046410454
hash = arr[3] || '';
1046510455
var idIndex;
10456+
var sa_id = '_sasdk=' + this.getCurrenId();
10457+
var changeSaId = function(str) {
10458+
var arr = str.split('&');
10459+
var new_arr = [];
10460+
_this._.each(arr, function(val) {
10461+
if (val.indexOf('_sasdk=') > -1) {
10462+
new_arr.push(sa_id);
10463+
} else {
10464+
new_arr.push(val);
10465+
}
10466+
});
10467+
return new_arr.join('&');
10468+
};
10469+
1046610470
if (this.getPartHash(url)) {
1046710471
idIndex = hash.indexOf('_sasdk');
1046810472
var queryIndex = hash.indexOf('?');
1046910473
if (queryIndex > -1) {
1047010474
if (idIndex > -1) {
10471-
nurl = host + search + '#' + hash.substring(1, idIndex) + '_sasdk=' + this.getCurrenId();
10475+
nurl = host + search + '#' + hash.substring(1, idIndex) + changeSaId(hash.substring(idIndex, hash.length));
1047210476
} else {
10473-
nurl = host + search + '#' + hash.substring(1) + '&_sasdk=' + this.getCurrenId();
10477+
nurl = host + search + hash + '&' + sa_id;
1047410478
}
1047510479
} else {
10476-
nurl = host + search + '#' + hash.substring(1) + '?_sasdk=' + this.getCurrenId();
10480+
nurl = host + search + '#' + hash.substring(1) + '?' + sa_id;
1047710481
}
1047810482
} else {
1047910483
idIndex = search.indexOf('_sasdk');
1048010484
var hasQuery = /^\?(\w)+/.test(search);
1048110485
if (hasQuery) {
1048210486
if (idIndex > -1) {
10483-
nurl = host + '?' + search.substring(1, idIndex) + '_sasdk=' + this.getCurrenId() + hash;
10487+
nurl = host + '?' + changeSaId(search.substring(1)) + hash;
1048410488
} else {
10485-
nurl = host + '?' + search.substring(1) + '&_sasdk=' + this.getCurrenId() + hash;
10489+
nurl = host + search + '&' + sa_id + hash;
1048610490
}
1048710491
} else {
10488-
nurl = host + '?' + search.substring(1) + '_sasdk=' + this.getCurrenId() + hash;
10492+
nurl = host + '?' + sa_id + hash;
1048910493
}
1049010494
}
1049110495

dist/sat/sensorsdata-sat.es6.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)