summaryrefslogtreecommitdiff
path: root/ext/js/accessibility/accessibility-controller.js
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/accessibility/accessibility-controller.js')
-rw-r--r--ext/js/accessibility/accessibility-controller.js17
1 files changed, 14 insertions, 3 deletions
diff --git a/ext/js/accessibility/accessibility-controller.js b/ext/js/accessibility/accessibility-controller.js
index e9a24880..8250b369 100644
--- a/ext/js/accessibility/accessibility-controller.js
+++ b/ext/js/accessibility/accessibility-controller.js
@@ -16,7 +16,6 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import {ScriptManager} from '../background/script-manager.js';
import {log} from '../core.js';
/**
@@ -25,18 +24,22 @@ import {log} from '../core.js';
export class AccessibilityController {
/**
* Creates a new instance.
- * @param {ScriptManager} scriptManager An instance of the `ScriptManager` class.
+ * @param {import('../background/script-manager.js').ScriptManager} scriptManager An instance of the `ScriptManager` class.
*/
constructor(scriptManager) {
+ /** @type {import('../background/script-manager.js').ScriptManager} */
this._scriptManager = scriptManager;
+ /** @type {?import('core').TokenObject} */
this._updateGoogleDocsAccessibilityToken = null;
+ /** @type {?Promise<void>} */
this._updateGoogleDocsAccessibilityPromise = null;
+ /** @type {boolean} */
this._forceGoogleDocsHtmlRenderingAny = false;
}
/**
* Updates the accessibility handlers.
- * @param {object} fullOptions The full options object from the `Backend` instance.
+ * @param {import('settings').Options} fullOptions The full options object from the `Backend` instance.
* The value is treated as read-only and is not modified.
*/
async update(fullOptions) {
@@ -53,8 +56,12 @@ export class AccessibilityController {
// Private
+ /**
+ * @param {boolean} forceGoogleDocsHtmlRenderingAny
+ */
async _updateGoogleDocsAccessibility(forceGoogleDocsHtmlRenderingAny) {
// Reentrant token
+ /** @type {?import('core').TokenObject} */
const token = {};
this._updateGoogleDocsAccessibilityToken = token;
@@ -72,6 +79,9 @@ export class AccessibilityController {
this._updateGoogleDocsAccessibilityPromise = null;
}
+ /**
+ * @param {boolean} forceGoogleDocsHtmlRenderingAny
+ */
async _updateGoogleDocsAccessibilityInner(forceGoogleDocsHtmlRenderingAny) {
if (this._forceGoogleDocsHtmlRenderingAny === forceGoogleDocsHtmlRenderingAny) { return; }
@@ -81,6 +91,7 @@ export class AccessibilityController {
try {
if (forceGoogleDocsHtmlRenderingAny) {
if (await this._scriptManager.isContentScriptRegistered(id)) { return; }
+ /** @type {import('script-manager').RegistrationDetails} */
const details = {
allFrames: true,
matchAboutBlank: true,