Skip to content

Commit 3b274f6

Browse files
committed
fix some API problems
1 parent 6098265 commit 3b274f6

File tree

4 files changed

+18
-12
lines changed

4 files changed

+18
-12
lines changed

src/api/api-factory.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default (VueInstance) => {
6666

6767
const runtime = {
6868
sendMessage: (extensionId, message, external, webContentsId) => {
69-
let webContents;
69+
let webContents = false;
7070
let tabId = VueInstance.$store.getters.mappings[webContentsId];
7171
if (tabId === undefined) {
7272
// it's a popup.html or a background script
@@ -75,7 +75,8 @@ export default (VueInstance) => {
7575
const backgroundPages = VueInstance.$electron.remote.getGlobal('backgroundPages');
7676
const extension = backgroundPages[extensionId];
7777
VueInstance.$electron.remote.webContents.fromId(extension.webContentsId)
78-
.send('lulumi-runtime-send-message', external, message, { url: webContents.getURL() });
78+
.send('lulumi-runtime-send-message', external, message,
79+
(webContents ? { url: webContents.getURL() } : { tab: findOrCreate(tabId, VueInstance) }));
7980
},
8081
onMessage: (webContentsId) => {
8182
let id = VueInstance.$store.getters.mappings[webContentsId];

src/guest/renderer/components/AboutMainView/Extensions.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
loadIcon(extensionId) {
4343
const id = this.findId(extensionId);
4444
if (window.renderProcessPreferences[id].icons) { // manifest.icons entry is optional
45-
return window.renderProcessPreferences[id].icons['16'];
45+
return Object.values(window.renderProcessPreferences[id].icons)[0];
4646
}
4747
return undefined;
4848
},

src/main/js/constants/config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ export default {
1515
lulumiPreloadPath: `${lulumiHelperPath}/preload`,
1616
lulumiPagesPath: `${lulumiHelperPath}/pages`,
1717
lulumiPDFJSPath: `${lulumiHelperPath}/pdfjs`,
18-
lulumiRev: '94f158ec0502f37d341f119b5795509f2daa804f',
18+
lulumiRev: '6098265f4ae08bb260294de4385fb15520966e3f',
1919
};

src/renderer/components/BrowserMainView/Navbar.vue

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -324,19 +324,24 @@
324324
try {
325325
const isPageAction = extension.hasOwnProperty('page_action');
326326
const isBrowserAction = extension.hasOwnProperty('browser_action');
327-
if (isPageAction || isBrowserAction) {
328-
let icons;
329-
if (isPageAction) {
330-
icons = extension.page_action.default_icon;
331-
} else if (isBrowserAction) {
332-
icons = extension.browser_action.default_icon;
333-
}
327+
const manifestIcon = extension.hasOwnProperty('icons');
328+
let icons = false;
329+
if (isPageAction) {
330+
icons = extension.page_action.default_icon;
331+
}
332+
if (isBrowserAction) {
333+
icons = extension.browser_action.default_icon;
334+
}
335+
if (manifestIcon) {
336+
icons = extension.icons;
337+
}
338+
if (icons) {
334339
if (typeof icons === 'string') {
335340
return this.$electron.remote.nativeImage
336341
.createFromPath(path.join(extension.srcDirectory, icons)).toDataURL('image/png');
337342
}
338343
return this.$electron.remote.nativeImage
339-
.createFromPath(path.join(extension.srcDirectory, icons['16'])).toDataURL('image/png');
344+
.createFromPath(path.join(extension.srcDirectory, Object.values(icons)[0])).toDataURL('image/png');
340345
}
341346
return undefined;
342347
} catch (event) {

0 commit comments

Comments
 (0)