diff --git a/app/scripts/background.ts b/app/scripts/background.ts index 072699b..d36eccc 100644 --- a/app/scripts/background.ts +++ b/app/scripts/background.ts @@ -17,7 +17,7 @@ chrome.runtime.onMessage.addListener(function (message: IExtensionMessage, sende let c = message.category.toString(); switch (c) { case 'allUsers': - chrome.tabs.query({ active: true }, function (tabs) { + chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) { chrome.tabs.sendMessage(tabs[0].id, { category: 'allUsers', type: 'Background', @@ -104,6 +104,7 @@ chrome.runtime.onMessage.addListener(function (message: IExtensionMessage, sende chrome.tabs.query( { active: true, + currentWindow: true }, function (tabs) { chrome.tabs.executeScript(tabs[0].id, { diff --git a/app/scripts/inject/levelup.servicecalls.ts b/app/scripts/inject/levelup.servicecalls.ts index 5935531..8ffa816 100644 --- a/app/scripts/inject/levelup.servicecalls.ts +++ b/app/scripts/inject/levelup.servicecalls.ts @@ -137,7 +137,7 @@ export class Service { allUsers() { const userId = - this.utility.Xrm?.Utility?.getGlobalContext()?.getUserId() ?? this.utility.Xrm.Page.context.getUserId(); + this.utility.Xrm?.Utility?.getGlobalContext?.().getUserId() ?? this.utility.Xrm.Page.context.getUserId(); this.utility .fetch( 'systemusers',