aboutsummaryrefslogtreecommitdiff
path: root/ext/js/comm
diff options
context:
space:
mode:
authorDarius Jahandarie <djahandarie@gmail.com>2023-11-12 11:19:43 +0900
committerGitHub <noreply@github.com>2023-11-12 11:19:43 +0900
commit47b4d79e646a990699a1a4ca1da559a4aeec1c91 (patch)
treec33f61ba85354f18c68d4a054baa30ff0c41c153 /ext/js/comm
parent9162d950eb2b3aa0339d95a98a60be89b8315f26 (diff)
parentd06029ea8c4244f40f9ddfeec5154f9ef2a4c053 (diff)
Merge branch 'master' into offscreen-db
Diffstat (limited to 'ext/js/comm')
-rw-r--r--ext/js/comm/api.js6
-rw-r--r--ext/js/comm/cross-frame-api.js6
-rw-r--r--ext/js/comm/frame-ancestry-handler.js8
-rw-r--r--ext/js/comm/frame-endpoint.js6
-rw-r--r--ext/js/comm/frame-offset-forwarder.js6
-rw-r--r--ext/js/comm/mecab.js8
6 files changed, 20 insertions, 20 deletions
diff --git a/ext/js/comm/api.js b/ext/js/comm/api.js
index 8e5cd5cc..05f95464 100644
--- a/ext/js/comm/api.js
+++ b/ext/js/comm/api.js
@@ -19,8 +19,8 @@
import {deferPromise, deserializeError, isObject} from '../core.js';
export class API {
- constructor(yomichan) {
- this._yomichan = yomichan;
+ constructor(yomitan) {
+ this._yomitan = yomitan;
}
optionsGet(optionsContext) {
@@ -299,7 +299,7 @@ export class API {
const data = {action, params};
return new Promise((resolve, reject) => {
try {
- this._yomichan.sendMessage(data, (response) => {
+ this._yomitan.sendMessage(data, (response) => {
this._checkLastError(chrome.runtime.lastError);
if (response !== null && typeof response === 'object') {
if (typeof response.error !== 'undefined') {
diff --git a/ext/js/comm/cross-frame-api.js b/ext/js/comm/cross-frame-api.js
index c7d9ae68..fe220f21 100644
--- a/ext/js/comm/cross-frame-api.js
+++ b/ext/js/comm/cross-frame-api.js
@@ -17,7 +17,7 @@
*/
import {EventDispatcher, EventListenerCollection, deserializeError, invokeMessageHandler, log, serializeError} from '../core.js';
-import {yomichan} from '../yomichan.js';
+import {yomitan} from '../yomitan.js';
class CrossFrameAPIPort extends EventDispatcher {
constructor(otherTabId, otherFrameId, port, messageHandlers) {
@@ -233,7 +233,7 @@ export class CrossFrameAPI {
async prepare() {
chrome.runtime.onConnect.addListener(this._onConnect.bind(this));
- ({tabId: this._tabId, frameId: this._frameId} = await yomichan.api.frameInformationGet());
+ ({tabId: this._tabId, frameId: this._frameId} = await yomitan.api.frameInformationGet());
}
invoke(targetFrameId, action, params={}) {
@@ -304,7 +304,7 @@ export class CrossFrameAPI {
}
async _createCommPort(otherTabId, otherFrameId) {
- await yomichan.api.openCrossFramePort(otherTabId, otherFrameId);
+ await yomitan.api.openCrossFramePort(otherTabId, otherFrameId);
const tabPorts = this._commPorts.get(otherTabId);
if (typeof tabPorts !== 'undefined') {
diff --git a/ext/js/comm/frame-ancestry-handler.js b/ext/js/comm/frame-ancestry-handler.js
index 1934c4ac..eeefac3f 100644
--- a/ext/js/comm/frame-ancestry-handler.js
+++ b/ext/js/comm/frame-ancestry-handler.js
@@ -17,7 +17,7 @@
*/
import {generateId} from '../core.js';
-import {yomichan} from '../yomichan.js';
+import {yomitan} from '../yomitan.js';
/**
* This class is used to return the ancestor frame IDs for the current frame.
@@ -118,7 +118,7 @@ export class FrameAncestryHandler {
clearTimeout(timer);
timer = null;
}
- yomichan.crossFrame.unregisterHandler(responseMessageId);
+ yomitan.crossFrame.unregisterHandler(responseMessageId);
};
const onMessage = (params) => {
if (params.nonce !== nonce) { return null; }
@@ -148,7 +148,7 @@ export class FrameAncestryHandler {
};
// Start
- yomichan.crossFrame.registerHandlers([[responseMessageId, {async: false, handler: onMessage}]]);
+ yomitan.crossFrame.registerHandlers([[responseMessageId, {async: false, handler: onMessage}]]);
resetTimeout();
const frameId = this._frameId;
this._requestFrameInfo(targetWindow, frameId, frameId, uniqueId, nonce);
@@ -187,7 +187,7 @@ export class FrameAncestryHandler {
const responseMessageId = `${this._responseMessageIdBase}${uniqueId}`;
try {
- const response = await yomichan.crossFrame.invoke(originFrameId, responseMessageId, responseParams);
+ const response = await yomitan.crossFrame.invoke(originFrameId, responseMessageId, responseParams);
if (response === null) { return; }
nonce = response.nonce;
} catch (e) {
diff --git a/ext/js/comm/frame-endpoint.js b/ext/js/comm/frame-endpoint.js
index 0e8a5c00..5555e60f 100644
--- a/ext/js/comm/frame-endpoint.js
+++ b/ext/js/comm/frame-endpoint.js
@@ -17,7 +17,7 @@
*/
import {EventListenerCollection, generateId, isObject} from '../core.js';
-import {yomichan} from '../yomichan.js';
+import {yomitan} from '../yomitan.js';
export class FrameEndpoint {
constructor() {
@@ -32,7 +32,7 @@ export class FrameEndpoint {
this._eventListeners.addEventListener(window, 'message', this._onMessage.bind(this), false);
this._eventListenersSetup = true;
}
- yomichan.api.broadcastTab('frameEndpointReady', {secret: this._secret});
+ yomitan.api.broadcastTab('frameEndpointReady', {secret: this._secret});
}
authenticate(message) {
@@ -60,6 +60,6 @@ export class FrameEndpoint {
this._token = token;
this._eventListeners.removeAllEventListeners();
- yomichan.api.sendMessageToFrame(hostFrameId, 'frameEndpointConnected', {secret, token});
+ yomitan.api.sendMessageToFrame(hostFrameId, 'frameEndpointConnected', {secret, token});
}
}
diff --git a/ext/js/comm/frame-offset-forwarder.js b/ext/js/comm/frame-offset-forwarder.js
index 5eea2ba6..ef75f1d0 100644
--- a/ext/js/comm/frame-offset-forwarder.js
+++ b/ext/js/comm/frame-offset-forwarder.js
@@ -16,7 +16,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
-import {yomichan} from '../yomichan.js';
+import {yomitan} from '../yomitan.js';
import {FrameAncestryHandler} from './frame-ancestry-handler.js';
export class FrameOffsetForwarder {
@@ -27,7 +27,7 @@ export class FrameOffsetForwarder {
prepare() {
this._frameAncestryHandler.prepare();
- yomichan.crossFrame.registerHandlers([
+ yomitan.crossFrame.registerHandlers([
['FrameOffsetForwarder.getChildFrameRect', {async: false, handler: this._onMessageGetChildFrameRect.bind(this)}]
]);
}
@@ -43,7 +43,7 @@ export class FrameOffsetForwarder {
let childFrameId = this._frameId;
const promises = [];
for (const frameId of ancestorFrameIds) {
- promises.push(yomichan.crossFrame.invoke(frameId, 'FrameOffsetForwarder.getChildFrameRect', {frameId: childFrameId}));
+ promises.push(yomitan.crossFrame.invoke(frameId, 'FrameOffsetForwarder.getChildFrameRect', {frameId: childFrameId}));
childFrameId = frameId;
}
diff --git a/ext/js/comm/mecab.js b/ext/js/comm/mecab.js
index 50f13ddf..c7314605 100644
--- a/ext/js/comm/mecab.js
+++ b/ext/js/comm/mecab.js
@@ -19,7 +19,7 @@
import {EventListenerCollection} from '../core.js';
/**
- * This class is used to connect Yomichan to a native component that is
+ * This class is used to connect Yomitan to a native component that is
* used to parse text into individual terms.
*/
export class Mecab {
@@ -99,7 +99,7 @@ export class Mecab {
/**
* Gets the local API version being used.
- * @returns {number} An integer representing the API version that Yomichan uses.
+ * @returns {number} An integer representing the API version that Yomitan uses.
*/
getLocalVersion() {
return this._version;
@@ -219,7 +219,7 @@ export class Mecab {
}
async _setupPort2() {
- const port = chrome.runtime.connectNative('yomichan_mecab');
+ const port = chrome.runtime.connectNative('yomitan_mecab');
this._eventListeners.addListener(port.onMessage, this._onMessage.bind(this));
this._eventListeners.addListener(port.onDisconnect, this._onDisconnect.bind(this));
this._port = port;
@@ -228,7 +228,7 @@ export class Mecab {
const {version} = await this._invoke('get_version', {});
this._remoteVersion = version;
if (version !== this._version) {
- throw new Error(`Unsupported MeCab native messenger version ${version}. Yomichan supports version ${this._version}.`);
+ throw new Error(`Unsupported MeCab native messenger version ${version}. Yomitan supports version ${this._version}.`);
}
} catch (e) {
if (this._port === port) {