@connectid-tools/idp-selector-react 6.11.0-alpha.1 → 6.11.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CidButton.js +1 -1
- package/Popup.js +1 -1
- package/README.md +3 -0
- package/package.json +2 -1
- package/incognito.d.ts +0 -41
- package/incognito.js +0 -239
package/CidButton.js
CHANGED
|
@@ -36,10 +36,10 @@ import { initialiseAnalytics } from "./analytics.js";
|
|
|
36
36
|
import "./global.css";
|
|
37
37
|
import { getCurrentUrlOrigin } from "./navigator.js";
|
|
38
38
|
import { isIntroTextTypeValid, isRequiredClaimsValid } from "./validator.js";
|
|
39
|
-
import detectIncognito from "./incognito.js";
|
|
40
39
|
import { getBrowserName, getDeviceType, isAndroid, isIos } from "./userAgent.js";
|
|
41
40
|
import { hasCertification } from "./certification.js";
|
|
42
41
|
import { getCompatibility } from "./compatibility.js";
|
|
42
|
+
import detectIncognito from "detectincognitojs";
|
|
43
43
|
export const CidButton = ({ onProceed, claims, requiredClaims, rpLogoUrl, requiredCertifications, label = "Verify", size = "regular", type, introTextType, fullProcessCollapsible = false, participantsUri = "https://data.directory.connectid.com.au/participants", certificationStatus = "Active", rpDataSharingDescription = "Your details will be shared with the current website.", enableManualVerification = false, showAllParticipants = false, theme = "dark", logoLockupStyle = "light", showInfoContent = false, onError = () => { }, showCompatibilityWarnings = false, supportIncognito = false, disableAnalytics = false, forceMobile = false, // only for testing purposes
|
|
44
44
|
forceIos = false, // only for testing purposes
|
|
45
45
|
forceAndroid = false, // only for testing purposes
|
package/Popup.js
CHANGED
|
@@ -29,7 +29,7 @@ import { NoIdpError } from "./NoIdpError.js";
|
|
|
29
29
|
import { ParticipantsLoader } from "./ParticipantsLoader.js";
|
|
30
30
|
import "./Popup.css";
|
|
31
31
|
import { useOverrideShiftTab, useOverrideTab } from "./TabHook.js";
|
|
32
|
-
import detectIncognito from "
|
|
32
|
+
import detectIncognito from "detectincognitojs";
|
|
33
33
|
export const Popup = ({ onProceed, onCancel, onError, claims, requiredClaims, showAllParticipants, certificationStatus, popupTitle, rpDataSharingDescription, enableManualVerification, requiredCertifications, rpLogoUrl, participants, error, isLoading, }) => {
|
|
34
34
|
const [isIncognito, setIsIncognito] = useState();
|
|
35
35
|
const [showClaims, setShowClaims] = useState(false); // mobile only
|
package/README.md
CHANGED
|
@@ -260,6 +260,9 @@ The SVG image below the ConnectID button has either option dark or light mode. B
|
|
|
260
260
|
## 🚀 Release Notes
|
|
261
261
|
|
|
262
262
|
|
|
263
|
+
### 6.11.0-alpha.2 (Jul 23, 2025)
|
|
264
|
+
- Use `detectincognitojs` npm package.
|
|
265
|
+
|
|
263
266
|
### 6.11.0-alpha.1 (Jul 22, 2025)
|
|
264
267
|
- Add file extension to output js files.
|
|
265
268
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@connectid-tools/idp-selector-react",
|
|
3
|
-
"version": "6.11.0-alpha.
|
|
3
|
+
"version": "6.11.0-alpha.2",
|
|
4
4
|
"description": "React component for IDP Selector.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"typescript": "^5.8.3"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
+
"detectincognitojs": "^1.6.0",
|
|
43
44
|
"react-responsive": "^10.0.1",
|
|
44
45
|
"swr": "^2.3.4",
|
|
45
46
|
"vite": "^6.3.5"
|
package/incognito.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
*
|
|
3
|
-
* detectIncognito v1.4.1
|
|
4
|
-
*
|
|
5
|
-
* https://github.com/Joe12387/detectIncognito
|
|
6
|
-
*
|
|
7
|
-
* MIT License
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) 2021 - 2024 Joe Rutkowski <Joe@dreggle.com>
|
|
10
|
-
*
|
|
11
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
13
|
-
* in the Software without restriction, including without limitation the rights
|
|
14
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
16
|
-
* furnished to do so, subject to the following conditions:
|
|
17
|
-
*
|
|
18
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
19
|
-
* copies or substantial portions of the Software.
|
|
20
|
-
*
|
|
21
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
-
* SOFTWARE.
|
|
28
|
-
*
|
|
29
|
-
* Please keep this comment intact in order to properly abide by the MIT License.
|
|
30
|
-
*
|
|
31
|
-
**/
|
|
32
|
-
declare global {
|
|
33
|
-
interface Window {
|
|
34
|
-
detectIncognito: typeof detectIncognito;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
export declare function detectIncognito(): Promise<{
|
|
38
|
-
isPrivate: boolean;
|
|
39
|
-
browserName: string;
|
|
40
|
-
}>;
|
|
41
|
-
export default detectIncognito;
|
package/incognito.js
DELETED
|
@@ -1,239 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
export function detectIncognito() {
|
|
12
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
13
|
-
return yield new Promise(function (resolve, reject) {
|
|
14
|
-
let browserName = 'Unknown';
|
|
15
|
-
function __callback(isPrivate) {
|
|
16
|
-
resolve({
|
|
17
|
-
isPrivate,
|
|
18
|
-
browserName
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
function identifyChromium() {
|
|
22
|
-
const ua = navigator.userAgent;
|
|
23
|
-
if (ua.match(/Chrome/)) {
|
|
24
|
-
if (navigator.brave !== undefined) {
|
|
25
|
-
return 'Brave';
|
|
26
|
-
}
|
|
27
|
-
else if (ua.match(/Edg/)) {
|
|
28
|
-
return 'Edge';
|
|
29
|
-
}
|
|
30
|
-
else if (ua.match(/OPR/)) {
|
|
31
|
-
return 'Opera';
|
|
32
|
-
}
|
|
33
|
-
return 'Chrome';
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
return 'Chromium';
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
function assertEvalToString(value) {
|
|
40
|
-
return value === eval.toString().length;
|
|
41
|
-
}
|
|
42
|
-
function feid() {
|
|
43
|
-
let toFixedEngineID = 0;
|
|
44
|
-
let neg = parseInt("-1");
|
|
45
|
-
try {
|
|
46
|
-
neg.toFixed(neg);
|
|
47
|
-
}
|
|
48
|
-
catch (e) {
|
|
49
|
-
toFixedEngineID = e.message.length;
|
|
50
|
-
}
|
|
51
|
-
return toFixedEngineID;
|
|
52
|
-
}
|
|
53
|
-
function isSafari() {
|
|
54
|
-
return feid() === 44;
|
|
55
|
-
}
|
|
56
|
-
function isChrome() {
|
|
57
|
-
return feid() === 51;
|
|
58
|
-
}
|
|
59
|
-
function isFirefox() {
|
|
60
|
-
return feid() === 25;
|
|
61
|
-
}
|
|
62
|
-
function isMSIE() {
|
|
63
|
-
return (navigator.msSaveBlob !== undefined && assertEvalToString(39));
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Safari (Safari for iOS & macOS)
|
|
67
|
-
**/
|
|
68
|
-
function newSafariTestByStorageFallback() {
|
|
69
|
-
var _a;
|
|
70
|
-
if (!((_a = navigator.storage) === null || _a === void 0 ? void 0 : _a.estimate)) {
|
|
71
|
-
__callback(false);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
navigator.storage
|
|
75
|
-
.estimate()
|
|
76
|
-
.then(({ usage, quota }) => {
|
|
77
|
-
// iOS 18.x/macOS Safari 18.x (normal): ~41GB
|
|
78
|
-
// iOS 18.x/macOS Safari 18.x (private): ~1GB
|
|
79
|
-
// If reported quota < 2 GB => likely private
|
|
80
|
-
if (quota && quota < 2000000000) {
|
|
81
|
-
__callback(true);
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
__callback(false);
|
|
85
|
-
}
|
|
86
|
-
})
|
|
87
|
-
.catch(() => {
|
|
88
|
-
__callback(false);
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
function newSafariTest() {
|
|
92
|
-
const tmp_name = String(Math.random());
|
|
93
|
-
try {
|
|
94
|
-
const db = window.indexedDB.open(tmp_name, 1);
|
|
95
|
-
db.onupgradeneeded = function (i) {
|
|
96
|
-
var _a, _b;
|
|
97
|
-
const res = (_a = i.target) === null || _a === void 0 ? void 0 : _a.result;
|
|
98
|
-
try {
|
|
99
|
-
res.createObjectStore('test', {
|
|
100
|
-
autoIncrement: true
|
|
101
|
-
}).put(new Blob());
|
|
102
|
-
}
|
|
103
|
-
catch (e) {
|
|
104
|
-
let message = e;
|
|
105
|
-
if (e instanceof Error) {
|
|
106
|
-
message = (_b = e.message) !== null && _b !== void 0 ? _b : e;
|
|
107
|
-
}
|
|
108
|
-
if (typeof message !== 'string') {
|
|
109
|
-
__callback(false);
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
const matchesExpectedError = message.includes('BlobURLs are not yet supported');
|
|
113
|
-
if (matchesExpectedError) {
|
|
114
|
-
__callback(true);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
finally {
|
|
118
|
-
res.close();
|
|
119
|
-
window.indexedDB.deleteDatabase(tmp_name);
|
|
120
|
-
// indexdb works on newer versions of safari so we need to check via storage fallback
|
|
121
|
-
newSafariTestByStorageFallback();
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
catch (e) {
|
|
126
|
-
__callback(false);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
function oldSafariTest() {
|
|
130
|
-
const openDB = window.openDatabase;
|
|
131
|
-
const storage = window.localStorage;
|
|
132
|
-
try {
|
|
133
|
-
openDB(null, null, null, null);
|
|
134
|
-
}
|
|
135
|
-
catch (e) {
|
|
136
|
-
__callback(true);
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
try {
|
|
140
|
-
storage.setItem('test', '1');
|
|
141
|
-
storage.removeItem('test');
|
|
142
|
-
}
|
|
143
|
-
catch (e) {
|
|
144
|
-
__callback(true);
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
__callback(false);
|
|
148
|
-
}
|
|
149
|
-
function safariPrivateTest() {
|
|
150
|
-
if (navigator.maxTouchPoints !== undefined) {
|
|
151
|
-
newSafariTest();
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
oldSafariTest();
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Chrome
|
|
159
|
-
**/
|
|
160
|
-
function getQuotaLimit() {
|
|
161
|
-
const w = window;
|
|
162
|
-
if (w.performance !== undefined &&
|
|
163
|
-
w.performance.memory !== undefined &&
|
|
164
|
-
w.performance.memory.jsHeapSizeLimit !== undefined) {
|
|
165
|
-
return performance.memory.jsHeapSizeLimit;
|
|
166
|
-
}
|
|
167
|
-
return 1073741824;
|
|
168
|
-
}
|
|
169
|
-
// >= 76
|
|
170
|
-
function storageQuotaChromePrivateTest() {
|
|
171
|
-
navigator.webkitTemporaryStorage.queryUsageAndQuota(function (_, quota) {
|
|
172
|
-
const quotaInMib = Math.round(quota / (1024 * 1024));
|
|
173
|
-
const quotaLimitInMib = Math.round(getQuotaLimit() / (1024 * 1024)) * 2;
|
|
174
|
-
__callback(quotaInMib < quotaLimitInMib);
|
|
175
|
-
}, function (e) {
|
|
176
|
-
reject(new Error('detectIncognito somehow failed to query storage quota: ' +
|
|
177
|
-
e.message));
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
// 50 to 75
|
|
181
|
-
function oldChromePrivateTest() {
|
|
182
|
-
const fs = window.webkitRequestFileSystem;
|
|
183
|
-
const success = function () {
|
|
184
|
-
__callback(false);
|
|
185
|
-
};
|
|
186
|
-
const error = function () {
|
|
187
|
-
__callback(true);
|
|
188
|
-
};
|
|
189
|
-
fs(0, 1, success, error);
|
|
190
|
-
}
|
|
191
|
-
function chromePrivateTest() {
|
|
192
|
-
if (self.Promise !== undefined && self.Promise.allSettled !== undefined) {
|
|
193
|
-
storageQuotaChromePrivateTest();
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
oldChromePrivateTest();
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
/**
|
|
200
|
-
* Firefox
|
|
201
|
-
**/
|
|
202
|
-
function firefoxPrivateTest() {
|
|
203
|
-
__callback(navigator.serviceWorker === undefined);
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* MSIE
|
|
207
|
-
**/
|
|
208
|
-
function msiePrivateTest() {
|
|
209
|
-
__callback(window.indexedDB === undefined);
|
|
210
|
-
}
|
|
211
|
-
function main() {
|
|
212
|
-
if (isSafari()) {
|
|
213
|
-
browserName = 'Safari';
|
|
214
|
-
safariPrivateTest();
|
|
215
|
-
}
|
|
216
|
-
else if (isChrome()) {
|
|
217
|
-
browserName = identifyChromium();
|
|
218
|
-
chromePrivateTest();
|
|
219
|
-
}
|
|
220
|
-
else if (isFirefox()) {
|
|
221
|
-
browserName = 'Firefox';
|
|
222
|
-
firefoxPrivateTest();
|
|
223
|
-
}
|
|
224
|
-
else if (isMSIE()) {
|
|
225
|
-
browserName = 'Internet Explorer';
|
|
226
|
-
msiePrivateTest();
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
reject(new Error('detectIncognito cannot determine the browser'));
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
main();
|
|
233
|
-
});
|
|
234
|
-
});
|
|
235
|
-
}
|
|
236
|
-
if (typeof window !== 'undefined') {
|
|
237
|
-
window.detectIncognito = detectIncognito;
|
|
238
|
-
}
|
|
239
|
-
export default detectIncognito;
|