@inboxsdk/core 2.0.3 → 2.1.1
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/inboxsdk.js +136 -78
- package/inboxsdk.js.map +1 -1
- package/package.json +1 -1
- package/pageWorld.js +30 -0
- package/pageWorld.js.map +1 -1
- package/src/inboxsdk.d.ts +3 -8
- package/src/injected-js/gmail/setup-gmail-interceptor.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/getPersonDetails.d.ts +5 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver/getPersonDetails.d.ts.map +1 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.d.ts +2 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-driver.d.ts.map +1 -1
- package/src/platform-implementation-js/dom-driver/gmail/gmail-page-communicator.d.ts +3 -0
- package/src/platform-implementation-js/dom-driver/gmail/gmail-page-communicator.d.ts.map +1 -1
- package/src/platform-implementation-js/namespaces/user.d.ts +18 -7
- package/src/platform-implementation-js/namespaces/user.d.ts.map +1 -1
package/package.json
CHANGED
package/pageWorld.js
CHANGED
|
@@ -2864,6 +2864,36 @@ function setupGmailInterceptorOnFrames(mainFrame, jsFrame) {
|
|
|
2864
2864
|
}
|
|
2865
2865
|
});
|
|
2866
2866
|
}
|
|
2867
|
+
|
|
2868
|
+
// Google API request header values
|
|
2869
|
+
{
|
|
2870
|
+
// harcoding a value observed across multiple accounts to start with.
|
|
2871
|
+
// Will be updated when we see a request, in case Gmail has changed it.
|
|
2872
|
+
let googleApiKey = 'AIzaSyBm7aDMG9actsWSlx-MvrYsepwdnLgz69I';
|
|
2873
|
+
document.addEventListener('inboxSDKgetGoogleRequestHeaders', () => {
|
|
2874
|
+
const authorizationHeader = window.gapi.auth.getAuthHeaderValueForFirstParty([]);
|
|
2875
|
+
const headers = {
|
|
2876
|
+
authorization: authorizationHeader,
|
|
2877
|
+
'x-goog-api-key': googleApiKey
|
|
2878
|
+
};
|
|
2879
|
+
document.head.setAttribute('data-inboxsdk-google-headers', JSON.stringify(headers));
|
|
2880
|
+
});
|
|
2881
|
+
main_wrappers.push({
|
|
2882
|
+
isRelevantTo(connection) {
|
|
2883
|
+
// check for absolute URLs going to a google domain
|
|
2884
|
+
if (connection.url.startsWith('https://')) {
|
|
2885
|
+
const url = new URL(connection.url);
|
|
2886
|
+
return url.hostname.endsWith('.google.com');
|
|
2887
|
+
}
|
|
2888
|
+
return false;
|
|
2889
|
+
},
|
|
2890
|
+
originalSendBodyLogger(connection) {
|
|
2891
|
+
if (connection.headers['X-Goog-Api-Key']) {
|
|
2892
|
+
googleApiKey = connection.headers['X-Goog-Api-Key'];
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
});
|
|
2896
|
+
}
|
|
2867
2897
|
}
|
|
2868
2898
|
function triggerEvent(detail) {
|
|
2869
2899
|
document.dispatchEvent(new CustomEvent('inboxSDKajaxIntercept', {
|