@dynatrace/cordova-plugin
Advanced tools
Comparing version 2.293.1 to 2.295.1
@@ -575,3 +575,3 @@ { | ||
{ | ||
"filePath": "\/opt\/jenkins\/workspace\/eAgent_ios-agent_release_8.293.x\/adk\/DynatraceUEM\/Dynatrace\/SwiftUIExtensions.swift", | ||
"filePath": "\/opt\/jenkins\/workspace\/eAgent_ios-agent_release_8.295.x\/adk\/DynatraceUEM\/Dynatrace\/SwiftUIExtensions.swift", | ||
"kind": "BooleanLiteral", | ||
@@ -578,0 +578,0 @@ "offset": 1277, |
@@ -575,3 +575,3 @@ { | ||
{ | ||
"filePath": "\/opt\/jenkins\/workspace\/eAgent_ios-agent_release_8.293.x\/adk\/DynatraceUEM\/Dynatrace\/SwiftUIExtensions.swift", | ||
"filePath": "\/opt\/jenkins\/workspace\/eAgent_ios-agent_release_8.295.x\/adk\/DynatraceUEM\/Dynatrace\/SwiftUIExtensions.swift", | ||
"kind": "BooleanLiteral", | ||
@@ -578,0 +578,0 @@ "offset": 1277, |
@@ -575,3 +575,3 @@ { | ||
{ | ||
"filePath": "\/opt\/jenkins\/workspace\/eAgent_ios-agent_release_8.293.x\/adk\/DynatraceUEM\/Dynatrace\/SwiftUIExtensions.swift", | ||
"filePath": "\/opt\/jenkins\/workspace\/eAgent_ios-agent_release_8.295.x\/adk\/DynatraceUEM\/Dynatrace\/SwiftUIExtensions.swift", | ||
"kind": "BooleanLiteral", | ||
@@ -578,0 +578,0 @@ "offset": 1277, |
@@ -7,8 +7,8 @@ "use strict"; | ||
var referer = getReferer(actionId); | ||
var dtAdk = getCookieValue('dtAdk'); | ||
var dtAdk = getCookieValue('dtAdk', false); | ||
if (dtAdk === '') { | ||
dtAdk = getLocalStorageValue('dtAdk'); | ||
} | ||
return "sn=\"".concat(getSessionNumber(getCookieValue('dtCookie')), "\", pc=\"").concat(patchPageContext(getCookieValue('dtPC'), actionId), "\"") | ||
+ ", v=\"".concat(getCookieValue('rxVisitor'), "\", r=\"").concat(referer, "\", app=\"").concat(getApplicationId(), "\", adk=\"").concat(dtAdk, "\""); | ||
return "sn=\"".concat(getSessionNumber(getCookieValue('dtCookie', true)), "\", pc=\"").concat(patchPageContext(getCookieValue('dtPC', true), actionId), "\"") | ||
+ ", v=\"".concat(getCookieValue('rxVisitor', true), "\", r=\"").concat(referer, "\", app=\"").concat(getApplicationId(), "\", adk=\"").concat(dtAdk, "\""); | ||
}; | ||
@@ -37,5 +37,3 @@ var getReferer = function (actionId) { | ||
}; | ||
var getApplicationId = function () { | ||
return typeof dT_ !== 'undefined' && typeof dT_.scv !== 'undefined' ? dT_.scv('app') : ''; | ||
}; | ||
var getApplicationId = function () { return typeof dT_ !== 'undefined' && typeof dT_.scv !== 'undefined' ? dT_.scv('app') : ''; }; | ||
var getSessionNumber = function (dtCookie) { | ||
@@ -53,3 +51,6 @@ if (dtCookie !== undefined) { | ||
}; | ||
var getCookieValue = function (cookieName) { | ||
var getCookieValue = function (cookieName, postfix) { | ||
if (postfix && isCookiePostfixEnabled()) { | ||
cookieName = cookieName + dT_.cfg('postfix'); | ||
} | ||
var b = document.cookie.match('(^|[^;]+)\\s*' + cookieName + '\\s*=\\s*([^;]+)'); | ||
@@ -62,2 +63,6 @@ var cookie = b ? b.pop() : ''; | ||
}; | ||
var isCookiePostfixEnabled = function () { | ||
return typeof dT_ !== 'undefined' && dT_.initialized === true && typeof dT_.cfg !== 'undefined' | ||
&& typeof dT_.cfg('postfix') !== 'undefined'; | ||
}; | ||
var getLocalStorageValue = function (key) { | ||
@@ -64,0 +69,0 @@ if (typeof localStorage !== 'undefined') { |
{ | ||
"name": "@dynatrace/cordova-plugin", | ||
"version": "2.293.1", | ||
"version": "2.295.1", | ||
"description": "This plugin gives you the ability to use the Dynatrace instrumentation in your hybrid application (Cordova, Ionic, ..). It uses the Mobile Agent, the JavaScript Agent. The Mobile Agent will give you all device specific values containing lifecycle information and the Javascript Agent will allow you to manually instrument your JavaScript/TypeScript code out of the box (Typescript definitions included). The JavaScript Agent will cover the network calls and will automatically detect them.", | ||
@@ -5,0 +5,0 @@ "cordova": { |
@@ -34,4 +34,4 @@ [![N|Solid](https://assets.dynatrace.com/content/dam/dynatrace/misc/dynatrace_web.png)](https://dynatrace.com) | ||
* Android Agent: 8.293.1.1003 | ||
* iOS Agent: 8.293.1.1003 | ||
* Android Agent: 8.295.1.1006 | ||
* iOS Agent: 8.295.1.1020 | ||
@@ -171,3 +171,3 @@ ## Quick Setup | ||
// capacitor 3.1 or higher: | ||
"capacitor:sync:after": "node node_modules/@dynatrace/cordova-plugin/scripts/InstrumentCap.js" | ||
"capacitor:sync:after": "node node_modules/@dynatrace/cordova-plugin/scripts/InstrumentCap.js" | ||
}, | ||
@@ -333,2 +333,7 @@ ``` | ||
* HTML file contains an ionic tag like `ion-app` or `app-root` | ||
* HTML file contains the following tags: | ||
* DOCTYPE of html (i.e. something like `<!DOCTYPE html>`) | ||
* If DOCTYPE is not specifically html (i.e. xml), we will not inject | ||
* html tag (`<html` and `</html>`) | ||
* head tag (`<head` and `</head>`) | ||
* HTML files defined via dynatrace.config.js property `htmlFiles` | ||
@@ -856,2 +861,7 @@ | ||
2.295.1 | ||
* Updated Android (8.295.1.1006) & iOS Agent (8.295.1.1020) | ||
* Using cookie postfix of JavaScript agent when enabled | ||
* Updated [HTML Instrumentation Requirements](#html-instrumentation-requirements) for when injecting the JS agent into html | ||
2.293.1 | ||
@@ -858,0 +868,0 @@ * Updated Android (8.293.1.1003) & iOS Agent (8.293.1.1003) |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.COOKIE_PROXY_SRC = exports.SWALLOW_API_SRC = exports.OLD_AGENT_SRC = exports.HTML_IDENTIFIER = exports.DEFAULT_COOKIE_PROXY_INJECTION = exports.DEFAULT_SWALLOW_API_INJECTION = void 0; | ||
exports.COOKIE_PROXY_SRC = exports.SWALLOW_API_SRC = exports.OLD_AGENT_SRC = exports.HTML_REQUIRED = exports.HTML_IDENTIFIER = exports.DEFAULT_COOKIE_PROXY_INJECTION = exports.DEFAULT_SWALLOW_API_INJECTION = void 0; | ||
var CordovaPluginConfigurationConstants_1 = require("../config/cordova/CordovaPluginConfigurationConstants"); | ||
@@ -8,4 +8,5 @@ exports.DEFAULT_SWALLOW_API_INJECTION = true; | ||
exports.HTML_IDENTIFIER = ['ion-app', 'app-root']; | ||
exports.HTML_REQUIRED = ['<html', '<head', '</head>', '</html>']; | ||
exports.OLD_AGENT_SRC = 'assets/dtAgent.js'; | ||
exports.SWALLOW_API_SRC = 'assets/dtrum-swallow-api.js'; | ||
exports.COOKIE_PROXY_SRC = 'assets/dt-cookie-proxy.js'; |
@@ -44,5 +44,6 @@ "use strict"; | ||
var HTMLFile = (function () { | ||
function HTMLFile(path, dom) { | ||
function HTMLFile(path, dom, htmlAsString) { | ||
this.path = path; | ||
this.dom = dom; | ||
this.htmlAsString = htmlAsString; | ||
} | ||
@@ -55,2 +56,5 @@ HTMLFile.prototype.getDOM = function () { | ||
}; | ||
HTMLFile.prototype.getHtmlString = function () { | ||
return this.htmlAsString; | ||
}; | ||
HTMLFile.prototype.write = function () { | ||
@@ -57,0 +61,0 @@ return __awaiter(this, void 0, void 0, function () { |
@@ -74,4 +74,4 @@ "use strict"; | ||
data = _a.sent(); | ||
return [2, new HtmlFile_1.HTMLFile(this.htmlFile, new jsdom_1.JSDOM(data))]; | ||
case 3: return [2, new HtmlFile_1.HTMLFile(this.htmlFile, new jsdom_1.JSDOM(''))]; | ||
return [2, new HtmlFile_1.HTMLFile(this.htmlFile, new jsdom_1.JSDOM(data), data)]; | ||
case 3: return [2, new HtmlFile_1.HTMLFile(this.htmlFile, new jsdom_1.JSDOM(''), "")]; | ||
} | ||
@@ -78,0 +78,0 @@ }); |
@@ -11,4 +11,17 @@ "use strict"; | ||
HTMLVerifier.prototype.isQualified = function () { | ||
return this.isHTMLCordova() || this.isHTMLIonic(); | ||
return this.isHTMLCordova() || this.isHTMLIonic() || (this.hasDoctypeHtml() && this.hasHtmlAndHeadTags()); | ||
}; | ||
HTMLVerifier.prototype.hasHtmlAndHeadTags = function () { | ||
for (var _i = 0, HTML_REQUIRED_1 = HtmlConstants_1.HTML_REQUIRED; _i < HTML_REQUIRED_1.length; _i++) { | ||
var htmlRequired = HTML_REQUIRED_1[_i]; | ||
var htmlStr = this.htmlFile.getHtmlString(); | ||
if (htmlStr.indexOf(htmlRequired) < 0) { | ||
return false; | ||
} | ||
} | ||
return true; | ||
}; | ||
HTMLVerifier.prototype.hasDoctypeHtml = function () { | ||
return this.htmlFile.getDOM().window.document.doctype ? this.htmlFile.getDOM().window.document.doctype.name.includes("html") : false; | ||
}; | ||
HTMLVerifier.prototype.isHTMLCordova = function () { | ||
@@ -15,0 +28,0 @@ var scripts = this.htmlFile.getDOM().window.document.getElementsByTagName('script'); |
"use strict"; | ||
var cookieList = ['dtCookie', 'dtLatC', 'dtPC', 'dtSa', 'dtValidationCookie', 'rxVisitor', 'rxvt', 'dtAdk', 'dtAdkSettings']; | ||
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { | ||
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { | ||
if (ar || !(i in from)) { | ||
if (!ar) ar = Array.prototype.slice.call(from, 0, i); | ||
ar[i] = from[i]; | ||
} | ||
} | ||
return to.concat(ar || Array.prototype.slice.call(from)); | ||
}; | ||
var jsAgentCookies = ['dtCookie', 'dtLatC', 'dtPC', 'dtSa', 'dtValidationCookie', 'rxVisitor', 'rxvt']; | ||
var mobileAgentCookies = ['dtAdk', 'dtAdkSettings']; | ||
var cookieList = __spreadArray(__spreadArray([], jsAgentCookies, true), mobileAgentCookies, true); | ||
var sessionStoragePrefix = '_dt.'; | ||
@@ -39,4 +50,11 @@ if (typeof Document !== 'undefined') { | ||
var cookieString = ''; | ||
for (var _i = 0, cookieList_1 = cookieList; _i < cookieList_1.length; _i++) { | ||
var cookieName = cookieList_1[_i]; | ||
var correctCookieList = []; | ||
if (isCookiePostfixEnabled()) { | ||
correctCookieList = generateCookieListWithPostfix(); | ||
} | ||
else { | ||
correctCookieList = cookieList; | ||
} | ||
for (var _i = 0, correctCookieList_1 = correctCookieList; _i < correctCookieList_1.length; _i++) { | ||
var cookieName = correctCookieList_1[_i]; | ||
var cookie = getCookie(cookieName); | ||
@@ -61,2 +79,5 @@ if (cookie !== undefined && cookie !== null) { | ||
if (name !== undefined && name.length > 0) { | ||
if (isCookiePostfixEnabled()) { | ||
return generateCookieListWithPostfix().includes(name); | ||
} | ||
return cookieList.includes(name); | ||
@@ -66,2 +87,9 @@ } | ||
}; | ||
var isCookiePostfixEnabled = function () { | ||
return typeof dT_ !== 'undefined' && dT_.initialized === true && typeof dT_.cfg !== 'undefined' | ||
&& typeof dT_.cfg('postfix') !== 'undefined'; | ||
}; | ||
var generateCookieListWithPostfix = function () { | ||
return __spreadArray(__spreadArray([], jsAgentCookies.map(function (value) { return value + dT_.cfg('postfix'); }), true), mobileAgentCookies, true); | ||
}; | ||
if (typeof exports !== 'undefined') { | ||
@@ -71,2 +99,5 @@ exports.setCookie = setCookie; | ||
exports.sessionStoragePrefix = sessionStoragePrefix; | ||
exports.isCookiePostfixEnabled = isCookiePostfixEnabled; | ||
exports.generateCookieListWithPostfix = generateCookieListWithPostfix; | ||
exports.isCookieImportant = isCookieImportant; | ||
} |
@@ -43,3 +43,4 @@ "use strict"; | ||
var SEC_POLICY_IDENTIFIER = 'Content-Security-Policy'; | ||
var HTML_IDENTIFIER = ['src="cordova.js"', '<ion-app>']; | ||
var HTML_IDENTIFIER = ['src="cordova.js"', '<ion-app>', '<app-root>']; | ||
var HTML_REQUIRED = ['<!doctype html', '<html', '</html>', '<head', '</head>']; | ||
var CONNECT_SRC = 'connect-src'; | ||
@@ -121,6 +122,11 @@ var updateSecurity = function (htmlFiles, configuration) { return __awaiter(void 0, void 0, void 0, function () { | ||
var identifer = HTML_IDENTIFIER_1[_i]; | ||
if (content.indexOf(identifer)) { | ||
if (content.toLowerCase().indexOf(identifer) > -1) { | ||
Logger_1.Logger.getInstance().logInfo('Successfully updated the CSP: ' + htmlFile); | ||
return true; | ||
} | ||
} | ||
if (HTML_REQUIRED.every(function (value) { return content.toLowerCase().includes(value); })) { | ||
Logger_1.Logger.getInstance().logInfo('Successfully updated the CSP: ' + htmlFile); | ||
return true; | ||
} | ||
} | ||
@@ -127,0 +133,0 @@ return false; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24830339
6382
1014