removing the tabs permission and reverting to window.postMessage (#524)

Co-authored-by: Salman Paracha <salmanparacha@MacBook-Pro-329.local>
This commit is contained in:
Salman Paracha 2025-07-11 12:07:32 -07:00 committed by GitHub
parent 5ea51c8cbd
commit 4e2355965b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 27 additions and 13 deletions

View file

@ -220,11 +220,10 @@ export default function PreferenceBasedModelSelector() {
console.log('[PBMS] Saved tuples:', tuples);
}
});
// Send message to background script to apply the default model
window.parent.postMessage({ action: 'applyModelSelection', model: defaultModel }, "*");
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
chrome.tabs.sendMessage(tabs[0].id, { action: 'applyModelSelection', model: defaultModel });
});
// Close the modal after saving
window.parent.postMessage({ action: 'CLOSE_PBMS_MODAL' }, '*');
};