I'm trying to load InboxSDK inside a ContentScript like in the button example provided in InboxSDK's repo, but it doesn't load and no error related to InboxSDK gets printed in the console. I tried waiting for 5 minutes like suggested in an old discussion but I still see no error in the console. By inspecting Chromium's network tab in the developer tools, I see that it failed to load pageWorld.js, but I have no idea why. My code looks like this:
import * as InboxSDK from '@inboxsdk/core';
console.log("ContentScript loaded")
InboxSDK.load(2, "invalid app id").then((sdk) => {
console.log("InboxSDK finally loaded!!!")
// the SDK has been loaded, now do something with it!
sdk.Compose.registerComposeViewHandler((composeView) => {
// a compose view has come into existence, do something with it!
composeView.addButton({
title: "My Nifty Button!",
iconUrl:
"
https://lh5.googleusercontent.com/itq66nh65lfCick8cJ-OPuqZ8OUDTIxjCc25dkc4WUT1JG8XG3z6-eboCu63_uDXSqMnLRdlvQ=s128-h128-e365",
onClick(event) {
event.composeView.insertTextIntoBodyAtCursor("Hello World!");
},
});
});
}
).catch((error)=>
console.log("Error in loading InboxSDK: ", error))
If you need to inspect my manifest amd my WebPack configuration, you can find everything here:
https://github.com/GTP95/IRMA-Gmail-webextension/tree/UI_buttonThank you in advance for your help