aboutsummaryrefslogtreecommitdiff
path: root/ext/js/app/frontend.js
diff options
context:
space:
mode:
authorJames Maa <jmaa@berkeley.edu>2024-05-31 08:06:52 -0700
committerGitHub <noreply@github.com>2024-05-31 15:06:52 +0000
commit76ca08bd59f0e8bfa1bb20ac813f48e7ab241265 (patch)
treebdba43d9ba704885383c7f308c6fe3f574c647c5 /ext/js/app/frontend.js
parentb3f54747eb2694bdc90bce72e5532e99d374ef08 (diff)
Allow trailing commas in ESLint (#1013)
* Update comma-dangle rule * Fix dangling commas
Diffstat (limited to 'ext/js/app/frontend.js')
-rw-r--r--ext/js/app/frontend.js38
1 files changed, 19 insertions, 19 deletions
diff --git a/ext/js/app/frontend.js b/ext/js/app/frontend.js
index c856ae0f..39176475 100644
--- a/ext/js/app/frontend.js
+++ b/ext/js/app/frontend.js
@@ -45,7 +45,7 @@ export class Frontend {
canUseWindowPopup = true,
allowRootFramePopupProxy,
childrenSupported = true,
- hotkeyHandler
+ hotkeyHandler,
}) {
/** @type {import('../application.js').Application} */
this._application = application;
@@ -92,7 +92,7 @@ export class Frontend {
getSearchContext: this._getSearchContext.bind(this),
searchTerms: true,
searchKanji: true,
- textSourceGenerator: this._textSourceGenerator
+ textSourceGenerator: this._textSourceGenerator,
});
/** @type {boolean} */
this._textScannerHasBeenEnabled = false;
@@ -114,13 +114,13 @@ export class Frontend {
this._runtimeApiMap = createApiMap([
['frontendRequestReadyBroadcast', this._onMessageRequestFrontendReadyBroadcast.bind(this)],
['frontendSetAllVisibleOverride', this._onApiSetAllVisibleOverride.bind(this)],
- ['frontendClearAllVisibleOverride', this._onApiClearAllVisibleOverride.bind(this)]
+ ['frontendClearAllVisibleOverride', this._onApiClearAllVisibleOverride.bind(this)],
]);
this._hotkeyHandler.registerActions([
['scanSelectedText', this._onActionScanSelectedText.bind(this)],
['scanTextAtSelection', this._onActionScanTextAtSelection.bind(this)],
- ['scanTextAtCaret', this._onActionScanTextAtCaret.bind(this)]
+ ['scanTextAtCaret', this._onActionScanTextAtCaret.bind(this)],
]);
/* eslint-enable @stylistic/no-multi-spaces */
}
@@ -188,7 +188,7 @@ export class Frontend {
['frontendCopySelection', this._onApiCopySelection.bind(this)],
['frontendGetSelectionText', this._onApiGetSelectionText.bind(this)],
['frontendGetPopupInfo', this._onApiGetPopupInfo.bind(this)],
- ['frontendGetPageInfo', this._onApiGetPageInfo.bind(this)]
+ ['frontendGetPageInfo', this._onApiGetPageInfo.bind(this)],
]);
/* eslint-enable @stylistic/no-multi-spaces */
@@ -296,7 +296,7 @@ export class Frontend {
/** @type {import('cross-frame-api').ApiHandler<'frontendGetPopupInfo'>} */
_onApiGetPopupInfo() {
return {
- popupId: (this._popup !== null ? this._popup.id : null)
+ popupId: (this._popup !== null ? this._popup.id : null),
};
}
@@ -304,7 +304,7 @@ export class Frontend {
_onApiGetPageInfo() {
return {
url: window.location.href,
- documentTitle: document.title
+ documentTitle: document.title,
};
}
@@ -501,7 +501,7 @@ export class Frontend {
layoutAwareScan: scanningOptions.layoutAwareScan,
matchTypePrefix: scanningOptions.matchTypePrefix,
preventMiddleMouse,
- sentenceParsingOptions
+ sentenceParsingOptions,
});
this._updateTextScannerEnabled();
@@ -605,7 +605,7 @@ export class Frontend {
return await this._popupFactory.getOrCreatePopup({
frameId,
depth: this._depth,
- childrenSupported: this._childrenSupported
+ childrenSupported: this._childrenSupported,
});
}
@@ -617,7 +617,7 @@ export class Frontend {
frameId: this._parentFrameId,
depth: this._depth,
parentPopupId: this._parentPopupId,
- childrenSupported: this._childrenSupported
+ childrenSupported: this._childrenSupported,
});
}
@@ -641,7 +641,7 @@ export class Frontend {
const popup = await this._popupFactory.getOrCreatePopup({
frameId: targetFrameId,
id: popupId,
- childrenSupported: this._childrenSupported
+ childrenSupported: this._childrenSupported,
});
popup.on('offsetNotFound', () => {
this._allowRootFramePopupProxy = false;
@@ -657,7 +657,7 @@ export class Frontend {
return await this._popupFactory.getOrCreatePopup({
depth: this._depth,
popupWindow: true,
- childrenSupported: this._childrenSupported
+ childrenSupported: this._childrenSupported,
});
}
@@ -713,14 +713,14 @@ export class Frontend {
const detailsState = {
focusEntry: 0,
optionsContext,
- url
+ url,
};
if (sentence !== null) { detailsState.sentence = sentence; }
if (documentTitle !== null) { detailsState.documentTitle = documentTitle; }
const {tabId, frameId} = this._application;
/** @type {import('display').HistoryContent} */
const detailsContent = {
- contentOrigin: {tabId, frameId}
+ contentOrigin: {tabId, frameId},
};
if (dictionaryEntries !== null) {
detailsContent.dictionaryEntries = dictionaryEntries;
@@ -732,10 +732,10 @@ export class Frontend {
params: {
type,
query,
- wildcards: 'off'
+ wildcards: 'off',
},
state: detailsState,
- content: detailsContent
+ content: detailsContent,
};
if (textSource instanceof TextSourceElement && textSource.fullContent !== query) {
details.params.full = textSource.fullContent;
@@ -761,9 +761,9 @@ export class Frontend {
{
optionsContext,
sourceRects,
- writingMode: textSource.getWritingMode()
+ writingMode: textSource.getWritingMode(),
},
- details
+ details,
) :
Promise.resolve()
);
@@ -927,7 +927,7 @@ export class Frontend {
return {
optionsContext,
- detail: {documentTitle}
+ detail: {documentTitle},
};
}