Skip to content

Commit 424c253

Browse files
committed
Run npm run build
1 parent 37c855c commit 424c253

37 files changed

+104
-52
lines changed

dist/latest/auto-events.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.

dist/latest/auto-events.js.map

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

dist/latest/cloudflare.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Simple Analytics - Privacy friendly analytics (docs.simpleanalytics.com/script; 2022-09-05; 9974; v10) */
1+
/* Simple Analytics - Privacy friendly analytics (docs.simpleanalytics.com/script; 2022-11-22; cdfd; v11) */
22
/* eslint-env browser */
33

44
(function (
@@ -63,6 +63,9 @@
6363
/(bot|spider|crawl)/i.test(userAgent) && !/(cubot)/i.test(userAgent);
6464
var screen = window.screen;
6565

66+
// Skip server side rendered pages on Cloudflare
67+
if (typeof window == "" + undefinedVar) return;
68+
6669
// Find the script element where options can be set on
6770
var scriptElement =
6871
doc.currentScript || doc.querySelector('script[src*="' + baseUrl + '"]');
@@ -77,12 +80,11 @@
7780
var args = [].slice.call(arguments);
7881

7982
// 2. Prepend log prefix
80-
args.unshift("Simple Analytics: ");
83+
args.unshift("Simple Analytics:");
8184

8285
// 3. Pass along arguments to console.warn
83-
// Function.prototype.bind.call is needed for Internet Explorer
84-
var log = Function.prototype.bind.call(con.warn, con);
85-
log.apply(con, args);
86+
// Function.prototype.apply.call is needed for Internet Explorer
87+
return Function.prototype.apply.call(con.warn, con, args);
8688
};
8789

8890
var warnInFunction = function (name, error) {
@@ -133,8 +135,13 @@
133135
return to;
134136
};
135137

138+
var settings = window.sa_settings;
139+
var logSettings = settings || Object.values(overwriteOptions).length;
140+
136141
// Merge overwriteOptions with sa_settings
137-
overwriteOptions = assign(overwriteOptions, window.sa_settings);
142+
overwriteOptions = assign(overwriteOptions, settings);
143+
144+
if (logSettings) warn("Settings", overwriteOptions);
138145

139146
// Customers can skip data points
140147
var ignoreMetrics = convertCommaSeparatedToArray(
@@ -905,9 +912,9 @@
905912
}
906913
})(
907914
window,
908-
{"saGlobal":INSTALL_OPTIONS.sa_global,"mode":INSTALL_OPTIONS.hash_mode ? 'hash' : null,"collectDnt":INSTALL_OPTIONS.collect_dnt},
915+
{"hostname":INSTALL_OPTIONS.hostname,"collectDnt":typeof INSTALL_OPTIONS.collect_dnt === 'boolean' ? INSTALL_OPTIONS.collect_dnt : null,"mode":INSTALL_OPTIONS.hash_mode ? 'hash' : 'normal',"strictUtm":INSTALL_OPTIONS.advanced_settings_toggle && INSTALL_OPTIONS.strict_utm,"allowParams":INSTALL_OPTIONS.advanced_settings_toggle && INSTALL_OPTIONS.allow_url_parameters,"nonUniqueHostnames":INSTALL_OPTIONS.advanced_settings_toggle && INSTALL_OPTIONS.non_unique_hostnames,"ignorePages":INSTALL_OPTIONS.advanced_settings_toggle && INSTALL_OPTIONS.ignore_pages,"namespace":INSTALL_OPTIONS.overwrite_namespace && INSTALL_OPTIONS.namespace},
909916
INSTALL_OPTIONS.custom_domain || "queue.simpleanalyticscdn.com",
910917
"",
911-
"cloudflare_10",
918+
"cloudflare_11",
912919
"sa"
913920
);

0 commit comments

Comments
 (0)