Fix chrome.runtime.manifest failing when extension is reloaded (#646)
This commit is contained in:
parent
bc6d855f3d
commit
af4dc49074
|
@ -39,6 +39,14 @@ const yomichan = (() => {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
|
this._extensionName = 'Yomichan';
|
||||||
|
try {
|
||||||
|
const manifest = chrome.runtime.getManifest();
|
||||||
|
this._extensionName = `${manifest.name} v${manifest.version}`;
|
||||||
|
} catch (e) {
|
||||||
|
// NOP
|
||||||
|
}
|
||||||
|
|
||||||
const {promise, resolve} = deferPromise();
|
const {promise, resolve} = deferPromise();
|
||||||
this._isBackendPreparedPromise = promise;
|
this._isBackendPreparedPromise = promise;
|
||||||
this._isBackendPreparedPromiseResolve = resolve;
|
this._isBackendPreparedPromiseResolve = resolve;
|
||||||
|
@ -163,8 +171,7 @@ const yomichan = (() => {
|
||||||
errorString += `\n${errorStack}`;
|
errorString += `\n${errorStack}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const manifest = chrome.runtime.getManifest();
|
let message = `${this._extensionName} has encountered a problem.`;
|
||||||
let message = `${manifest.name} v${manifest.version} has encountered a problem.`;
|
|
||||||
message += `\nOriginating URL: ${context.url}\n`;
|
message += `\nOriginating URL: ${context.url}\n`;
|
||||||
message += errorString;
|
message += errorString;
|
||||||
if (typeof errorData !== 'undefined') {
|
if (typeof errorData !== 'undefined') {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user