[PM-4011] Remove Autofill Injection in All Frames (#6348)
* [PM-4011] Remove Autofill Injection in All Frames * [PM-4011] Adding jest tests for the fix
This commit is contained in:
parent
9e8a67f3bb
commit
f0526296e4
|
@ -75,7 +75,7 @@ describe("AutofillService", () => {
|
|||
const autofillV1Script = "autofill.js";
|
||||
const autofillV2Script = "autofill-init.js";
|
||||
const defaultAutofillScripts = ["autofiller.js", "notificationBar.js", "contextMenuHandler.js"];
|
||||
const defaultExecuteScriptOptions = { allFrames: true, runAt: "document_start" };
|
||||
const defaultExecuteScriptOptions = { runAt: "document_start" };
|
||||
let tabMock: chrome.tabs.Tab;
|
||||
let sender: chrome.runtime.MessageSender;
|
||||
|
||||
|
@ -91,11 +91,13 @@ describe("AutofillService", () => {
|
|||
[autofillV1Script, ...defaultAutofillScripts].forEach((scriptName) => {
|
||||
expect(BrowserApi.executeScriptInTab).toHaveBeenCalledWith(tabMock.id, {
|
||||
file: `content/${scriptName}`,
|
||||
frameId: sender.frameId,
|
||||
...defaultExecuteScriptOptions,
|
||||
});
|
||||
});
|
||||
expect(BrowserApi.executeScriptInTab).not.toHaveBeenCalledWith(tabMock.id, {
|
||||
file: `content/${autofillV2Script}`,
|
||||
frameId: sender.frameId,
|
||||
...defaultExecuteScriptOptions,
|
||||
});
|
||||
});
|
||||
|
|
|
@ -62,7 +62,7 @@ export default class AutofillService implements AutofillServiceInterface {
|
|||
for (const injectedScript of injectedScripts) {
|
||||
await BrowserApi.executeScriptInTab(sender.tab.id, {
|
||||
file: `content/${injectedScript}`,
|
||||
allFrames: true,
|
||||
frameId: sender.frameId,
|
||||
runAt: "document_start",
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue