Do you wait on any async code before initializing the example object? When your service worker wakes up after an event is fired, it is possible the code in the event listener referencing the example object will run first if that is the case. For example:
var example = {};
chrome.tabs.onCreated.addListener((tab) => {
if (example.isTrue(
tab.id)) {
// this may run before the isTrue key is added to the example object.
}
});
async function initialize() {
let lStorage = await chrome.storage.local.get();
example.isTrue = (x) => !!x;
}
initialize();