mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 08:43:33 +00:00
[PS-816] Add Autofill Shortcut to MV3 Extension (#3131)
* Work on background service worker. * Work on shortcuts * Work on supporting service worker * Put new background behind version check * Fix build * Use new storage service * create commands from crypto service (#2995) * Work on service worker autofill * Got basic autofill working * Final touches * Work on tests * Revert some changes * Add modifications * Remove unused ciphers for now * Cleanup * Address PR feedback * Update lock file * Update noop service * Add chrome type * Handle "/" in branch names Updates web workflow to handle the `/` in branch names when it's a PR. * Remove any Co-authored-by: Jake Fink <jfink@bitwarden.com> Co-authored-by: Micaiah Martin <77340197+mimartin12@users.noreply.github.com>
This commit is contained in:
@@ -11,6 +11,8 @@ import { CipherView } from "../models/view/cipherView";
|
||||
import { SendView } from "../models/view/sendView";
|
||||
|
||||
export class SearchService implements SearchServiceAbstraction {
|
||||
private static registeredPipeline = false;
|
||||
|
||||
indexedEntityId?: string = null;
|
||||
private indexing = false;
|
||||
private index: lunr.Index = null;
|
||||
@@ -31,8 +33,13 @@ export class SearchService implements SearchServiceAbstraction {
|
||||
}
|
||||
});
|
||||
|
||||
//register lunr pipeline function
|
||||
lunr.Pipeline.registerFunction(this.normalizeAccentsPipelineFunction, "normalizeAccents");
|
||||
// Currently have to ensure this is only done a single time. Lunr allows you to register a function
|
||||
// multiple times but they will add a warning message to the console. The way they do that breaks when ran on a service worker.
|
||||
if (!SearchService.registeredPipeline) {
|
||||
SearchService.registeredPipeline = true;
|
||||
//register lunr pipeline function
|
||||
lunr.Pipeline.registerFunction(this.normalizeAccentsPipelineFunction, "normalizeAccents");
|
||||
}
|
||||
}
|
||||
|
||||
clearIndex(): void {
|
||||
@@ -54,7 +61,6 @@ export class SearchService implements SearchServiceAbstraction {
|
||||
return;
|
||||
}
|
||||
|
||||
this.logService.time("search indexing");
|
||||
this.indexing = true;
|
||||
this.indexedEntityId = indexedEntityId;
|
||||
this.index = null;
|
||||
@@ -95,7 +101,7 @@ export class SearchService implements SearchServiceAbstraction {
|
||||
|
||||
this.indexing = false;
|
||||
|
||||
this.logService.timeEnd("search indexing");
|
||||
this.logService.info("Finished search indexing");
|
||||
}
|
||||
|
||||
async searchCiphers(
|
||||
|
||||
Reference in New Issue
Block a user