# The category is public feature
%if "%{?profile}" != "tv" && "%{?profile}" != "wearable" && "%{?_with_da_profile}" != "1"
%ifarch armv7l
- %define _use_nmt 1
+ %define _use_nmt 0
%endif
- %define _use_category 1
+ %define _use_category 0
%endif
BuildRequires: pkgconfig(chromium-efl)
};
export const send = function (winId: number, channel: string, ...args: any[]) {
- let window = BrowserWindow.fromId(winId);
- window.webContents.send(channel, ...args);
+ const window = BrowserWindow.fromId(winId);
+ if (window)
+ window.webContents.send(channel, ...args);
};
'use strict';
import { dialog, BrowserWindow } from 'electron';
-import * as WRTWebContents from '../../../browser/wrt_web_contents';
-import { WRTWindow } from '../../../browser/wrt_window';
-export const loadURL= function (winId: number, url: string) {
- let window = BrowserWindow.fromId(winId);
- window.loadURL(url);
+export const loadURL = function (winId: number, url: string) {
+ const window = BrowserWindow.fromId(winId);
+ if (window)
+ window.loadURL(url);
};
-export const showMessageBox = function (winId: number, options: Electron.MessageBoxOptions) {
- let window = BrowserWindow.fromId(winId);
- let showMessageBox = (dialog.showMessageBoxSync || dialog.showMessageBox);
- showMessageBox(window, options);
+export const showMessageBox = function (winId: number, options: Electron.MessageBoxOptions) {
+ const showMessageBox = (dialog.showMessageBoxSync || dialog.showMessageBox);
+ const window = BrowserWindow.fromId(winId);
+ if (window)
+ showMessageBox(window, options);
};
export const show = function (winId: number) {
- let window = BrowserWindow.fromId(winId);
- window.show();
+ const window = BrowserWindow.fromId(winId);
+ if (window)
+ window.show();
};
-export const executeJavaScript= function (winId: number, string: string) {
- let window = BrowserWindow.fromId(winId);
- window.webContents.executeJavaScript(string, true);
+export const executeJavaScript = function (winId: number, string: string) {
+ const window = BrowserWindow.fromId(winId);
+ if (window)
+ window.webContents.executeJavaScript(string, true);
};
export const open = function (url: string) {
- let window = new WRTWindow(
- { webPreferences: {
- nodeIntegration: true,
- nodeIntegrationInSubFrames: true,
- nodeIntegrationInWorker: false,
- nativeWindowOpen: true,
- },
- webContents: WRTWebContents.create(),
+ const window = new BrowserWindow({
+ webPreferences: {
+ nodeIntegration: true,
+ nodeIntegrationInSubFrames: true,
+ nodeIntegrationInWorker: false,
+ nativeWindowOpen: true,
+ },
});
window.loadURL(url);
return window.id;
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-const binding: NativeWRTjs.WRTWebContentsBinding = process.wrtBinding('wrt_web_contents');
-const { WRTWebContents } = binding;
-const { WebContents: ElectronWebContents } = process.wrtBinding('electron_browser_web_contents');
-
-const parent = ElectronWebContents.prototype;
-ElectronWebContents.prototype = WRTWebContents.prototype;
-
-Object.setPrototypeOf(WRTWebContents.prototype, parent);
-
-WRTWebContents.prototype._init = function () {
- parent._init.call(this);
-}
-
-export const create = (options = {}) => {
- return binding.create(options);
-}
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import { BrowserWindow } from 'electron';
-import * as WRTWebContents from '../browser/wrt_web_contents';
-
-export const { WRTWindow } = process.wrtBinding('wrt_window');
-
-Object.setPrototypeOf(WRTWindow.prototype, BrowserWindow.prototype);
-
-WRTWindow.prototype._init = function () {
- (BrowserWindow.prototype as any)._init.call(this);
- // This removes a macOS specific hack present in electron
- // that causes side effects on Tizen
- this.webContents.removeAllListeners('load-url');
- if (typeof this.setup === 'function')
- this.setup();
- this.constructor = BrowserWindow;
- this.webContents.on('new-window', (event: Electron.NewWindowWebContentsEvent,
- url: string,
- frameName: string,
- disposition: ('default' | 'foreground-tab' | 'background-tab' | 'new-window' | 'save-to-disk' | 'other'),
- options: any) => {
- event.preventDefault();
- if (!options.webContents) {
- options.webContents = WRTWebContents.create();
- options.webContents.loadURL(url);
- }
- event.newGuest = new WRTWindow(options);
- });
-}
const Module = require('module');
Module.globalPaths.push(wrt.getAppPath());
let filePath = src[7] === '/' ? src.substr(8) : src.substr(7); // strip "file://"
- let pkgJson = require(filePath);
+ let pkgJson: any = require(filePath);
let pos = filePath.lastIndexOf('/');
let mainJsPath = (pos !== -1 ? filePath.substr(0, pos + 1) : '') +
this.webApplication.windowList.forEach((window) => {
//clear webframe cache
this.tv.clearWebCache(window.webContents);
- window.webContents.session.clearCache(function() {
+ window.webContents.session.clearCache().then(() => {
console.log('clear session Cache complete');
- })
+ });
});
}
'use strict';
-import { app, session } from 'electron';
+import { BrowserWindow, app, session } from 'electron';
import { wrt } from '../browser/wrt';
-import * as WRTWebContents from '../browser/wrt_web_contents';
-import { WRTWindow } from '../browser/wrt_window';
import { addonManager } from './addon_manager';
import { WebApplicationDelegate } from '../common/web_application_delegate';
import { WebApplicationDelegateTV } from './tv/web_application_tv';
this.profileDelegate = new WebApplicationDelegate(this);
}
this.setupEventListener(options);
- this.mainWindow = new WRTWindow(this.getWindowOption(options));
+ this.mainWindow = new BrowserWindow(this.getWindowOption(options));
this.initDisplayDelay();
this.setupMainWindowEventListener();
}
});
}
- private getWindowOption(options: RuntimeOption): NativeWRTjs.WRTWindowConstructorOptions {
+ private getWindowOption(options: RuntimeOption): Electron.BrowserWindowConstructorOptions {
return {
fullscreen: false,
backgroundColor: this.defaultBackgroundColor,
nodeIntegrationInWorker: false,
nativeWindowOpen: true,
},
- webContents: WRTWebContents.create(),
};
}