Skip to content

Commit 91a47c8

Browse files
hanzhenfengMrCoder
authored andcommitted
modify the chrome extension version to v3
1. fix the font error
1 parent 616c229 commit 91a47c8

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

gulpfile.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ gulp.task('copyFiles', function () {
9191
'src/Inconsolata.ttf',
9292
'src/Monoid.ttf'
9393
])
94-
.pipe(gulp.dest('app'))
94+
.pipe(gulp.dest('app')),
95+
gulp.src('node_modules/vue-sequence/dist/fonts/*').pipe(gulp.dest("app/fonts/"))
9596
);
9697
});
9798

@@ -154,6 +155,8 @@ gulp.task('packageExtension', function () {
154155
childProcess.execSync('cp src/icon-16.png extension');
155156
childProcess.execSync('cp src/icon-48.png extension');
156157
childProcess.execSync('cp src/icon-128.png extension');
158+
childProcess.execSync('cp -r node_modules/vue-sequence/dist/fonts extension');
159+
157160
childProcess.execSync(
158161
'rm -rf extension/partials'
159162
);

src/analytics.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export function trackEvent(category, action, label, value) {
1717

1818
async function sendTrackMessage(type, category, action, label, value) {
1919
if (location.href.indexOf('chrome-extension://') !== -1) {
20-
await postAnalyticsDataByApi(type, category, action);
20+
await postAnalyticsDataByApi(type, category, action, label);
2121
} else {
2222
if (window.ga) {
2323
ga('send', type, category, action, label, value);
@@ -37,7 +37,7 @@ function getCustomerId() {
3737
return cid;
3838
}
3939

40-
async function postAnalyticsDataByApi(type, category, action) {
40+
async function postAnalyticsDataByApi(type, category, action, label) {
4141
const url = "https://www.google-analytics.com/collect";
4242
const gaParams = new URLSearchParams();
4343
gaParams.append("v", 1);
@@ -46,7 +46,8 @@ async function postAnalyticsDataByApi(type, category, action) {
4646
gaParams.append("dl", window.location.host);
4747
gaParams.append("ul", navigator.language);
4848
gaParams.append("de", document.characterSet);
49-
gaParams.append("dt", new Date().toUTCString());
49+
gaParams.append("dt", document.title);
50+
gaParams.append("el", label ? label : null);
5051
gaParams.append("t", type);
5152
gaParams.append("ec", category);
5253
gaParams.append("ea", action);

0 commit comments

Comments
 (0)