Skip to content

Commit dd1b28e

Browse files
author
shengyonggen
committed
增加可以配置是否要采集input中的内容
1 parent 308a957 commit dd1b28e

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sa-sdk-javascript",
3-
"version": "1.7.20",
3+
"version": "1.8.1",
44
"description": "official sensorsdata javascript sdk",
55
"main": "sensorsdata.min.js",
66
"scripts": {

sensorsdata.min.js

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

src/sdk.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -894,12 +894,15 @@ _.getEleInfo = function(obj){
894894
}
895895
props.$element_content = textContent || '';
896896
}
897-
// 针对inut只采集button和submit非名感的词汇
898-
if(tagName === 'input' && (target.type === 'button' || target.type === 'submit')){
899-
props.$element_content = target.value || '';
897+
// 针对inut默认只采集button和submit非名感的词汇。可以自定义(银联提)
898+
if(tagName === 'input'){
899+
if(target.type === 'button' || target.type === 'submit'){
900+
props.$element_content = target.value || '';
901+
} else if (sd.para.heatmap && (typeof sd.para.heatmap.collect_input === 'function') && sd.para.heatmap.collect_input(target)){
902+
props.$element_content = target.value || '';
903+
}
900904
}
901905

902-
903906
props = _.strip_empty_properties(props);
904907

905908
props.$url = location.href;

src/sensorsdata.full.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,12 +1012,15 @@ _.getEleInfo = function(obj){
10121012
}
10131013
props.$element_content = textContent || '';
10141014
}
1015-
// 针对inut只采集button和submit非名感的词汇
1016-
if(tagName === 'input' && (target.type === 'button' || target.type === 'submit')){
1017-
props.$element_content = target.value || '';
1015+
// 针对inut默认只采集button和submit非名感的词汇。可以自定义(银联提)
1016+
if(tagName === 'input'){
1017+
if(target.type === 'button' || target.type === 'submit'){
1018+
props.$element_content = target.value || '';
1019+
} else if (sd.para.heatmap && (typeof sd.para.heatmap.collect_input === 'function') && sd.para.heatmap.collect_input(target)){
1020+
props.$element_content = target.value || '';
1021+
}
10181022
}
10191023

1020-
10211024
props = _.strip_empty_properties(props);
10221025

10231026
props.$url = location.href;

vtrack.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.

0 commit comments

Comments
 (0)