Skip to content

Commit

Permalink
Remove loadExtensionScripts
Browse files Browse the repository at this point in the history
  • Loading branch information
toasted-nutbread committed Dec 26, 2023
1 parent 42f17a8 commit e3914c2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
12 changes: 0 additions & 12 deletions ext/js/background/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ export class Backend {
['textHasJapaneseCharacters', this._onApiTextHasJapaneseCharacters.bind(this)],
['getTermFrequencies', this._onApiGetTermFrequencies.bind(this)],
['findAnkiNotes', this._onApiFindAnkiNotes.bind(this)],
['loadExtensionScripts', this._onApiLoadExtensionScripts.bind(this)],
['openCrossFramePort', this._onApiOpenCrossFramePort.bind(this)]
]);
/* eslint-enable no-multi-spaces */
Expand Down Expand Up @@ -846,17 +845,6 @@ export class Backend {
return await this._anki.findNotes(query);
}

/** @type {import('api').ApiHandler<'loadExtensionScripts'>} */
async _onApiLoadExtensionScripts({files}, sender) {
if (!sender || !sender.tab) { throw new Error('Invalid sender'); }
const tabId = sender.tab.id;
if (typeof tabId !== 'number') { throw new Error('Sender has invalid tab ID'); }
const {frameId} = sender;
for (const file of files) {
await this._scriptManager.injectScript(file, tabId, frameId, false);
}
}

/** @type {import('api').ApiHandler<'openCrossFramePort'>} */
_onApiOpenCrossFramePort({targetTabId, targetFrameId}, sender) {
const sourceTabId = (sender && sender.tab ? sender.tab.id : null);
Expand Down
8 changes: 0 additions & 8 deletions ext/js/comm/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,14 +354,6 @@ export class API {
return this._invoke('findAnkiNotes', {query});
}

/**
* @param {import('api').ApiParam<'loadExtensionScripts', 'files'>} files
* @returns {Promise<import('api').ApiReturn<'loadExtensionScripts'>>}
*/
loadExtensionScripts(files) {
return this._invoke('loadExtensionScripts', {files});
}

/**
* @param {import('api').ApiParam<'openCrossFramePort', 'targetTabId'>} targetTabId
* @param {import('api').ApiParam<'openCrossFramePort', 'targetFrameId'>} targetFrameId
Expand Down
6 changes: 0 additions & 6 deletions types/ext/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,12 +363,6 @@ type ApiSurface = {
};
return: Anki.NoteId[];
};
loadExtensionScripts: {
params: {
files: string[];
};
return: void;
};
openCrossFramePort: {
params: {
targetTabId: number;
Expand Down

0 comments on commit e3914c2

Please sign in to comment.