zalo-js-bridge
Advanced tools
Comparing version 1.10.20 to 1.11.0
# Base Library Update Logs | ||
# 1.11.0 (2021-05-11) | ||
### Features | ||
* export api get cookie 58c2315 | ||
## 1.10.20 (2021-05-04) | ||
@@ -4,0 +11,0 @@ |
@@ -76,2 +76,8 @@ "use strict"; | ||
} | ||
getCookie(name) { | ||
return CommonUtils.readCookie(name); | ||
} | ||
getCookieFallback(name) { | ||
return CommonUtils.readCookieFallback(name); | ||
} | ||
} | ||
@@ -78,0 +84,0 @@ const zjsbridge = new ZJSBridge(); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generateUniqueString = exports.getZaloVersion = exports.checkPlatform = exports.getUserAgent = exports.getToken = exports.isFunction = exports.serialize = exports.isZaloBrowser = exports.parseJSON = exports.isString = exports.isEmpty = exports.isObject = exports.writeCookie = void 0; | ||
exports.generateUniqueString = exports.getZaloVersion = exports.checkPlatform = exports.getUserAgent = exports.getToken = exports.isFunction = exports.serialize = exports.isZaloBrowser = exports.parseJSON = exports.isString = exports.isEmpty = exports.isObject = exports.readCookieFallback = exports.writeCookie = exports.readCookie = void 0; | ||
const Cookies = require("js-cookie"); | ||
const readCookie = (name) => { | ||
exports.readCookie = (name) => { | ||
const ckString = document.cookie; | ||
@@ -71,8 +71,8 @@ if (ckString) { | ||
const readCookieByDomain = (name) => { | ||
return readCookie(getCurrHost() + name); | ||
return exports.readCookie(getCurrHost() + name); | ||
}; | ||
const readCookieByRootDomain = (name) => { | ||
return readCookie(getCurrHostRootZaloMe() + name); | ||
return exports.readCookie(getCurrHostRootZaloMe() + name); | ||
}; | ||
const readCookieFallback = (name) => { | ||
exports.readCookieFallback = (name) => { | ||
let ck = readCookieByDomain(name); | ||
@@ -82,3 +82,3 @@ if (!ck) { | ||
if (!ck) { | ||
return readCookie(name); | ||
return exports.readCookie(name); | ||
} | ||
@@ -167,3 +167,3 @@ } | ||
exports.getToken = (name) => { | ||
return readCookieFallback(name); | ||
return exports.readCookieFallback(name); | ||
}; | ||
@@ -180,3 +180,3 @@ exports.getUserAgent = () => navigator.userAgent || navigator.vendor || window.opera; | ||
}; | ||
exports.getZaloVersion = () => readCookie("zversion"); | ||
exports.getZaloVersion = () => exports.readCookie("zversion"); | ||
const REGEXP_SPECIAL_UNICODE = new RegExp("[\\u0300-\\u036f]", "g"); | ||
@@ -183,0 +183,0 @@ const REGEXP_ACCENT_D = new RegExp("[đ|Đ]", "g"); |
{ | ||
"name": "zalo-js-bridge", | ||
"description": "A Javascript Framework for WebApp", | ||
"version": "1.10.20", | ||
"version": "1.11.0", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "files": [ |
88592
2218