From 61cb3f93173530b0bd27ea6694df936ab7244b75 Mon Sep 17 00:00:00 2001 From: Natraj Yegnaraman Date: Thu, 23 Mar 2023 19:07:59 +0000 Subject: [PATCH] bump package version --- app/manifest.json | 2 +- app/pages/options.html | 2 +- app/scripts/background.ts | 106 +++++++++++++++++--------------------- app/scripts/options.ts | 7 --- package.json | 2 +- 5 files changed, 49 insertions(+), 70 deletions(-) diff --git a/app/manifest.json b/app/manifest.json index ba4fe24..2c47de7 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -49,6 +49,6 @@ ] } ], - "version": "3.6.3", + "version": "3.6.4", "manifest_version": 3 } \ No newline at end of file diff --git a/app/pages/options.html b/app/pages/options.html index 17b435c..312556c 100644 --- a/app/pages/options.html +++ b/app/pages/options.html @@ -76,7 +76,7 @@ diff --git a/app/scripts/background.ts b/app/scripts/background.ts index 53838a1..f170823 100644 --- a/app/scripts/background.ts +++ b/app/scripts/background.ts @@ -65,69 +65,55 @@ chrome.runtime.onMessage.addListener(async function ( if (impersonationResponse.users.length === 0 || !impersonationResponse.impersonateRequest.canImpersonate) return; - if (impersonationResponse.users.length > 1) { - chrome.runtime.sendMessage({ - type: 'search', - category: 'Impersonation', - content: impersonationResponse.users, - }); - } else { - userId = impersonationResponse.users[0].userId; - - chrome.storage.local.set({ - [impersonationResponse.impersonateRequest.url]: { - isImpersonationActive: impersonationResponse.impersonateRequest.isActive, - userName: impersonationResponse.impersonateRequest.userName, - userFullName: impersonationResponse.users[0].fullName, - }, - }); - if (impersonationResponse.impersonateRequest.isActive) { - chrome.declarativeNetRequest.updateDynamicRules( - { - removeRuleIds: [1], - addRules: [ - { - id: 1, - priority: 1, - action: { - type: chrome.declarativeNetRequest.RuleActionType.MODIFY_HEADERS, - requestHeaders: [ - { - header: 'CallerObjectId', - operation: chrome.declarativeNetRequest.HeaderOperation.SET, - value: userId, - }, - ], - }, - condition: { - regexFilter: `${impersonationResponse.impersonateRequest.url}api/*`, - resourceTypes: [ - chrome.declarativeNetRequest.ResourceType.MAIN_FRAME, - chrome.declarativeNetRequest.ResourceType.SUB_FRAME, - chrome.declarativeNetRequest.ResourceType.XMLHTTPREQUEST, - ], - }, + chrome.runtime.sendMessage({ + type: 'search', + category: 'Impersonation', + content: impersonationResponse.users, + }); + if (impersonationResponse.impersonateRequest.isActive) { + chrome.declarativeNetRequest.updateDynamicRules( + { + removeRuleIds: [1], + addRules: [ + { + id: 1, + priority: 1, + action: { + type: chrome.declarativeNetRequest.RuleActionType.MODIFY_HEADERS, + requestHeaders: [ + { + header: 'CallerObjectId', + operation: chrome.declarativeNetRequest.HeaderOperation.SET, + value: userId, + }, + ], }, - ], - }, - async () => { - renderBadge(impersonationResponse.impersonateRequest.url); - } - ); - } else { - chrome.declarativeNetRequest.getDynamicRules((rules) => { - const ruleIds = rules.map((x) => x.id); - chrome.declarativeNetRequest.updateDynamicRules({ - removeRuleIds: ruleIds, - }); + condition: { + regexFilter: `${impersonationResponse.impersonateRequest.url}api/*`, + resourceTypes: [ + chrome.declarativeNetRequest.ResourceType.MAIN_FRAME, + chrome.declarativeNetRequest.ResourceType.SUB_FRAME, + chrome.declarativeNetRequest.ResourceType.XMLHTTPREQUEST, + ], + }, + }, + ], + }, + async () => { + renderBadge(impersonationResponse.impersonateRequest.url); + } + ); + } else { + chrome.declarativeNetRequest.getDynamicRules((rules) => { + const ruleIds = rules.map((x) => x.id); + chrome.declarativeNetRequest.updateDynamicRules({ + removeRuleIds: ruleIds, }); - chrome.storage.local.clear(); - } - const [tab] = await chrome.tabs.query({ active: true, currentWindow: true }); - if (tab) chrome.tabs.reload(tab.id, { bypassCache: true }); + }); + chrome.storage.local.clear(); } - break; - default: + const [tab] = await chrome.tabs.query({ active: true, currentWindow: true }); + if (tab) chrome.tabs.reload(tab.id, { bypassCache: true }); break; } } else if (message.type === 'reset') { diff --git a/app/scripts/options.ts b/app/scripts/options.ts index bc86b59..0154956 100644 --- a/app/scripts/options.ts +++ b/app/scripts/options.ts @@ -4,13 +4,6 @@ window.addEventListener('DOMContentLoaded', function () { const extensionVersion = chrome.runtime.getManifest().version; document.getElementById('version').innerHTML = `v${extensionVersion}`; - const bodyText = encodeURIComponent(` - Browser Version: ${navigator} - Extension Version: ${extensionVersion} - ---------------------------------------------------------- - [DESCRIBE ISSUE HERE]`); - const issueUrl = `https://github.com/rajyraman/Levelup-for-Dynamics-CRM/issues/new?body=${bodyText}`; - (document.getElementById('issueUrl')).href = issueUrl; document.querySelector('#resetImpersonationButton').addEventListener('click', function (e) { chrome.runtime.sendMessage({ category: 'Impersonation', diff --git a/package.json b/package.json index 3e3440c..e5d1f53 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "levelup-for-dynamics-365-power-apps", "private": true, - "version": "3.6.3", + "version": "3.6.4", "description": "Quickly perform advanced/hidden actions in Dynamics 365/Power Apps, without bookmarklets.", "scripts": { "start": "npm run dev:chrome",