Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content multi fix #31

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 24.11.4

* Mitigated an issue where `content` and `feedback` interfaces would not work with async multi instances.

## 24.11.3

* Added support for content resizing (Experimental!)
Expand Down
4 changes: 4 additions & 0 deletions cypress/fixtures/multi_instance.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
Countly.q.push(["YOUR_APP_KEY3", "collect_from_forms"]);
Countly.q.push(["YOUR_APP_KEY3", "collect_from_facebook"]);
Countly.q.push(["YOUR_APP_KEY3", "opt_in"]);
Countly.q.push(["YOUR_APP_KEY3", "feedback.showNPS"]);
Countly.q.push(["YOUR_APP_KEY3", "content.enterContentZone"]);

//initialize fourth instance for another app asynchronously
Countly.q.push(["init", {
Expand Down Expand Up @@ -158,6 +160,8 @@
Countly.q.push(["YOUR_APP_KEY4", "collect_from_forms"]);
Countly.q.push(["YOUR_APP_KEY4", "collect_from_facebook"]);
Countly.q.push(["YOUR_APP_KEY4", "opt_in"]);
Countly.q.push(["YOUR_APP_KEY4", "feedback.showNPS"]);
Countly.q.push(["YOUR_APP_KEY4", "content.enterContentZone"]);
</script>
</head>
</html>
2 changes: 1 addition & 1 deletion modules/Constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ var healthCheckCounterEnum = Object.freeze({
errorMessage: "cly_hc_error_message",
});

var SDK_VERSION = "24.11.3";
var SDK_VERSION = "24.11.4";
var SDK_NAME = "javascript_native_web";

// Using this on document.referrer would return an array with 17 elements in it. The 12th element (array[11]) would be the path we are looking for. Others would be things like password and such (use https://regex101.com/ to check more)
Expand Down
13 changes: 13 additions & 0 deletions modules/CountlyClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -4223,12 +4223,25 @@ constructor(ob) {
if (typeof inst[req[arg]] === "function") {
inst[req[arg]].apply(inst, req.slice(arg + 1));
}
// Add interfaces you add to here for async queue to work
else if (req[arg].indexOf("userData.") === 0) {
var userdata = req[arg].replace("userData.", "");
if (typeof inst.userData[userdata] === "function") {
inst.userData[userdata].apply(inst, req.slice(arg + 1));
}
}
else if (req[arg].indexOf("content.") === 0) {
var contentMethod = req[arg].replace("content.", "");
if (typeof inst.content[contentMethod] === "function") {
inst.content[contentMethod].apply(inst, req.slice(arg + 1));
}
}
else if (req[arg].indexOf("feedback.") === 0) {
var feedbackMethod = req[arg].replace("feedback.", "");
if (typeof inst.feedback[feedbackMethod] === "function") {
inst.feedback[feedbackMethod].apply(inst, req.slice(arg + 1));
}
}
else if (typeof Countly[req[arg]] === "function") {
Countly[req[arg]].apply(Countly, req.slice(arg + 1));
}
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "countly-sdk-js",
"version": "24.11.3",
"version": "24.11.4",
"description": "Countly JavaScript SDK",
"type": "module",
"main": "Countly.js",
Expand Down
Loading