Commit 998a9805 authored by akiraohgaki's avatar akiraohgaki

Merge branch 'develop'

parents eddb66d9 4637a17c
Pipeline #304 passed with stage
in 2 minutes and 10 seconds
...@@ -184,6 +184,17 @@ app.on('activate', () => { ...@@ -184,6 +184,17 @@ app.on('activate', () => {
} }
}); });
app.on('web-contents-created', (event, webContents) => {
if (webContents.getType() === 'webview') {
webContents.on('will-navigate', (event, url) => {
if (url.startsWith('ocs://') || url.startsWith('ocss://')) {
// Cancel ocs protocol navigation
event.preventDefault();
}
});
}
});
ipcMain.on('app', (event, key) => { ipcMain.on('app', (event, key) => {
const data = { const data = {
package: appPackage, package: appPackage,
......
...@@ -68,10 +68,6 @@ export default class OmniboxComponent extends BaseComponent { ...@@ -68,10 +68,6 @@ export default class OmniboxComponent extends BaseComponent {
height: inherit; height: inherit;
line-height: 1; line-height: 1;
} }
div[data-omnibox] div[data-content] div {
flex: 0 0 auto;
width: 30px;
}
div[data-omnibox] div[data-content] h3 { div[data-omnibox] div[data-content] h3 {
flex: 1 1 auto; flex: 1 1 auto;
border-right: 1px solid var(--color-border); border-right: 1px solid var(--color-border);
...@@ -82,6 +78,13 @@ export default class OmniboxComponent extends BaseComponent { ...@@ -82,6 +78,13 @@ export default class OmniboxComponent extends BaseComponent {
text-align: center; text-align: center;
cursor: pointer; cursor: pointer;
} }
div[data-omnibox] div[data-content] div {
display: flex;
flex: 0 0 auto;
align-items: center;
justify-content: center;
width: 30px;
}
div[data-omnibox] app-indicator { div[data-omnibox] app-indicator {
position: relative; position: relative;
top: -2px; top: -2px;
...@@ -161,7 +164,7 @@ export default class OmniboxComponent extends BaseComponent { ...@@ -161,7 +164,7 @@ export default class OmniboxComponent extends BaseComponent {
<h3 data-action="omnibox_open">${this.state.title}</h3> <h3 data-action="omnibox_open">${this.state.title}</h3>
<div> <div>
<app-iconbutton data-action="ocsManager_openUrl" data-url="${this.state.url}" <app-iconbutton data-action="ocsManager_openUrl" data-url="${this.state.url}"
data-title="Open in Browser" data-icon="open_in_browser" data-size="medium"></app-iconbutton> data-title="Open in Browser" data-icon="open_in_browser" data-size="small"></app-iconbutton>
</div> </div>
</div> </div>
<app-indicator data-status="inactive"></app-indicator> <app-indicator data-status="inactive"></app-indicator>
......
...@@ -124,6 +124,7 @@ export default class WebviewComponent extends BaseComponent { ...@@ -124,6 +124,7 @@ export default class WebviewComponent extends BaseComponent {
}); });
this._webviewElement.addEventListener('will-navigate', (event) => { this._webviewElement.addEventListener('will-navigate', (event) => {
// See also "will-navigate" event handling in main.js
if (event.url.startsWith('ocs://') || event.url.startsWith('ocss://')) { if (event.url.startsWith('ocs://') || event.url.startsWith('ocss://')) {
const info = this._detectOcsApiInfo(this._webviewElement.getURL()); const info = this._detectOcsApiInfo(this._webviewElement.getURL());
this.dispatch('ocsManager_getItemByOcsUrl', { this.dispatch('ocsManager_getItemByOcsUrl', {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment