Skip to content

Commit

Permalink
AG-27583 improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
maximtop committed Nov 19, 2024
1 parent 9b7d12e commit 0507368
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,12 @@ export class TabsCosmeticInjector {
*/
const TAB_PROCESSING_THRESHOLD_MS = 10000;

// TODO: Instead of this, it’s better to use the runtime.onStartup and runtime.onInstalled
// events to inject cosmetics once during the extension's initialization and browser startup.
// However, this would require big refactoring of the extension.
/**
* This condition prevents applying cosmetic rules to the tab multiple times.
* Applying them once after the extension's initialization is sufficient.
* TODO: it would be better to use chrome.runtime.onStartup and chrome.runtime.onInstalled events.
*/
if (appContext.startTimeMs && Date.now() - appContext.startTimeMs > TAB_PROCESSING_THRESHOLD_MS) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,12 @@ export class TabsCosmeticInjector {
*/
const TAB_PROCESSING_THRESHOLD_MS = 10000;

// TODO: Instead of this, it’s better to use the runtime.onStartup and runtime.onInstalled
// events to inject cosmetics once during the extension's initialization and browser startup.
// However, this would require big refactoring of the extension.
/**
* This condition prevents applying cosmetic rules to the tab multiple times.
* Applying them once after the extension's initialization is enough.
* TODO: it would be better to use chrome.runtime.onStartup and chrome.runtime.onInstalled events.
*/
if (appContext.startTimeMs && currentTime - appContext.startTimeMs > TAB_PROCESSING_THRESHOLD_MS) {
return;
Expand Down

0 comments on commit 0507368

Please sign in to comment.