• R/O
  • HTTP
  • SSH
  • HTTPS

MyBrowser: Commit

Cross-platform browser based on Chromium.
ElectronとReactを使用したクロスプラットフォーム対応のブラウザ。


Commit MetaInfo

Revision18437b2909552d41edb092d0d5f5706c8bc0063a (tree)
Time2019-06-17 02:24:52
AuthorAoichaan0513 <aoichaan0513@gmai...>
CommiterAoichaan0513

Log Message

v2.8.1
・メニューから拡大・縮小に対応
・アプリケーションがすでに開いている場合、新たなインスタンスを開かずに、新しいウィンドウを開くように変更
・ライブラリの追加
・その他バグ・不具合の修正

Change Summary

Incremental Difference

--- a/app/electron/Application.js
+++ b/app/electron/Application.js
@@ -16,6 +16,8 @@ const config = require('./Config');
1616 const WindowManager = require('./WindowManager');
1717 const windowManager = new WindowManager();
1818
19+const singleInstance = app.requestSingleInstanceLock();
20+
1921 let loginCallback;
2022 let mainWindow;
2123 let subWindow;
@@ -34,7 +36,7 @@ getBaseWindow = (width = 1100, height = 680, minWidth = 500, minHeight = 360, x,
3436 }
3537
3638 module.exports = class Application {
37- loadWindow = () => {
39+ loadApplication = () => {
3840 protocol.registerSchemesAsPrivileged([
3941 { scheme: protocolStr, privileges: { standard: true, bypassCSP: true, secure: true } },
4042 { scheme: fileProtocolStr, privileges: { standard: false, bypassCSP: true, secure: true } }
@@ -59,53 +61,59 @@ module.exports = class Application {
5961 console.log('Update downloaded.');
6062 });
6163
62- app.on('ready', () => {
63- process.env.GOOGLE_API_KEY = config.googleAPIKey;
64-
65- app.setAppUserModelId(pkg.flast_package_id);
66- session.defaultSession.setUserAgent(session.defaultSession.getUserAgent().replace(/ Electron\/[0-9\.]*/g, ''));
67-
68- autoUpdater.checkForUpdatesAndNotify();
69- Menu.setApplicationMenu(null);
70-
71- windowManager.addWindow();
72- // this.loadExtension('gmngpagflejjoblmmamaonmnkghjmebh');
73- // this.loadExtension('bdiadchoogngocfifcomfeakccmcecee');
74- });
75-
76- app.on('window-all-closed', () => {
77- if (process.platform !== 'darwin') {
78- app.quit();
79- }
80- });
81-
82- app.on('activate', () => {
83- });
84-
85- app.on('login', (e, webContents, request, authInfo, callback) => {
86- e.preventDefault();
87-
88- subWindow = getBaseWindow(320, 230, 320, 230);
89- // subWindow.setParentWindow(mainWindow);
90- subWindow.setMovable(false);
91- subWindow.setResizable(false);
92- subWindow.setMinimizable(false);
93- subWindow.setMaximizable(false);
94- const startUrl = process.env.ELECTRON_START_URL || url.format({
95- pathname: path.join(__dirname, '/../build/index.html'),
96- protocol: 'file:',
97- slashes: true,
98- hash: '/authentication',
64+ if (!singleInstance) {
65+ app.quit();
66+ } else {
67+ app.on('second-instance', (e, line, directory) => {
68+ windowManager.addWindow();
9969 });
10070
101- subWindow.loadURL(startUrl);
102- loginCallback = callback;
103- });
104-
105- ipcMain.on('authorization', (event, arg) => {
106- loginCallback(arg.username, arg.password);
107- subWindow.close();
108- });
71+ app.on('ready', () => {
72+ process.env.GOOGLE_API_KEY = config.googleAPIKey;
73+
74+ app.setAppUserModelId(pkg.flast_package_id);
75+ session.defaultSession.setUserAgent(session.defaultSession.getUserAgent().replace(/ Electron\/[0-9\.]*/g, ''));
76+
77+ autoUpdater.checkForUpdatesAndNotify();
78+ Menu.setApplicationMenu(null);
79+
80+ windowManager.addWindow();
81+ });
82+
83+ app.on('window-all-closed', () => {
84+ if (process.platform !== 'darwin') {
85+ app.quit();
86+ }
87+ });
88+
89+ app.on('activate', () => {
90+ });
91+
92+ app.on('login', (e, webContents, request, authInfo, callback) => {
93+ e.preventDefault();
94+
95+ subWindow = getBaseWindow(320, 230, 320, 230);
96+ // subWindow.setParentWindow(mainWindow);
97+ subWindow.setMovable(false);
98+ subWindow.setResizable(false);
99+ subWindow.setMinimizable(false);
100+ subWindow.setMaximizable(false);
101+ const startUrl = process.env.ELECTRON_START_URL || url.format({
102+ pathname: path.join(__dirname, '/../build/index.html'),
103+ protocol: 'file:',
104+ slashes: true,
105+ hash: '/authentication',
106+ });
107+
108+ subWindow.loadURL(startUrl);
109+ loginCallback = callback;
110+ });
111+
112+ ipcMain.on('authorization', (event, arg) => {
113+ loginCallback(arg.username, arg.password);
114+ subWindow.close();
115+ });
116+ }
109117 }
110118
111119 loadExtension = (id) => {
@@ -114,8 +122,6 @@ module.exports = class Application {
114122 const versions = fs.readdirSync(`${extensionDir}/${id}`).sort();
115123 const version = versions.pop();
116124
117- // BrowserWindow.addExtension(`${extensionDir}/${id}/${version}`);
118- // BrowserWindow.addDevToolsExtension(`${extensionDir}/${id}/${version}`);
119125 extensionsMain.setSession(session.defaultSession);
120126 extensionsMain.load(`${extensionDir}/${id}/${version}`);
121127 }
--- a/app/electron/Starter.js
+++ b/app/electron/Starter.js
@@ -1,4 +1,4 @@
11 const Application = require('./Application');
22
33 global.Application = new Application();
4-global.Application.loadWindow();
\ No newline at end of file
4+global.Application.loadApplication();
\ No newline at end of file
--- a/app/electron/WindowManager.js
+++ b/app/electron/WindowManager.js
@@ -389,6 +389,10 @@ module.exports = class WindowManager {
389389 ipcMain.on('window-add', (e, args) => {
390390 this.addWindow(args.isPrivate);
391391 });
392+
393+ ipcMain.on('window-fullScreen', (e, args) => {
394+ this.addWindow(args.isPrivate);
395+ });
392396
393397 ipcMain.on('window-fixBounds', (e, args) => {
394398 this.windows.forEach((value, key) => {
@@ -568,6 +572,13 @@ module.exports = class WindowManager {
568572 view.webContents.reloadIgnoringCache();
569573 });
570574
575+ localShortcut.register(window, 'F11', () => {
576+ const window = this.windows.get(id);
577+
578+ window.setFullScreen(!window.isFullScreen());
579+ this.fixBounds(id, (floatingWindows.indexOf(id) != -1));
580+ })
581+
571582 this.windows.set(id, window);
572583
573584 if (process.argv != undefined) {
@@ -576,19 +587,26 @@ module.exports = class WindowManager {
576587 }
577588
578589 registerListeners = (id) => {
579- ipcMain.on(`browserview-add-${id}`, (e, args) => {
590+ ipcMain.on(`window-fullScreen-${id}`, (e, args) => {
591+ const window = this.windows.get(id);
592+
593+ window.setFullScreen(!window.isFullScreen());
594+ this.fixBounds(id, (floatingWindows.indexOf(id) != -1));
595+ });
596+
597+ ipcMain.on(`browserView-add-${id}`, (e, args) => {
580598 this.addView(id, args.url, args.isActive);
581599 });
582600
583- ipcMain.on(`browserview-remove-${id}`, (e, args) => {
601+ ipcMain.on(`browserView-remove-${id}`, (e, args) => {
584602 this.removeView(id, args.id);
585603 });
586604
587- ipcMain.on(`browserview-select-${id}`, (e, args) => {
605+ ipcMain.on(`browserView-select-${id}`, (e, args) => {
588606 this.selectView(id, args.id);
589607 });
590608
591- ipcMain.on(`browserview-get-${id}`, (e, args) => {
609+ ipcMain.on(`browserView-get-${id}`, (e, args) => {
592610 let datas = [];
593611
594612 views[id].map((item) => {
@@ -596,10 +614,10 @@ module.exports = class WindowManager {
596614
597615 datas.push({ id: item.view.webContents.id, title: item.view.webContents.getTitle(), url, icon: this.getFavicon(url), color: '#0a84ff', isBookmarked: false });
598616 });
599- e.sender.send(`browserview-get-${id}`, { views: datas });
617+ e.sender.send(`browserView-get-${id}`, { views: datas });
600618 });
601619
602- ipcMain.on(`browserview-goBack-${id}`, (e, args) => {
620+ ipcMain.on(`browserView-goBack-${id}`, (e, args) => {
603621 views[id].filter(function (view, i) {
604622 if (view.view.webContents.id == args.id) {
605623 let webContents = views[id][i].view.webContents;
@@ -609,7 +627,7 @@ module.exports = class WindowManager {
609627 });
610628 });
611629
612- ipcMain.on(`browserview-goForward-${id}`, (e, args) => {
630+ ipcMain.on(`browserView-goForward-${id}`, (e, args) => {
613631 views[id].filter(function (view, i) {
614632 if (view.view.webContents.id == args.id) {
615633 let webContents = views[id][i].view.webContents;
@@ -619,7 +637,7 @@ module.exports = class WindowManager {
619637 });
620638 });
621639
622- ipcMain.on(`browserview-reload-${id}`, (e, args) => {
640+ ipcMain.on(`browserView-reload-${id}`, (e, args) => {
623641 views[id].filter(function (view, i) {
624642 if (view.view.webContents.id == args.id) {
625643 let webContents = views[id][i].view.webContents;
@@ -628,7 +646,7 @@ module.exports = class WindowManager {
628646 });
629647 });
630648
631- ipcMain.on(`browserview-stop-${id}`, (e, args) => {
649+ ipcMain.on(`browserView-stop-${id}`, (e, args) => {
632650 views[id].filter(function (view, i) {
633651 if (view.view.webContents.id == args.id) {
634652 let webContents = views[id][i].view.webContents;
@@ -637,7 +655,7 @@ module.exports = class WindowManager {
637655 });
638656 });
639657
640- ipcMain.on(`browserview-goHome-${id}`, (e, args) => {
658+ ipcMain.on(`browserView-goHome-${id}`, (e, args) => {
641659 views[id].filter(function (view, i) {
642660 if (view.view.webContents.id == args.id) {
643661 let webContents = views[id][i].view.webContents;
@@ -646,7 +664,7 @@ module.exports = class WindowManager {
646664 });
647665 });
648666
649- ipcMain.on(`browserview-loadURL-${id}`, (e, args) => {
667+ ipcMain.on(`browserView-loadURL-${id}`, (e, args) => {
650668 views[id].filter(function (view, i) {
651669 if (view.view.webContents.id == args.id) {
652670 let webContents = views[id][i].view.webContents;
@@ -655,7 +673,7 @@ module.exports = class WindowManager {
655673 });
656674 });
657675
658- ipcMain.on(`browserview-loadFile-${id}`, (e, args) => {
676+ ipcMain.on(`browserView-loadFile-${id}`, (e, args) => {
659677 views[id].filter(function (view, i) {
660678 if (view.view.webContents.id == args.id) {
661679 let webContents = views[id][i].view.webContents;
@@ -664,6 +682,26 @@ module.exports = class WindowManager {
664682 });
665683 });
666684
685+ ipcMain.on(`browserView-zoomIn-${id}`, (e, args) => {
686+ views[id].filter(function (view, i) {
687+ if (view.view.webContents.id == args.id) {
688+ let webContents = views[id][i].view.webContents;
689+ console.log(webContents.getZoomFactor());
690+ webContents.setZoomFactor(webContents.getZoomFactor() + 0.1);
691+ }
692+ });
693+ });
694+
695+ ipcMain.on(`browserView-zoomOut-${id}`, (e, args) => {
696+ views[id].filter(function (view, i) {
697+ if (view.view.webContents.id == args.id) {
698+ let webContents = views[id][i].view.webContents;
699+ console.log(webContents.getZoomFactor());
700+ webContents.setZoomFactor(webContents.getZoomFactor() - 0.1);
701+ }
702+ });
703+ });
704+
667705 ipcMain.on(`data-bookmark-add-${id}`, (e, args) => {
668706 views[id].filter((view, i) => {
669707 if (view.view.webContents.id == args.id) {
@@ -715,7 +753,7 @@ module.exports = class WindowManager {
715753 db.bookmarks.find({ url: view.webContents.getURL(), isPrivate: (String(id).startsWith('private')) }, (err, docs) => {
716754 const url = view.webContents.getURL();
717755
718- window.webContents.send(`browserview-load-${id}`, { id: view.webContents.id, title: view.webContents.getTitle(), url: url, icon: this.getFavicon(url), color: '#0a84ff', isAudioPlaying: !view.webContents.isCurrentlyAudible(), isBookmarked: (docs.length > 0 ? true : false) });
756+ window.webContents.send(`browserView-load-${id}`, { id: view.webContents.id, title: view.webContents.getTitle(), url: url, icon: this.getFavicon(url), color: '#0a84ff', isAudioPlaying: !view.webContents.isCurrentlyAudible(), isBookmarked: (docs.length > 0 ? true : false) });
719757 });
720758 }
721759
@@ -878,7 +916,7 @@ module.exports = class WindowManager {
878916 this.updateNavigationState(windowId, item.view);
879917 this.updateViewState(windowId, item.view);
880918
881- window.webContents.send(`browserview-set-${windowId}`, { id: id });
919+ window.webContents.send(`browserView-set-${windowId}`, { id: id });
882920 this.fixBounds(windowId, (floatingWindows.indexOf(windowId) != -1));
883921 }
884922 });
@@ -890,7 +928,7 @@ module.exports = class WindowManager {
890928
891929 window.setBrowserView(item.view);
892930 window.setTitle(`${item.view.webContents.getTitle()} - ${pkg.name}`);
893- window.webContents.send(`browserview-set-${windowId}`, { id: item.id });
931+ window.webContents.send(`browserView-set-${windowId}`, { id: item.id });
894932 this.fixBounds(windowId, (floatingWindows.indexOf(windowId) != -1));
895933 }
896934
@@ -902,7 +940,7 @@ module.exports = class WindowManager {
902940 datas.push({ id: views[windowId][i].view.webContents.id, title: views[windowId][i].view.webContents.getTitle(), url: url, icon: this.getFavicon(url) });
903941 }
904942 const window = this.windows.get(windowId);
905- window.webContents.send(`browserview-get-${windowId}`, { views: datas });
943+ window.webContents.send(`browserView-get-${windowId}`, { views: datas });
906944 }
907945
908946 addTab = (windowId, url = config.get('homePage.defaultPage'), isActive = true) => {
@@ -919,6 +957,8 @@ module.exports = class WindowManager {
919957 }
920958 });
921959
960+ view.webContents.setVisualZoomLevelLimits(1, 3);
961+
922962 const window = this.windows.get(windowId);
923963 const id = view.webContents.id;
924964
@@ -930,12 +970,12 @@ module.exports = class WindowManager {
930970 view.webContents.on('did-start-loading', () => {
931971 if (view.isDestroyed()) return;
932972
933- window.webContents.send(`browserview-start-loading-${windowId}`, { id: id });
973+ window.webContents.send(`browserView-start-loading-${windowId}`, { id: id });
934974 });
935975 view.webContents.on('did-stop-loading', () => {
936976 if (view.isDestroyed()) return;
937977
938- window.webContents.send(`browserview-stop-loading-${windowId}`, { id: id });
978+ window.webContents.send(`browserView-stop-loading-${windowId}`, { id: id });
939979 });
940980
941981 view.webContents.on('did-start-navigation', (e) => {
@@ -980,7 +1020,7 @@ module.exports = class WindowManager {
9801020 viewId = this.getRandString(12);
9811021
9821022 this.getCertificate(view.webContents.getURL()).then((certificate) => {
983- window.webContents.send(`browserview-certificate-${windowId}`, { id, certificate });
1023+ window.webContents.send(`browserView-certificate-${windowId}`, { id, certificate });
9841024 });
9851025
9861026 window.setTitle(`${view.webContents.getTitle()} - ${pkg.name}`);
@@ -1027,7 +1067,7 @@ module.exports = class WindowManager {
10271067 this.updateViewState(windowId, view);
10281068 this.updateNavigationState(windowId, view);
10291069
1030- window.webContents.send(`browserview-theme-color-${windowId}`, { id: view.webContents.id, color });
1070+ window.webContents.send(`browserView-theme-color-${windowId}`, { id: view.webContents.id, color });
10311071 });
10321072
10331073 view.webContents.on('update-target-url', (e, url) => {
@@ -1550,7 +1590,7 @@ module.exports = class WindowManager {
15501590 views[windowId].push({ id, view, isNotificationBar: false });
15511591
15521592 if (isActive) {
1553- window.webContents.send(`browserview-set-${windowId}`, { id: id });
1593+ window.webContents.send(`browserView-set-${windowId}`, { id: id });
15541594 window.setBrowserView(view);
15551595 }
15561596
--- a/app/langs/en.js
+++ b/app/langs/en.js
@@ -56,11 +56,17 @@ module.exports = {
5656 newTab: 'New tab',
5757 newWindow: 'New window',
5858 openPrivateWindow: 'Open Private window',
59+ zoom: {
60+ name: 'Zoom',
61+ zoomIn: 'Zoom in',
62+ zoomOut: 'Zoom out',
63+ fullScreen: 'Full Screen'
64+ },
5965 history: 'History',
6066 downloads: 'Downloads',
6167 bookmarks: 'Bookmarks',
6268 app: {
63- app: 'Application',
69+ name: 'Application',
6470 list: 'App list',
6571 store: 'Flast Store',
6672 install: 'Install {title}',
--- a/app/langs/ja.js
+++ b/app/langs/ja.js
@@ -56,6 +56,12 @@ module.exports = {
5656 newTab: '新しいタブ',
5757 newWindow: '新しいウィンドウ',
5858 openPrivateWindow: 'プライベート ウィンドウを開く',
59+ zoom: {
60+ name: 'ズーム',
61+ zoomIn: '拡大',
62+ zoomOut: '縮小',
63+ fullScreen: '全画面表示'
64+ },
5965 history: '履歴',
6066 downloads: 'ダウンロード',
6167 bookmarks: 'ブックマーク',
--- a/app/package.json
+++ b/app/package.json
@@ -1,7 +1,7 @@
11 {
22 "name": "Flast",
33 "description": "Cross-platform browser based on Chromium.",
4- "version": "2.7.4",
4+ "version": "2.8.1",
55 "flast_channel": "Stable",
66 "flast_package_id": "org.aoichaan0513.Flast",
77 "private": true,
--- a/app/src/Windows/BrowserWindow.js
+++ b/app/src/Windows/BrowserWindow.js
@@ -171,20 +171,20 @@ class BrowserView extends Component {
171171 });
172172 */
173173
174- ipcRenderer.on(`browserview-start-loading-${this.props.windowId}`, (e, args) => {
174+ ipcRenderer.on(`browserView-start-loading-${this.props.windowId}`, (e, args) => {
175175 if (args.id === this.props.index) {
176176 this.setState({ isLoading: true });
177177 this.blockCount = 0;
178178 }
179179 });
180180
181- ipcRenderer.on(`browserview-stop-loading-${this.props.windowId}`, (e, args) => {
181+ ipcRenderer.on(`browserView-stop-loading-${this.props.windowId}`, (e, args) => {
182182 if (args.id === this.props.index) {
183183 this.setState({ isLoading: false });
184184 }
185185 });
186186
187- ipcRenderer.on(`browserview-load-${this.props.windowId}`, (e, args) => {
187+ ipcRenderer.on(`browserView-load-${this.props.windowId}`, (e, args) => {
188188 if (args.id === this.props.index) {
189189 this.props.updateTab();
190190 this.setState({ viewUrl: args.url, isBookmarked: args.isBookmarked });
@@ -193,7 +193,7 @@ class BrowserView extends Component {
193193 }
194194 });
195195
196- ipcRenderer.on(`browserview-certificate-${this.props.windowId}`, (e, args) => {
196+ ipcRenderer.on(`browserView-certificate-${this.props.windowId}`, (e, args) => {
197197 if (args.id === this.props.index) {
198198 this.setState({ certificate: args.certificate });
199199 }
@@ -211,7 +211,7 @@ class BrowserView extends Component {
211211 }
212212 });
213213
214- ipcRenderer.on(`browserview-permission-${this.props.windowId}`, (e, args) => {
214+ ipcRenderer.on(`browserView-permission-${this.props.windowId}`, (e, args) => {
215215 if (args.id === this.props.index) {
216216 const toolTip = findDOMNode(this.infomationTooltip)._tippy;
217217 toolTip.setContent(args.content);
@@ -240,16 +240,16 @@ class BrowserView extends Component {
240240 if (this.state.barText.length > 0 || this.state.barText !== '') {
241241 this.setState({ isInputed: false });
242242 if (isURL(this.state.barText) && !this.state.barText.includes('://')) {
243- ipcRenderer.send(`browserview-loadURL-${this.props.windowId}`, { id: this.props.index, url: `http://${this.state.barText}` });
243+ ipcRenderer.send(`browserView-loadURL-${this.props.windowId}`, { id: this.props.index, url: `http://${this.state.barText}` });
244244 } else if (!this.state.barText.includes('://')) {
245- ipcRenderer.send(`browserview-loadURL-${this.props.windowId}`, { id: this.props.index, url: this.getSearchEngine().url.replace('%s', this.state.barText) });
245+ ipcRenderer.send(`browserView-loadURL-${this.props.windowId}`, { id: this.props.index, url: this.getSearchEngine().url.replace('%s', this.state.barText) });
246246 } else {
247247 const pattern = /^(file:\/\/\S.*)\S*$/;
248248
249249 if (pattern.test(this.state.barText)) {
250- ipcRenderer.send(`browserview-loadFile-${this.props.windowId}`, { id: this.props.index, url: this.state.barText.replace('file:///', '') });
250+ ipcRenderer.send(`browserView-loadFile-${this.props.windowId}`, { id: this.props.index, url: this.state.barText.replace('file:///', '') });
251251 } else {
252- ipcRenderer.send(`browserview-loadURL-${this.props.windowId}`, { id: this.props.index, url: this.state.barText });
252+ ipcRenderer.send(`browserView-loadURL-${this.props.windowId}`, { id: this.props.index, url: this.state.barText });
253253 }
254254 }
255255 } else {
@@ -309,23 +309,23 @@ class BrowserView extends Component {
309309 }
310310
311311 goBack = () => {
312- ipcRenderer.send(`browserview-goBack-${this.props.windowId}`, { id: this.props.index });
312+ ipcRenderer.send(`browserView-goBack-${this.props.windowId}`, { id: this.props.index });
313313 }
314314
315315 goForward = () => {
316- ipcRenderer.send(`browserview-goForward-${this.props.windowId}`, { id: this.props.index });
316+ ipcRenderer.send(`browserView-goForward-${this.props.windowId}`, { id: this.props.index });
317317 }
318318
319319 reload = () => {
320320 if (!this.state.isLoading) {
321- ipcRenderer.send(`browserview-reload-${this.props.windowId}`, { id: this.props.index });
321+ ipcRenderer.send(`browserView-reload-${this.props.windowId}`, { id: this.props.index });
322322 } else {
323- ipcRenderer.send(`browserview-stop-${this.props.windowId}`, { id: this.props.index });
323+ ipcRenderer.send(`browserView-stop-${this.props.windowId}`, { id: this.props.index });
324324 }
325325 }
326326
327327 goHome = () => {
328- ipcRenderer.send(`browserview-goHome-${this.props.windowId}`, { id: this.props.index });
328+ ipcRenderer.send(`browserView-goHome-${this.props.windowId}`, { id: this.props.index });
329329 }
330330
331331 certificate = () => {
@@ -370,7 +370,7 @@ class BrowserView extends Component {
370370 ]);
371371 menu.popup({
372372 x: remote.getCurrentWindow().getSize()[0] - 57,
373- y: 65
373+ y: 67
374374 });
375375 }
376376
@@ -393,6 +393,29 @@ class BrowserView extends Component {
393393 },
394394 { type: 'separator' },
395395 {
396+ label: lang.window.toolBar.menu.menus.zoom.name,
397+ type: 'submenu',
398+ submenu: [
399+ {
400+ label: lang.window.toolBar.menu.menus.zoom.zoomIn,
401+ icon: `${app.getAppPath()}/static/zoom_in.png`,
402+ click: () => { ipcRenderer.send(`browserView-zoomIn-${this.props.windowId}`, { id: this.props.index }); }
403+ },
404+ {
405+ label: lang.window.toolBar.menu.menus.zoom.zoomOut,
406+ icon: `${app.getAppPath()}/static/zoom_out.png`,
407+ click: () => { ipcRenderer.send(`browserView-zoomOut-${this.props.windowId}`, { id: this.props.index }); }
408+ },
409+ { type: 'separator' },
410+ {
411+ label: lang.window.toolBar.menu.menus.zoom.fullScreen,
412+ icon: `${app.getAppPath()}/static/fullscreen.png`,
413+ click: () => { ipcRenderer.send(`window-fullScreen-${this.props.windowId}`, {}); }
414+ }
415+ ]
416+ },
417+ { type: 'separator' },
418+ {
396419 label: lang.window.toolBar.menu.menus.history,
397420 icon: `${app.getAppPath()}/static/history.png`,
398421 click: () => { this.props.addTab(`${protocolStr}://history/`); }
@@ -457,7 +480,7 @@ class BrowserView extends Component {
457480 ]);
458481 menu.popup({
459482 x: remote.getCurrentWindow().getSize()[0] - 24,
460- y: 65
483+ y: 67
461484 });
462485 }
463486
@@ -536,11 +559,11 @@ class BrowserWindow extends Component {
536559 this.addTab(args.url);
537560 });
538561
539- ipcRenderer.on(`browserview-get-${this.props.match.params.windowId}`, (e, args) => {
562+ ipcRenderer.on(`browserView-get-${this.props.match.params.windowId}`, (e, args) => {
540563 this.setState({ tabs: args.views });
541564 });
542565
543- ipcRenderer.on(`browserview-set-${this.props.match.params.windowId}`, (e, args) => {
566+ ipcRenderer.on(`browserView-set-${this.props.match.params.windowId}`, (e, args) => {
544567 this.setState({ current: args.id });
545568 });
546569 }
@@ -582,18 +605,18 @@ class BrowserWindow extends Component {
582605 }
583606
584607 getTabs = () => {
585- ipcRenderer.send(`browserview-get-${this.props.match.params.windowId}`, {});
608+ ipcRenderer.send(`browserView-get-${this.props.match.params.windowId}`, {});
586609 }
587610
588611 addTab = (url = (config.get('homePage.isDefaultHomePage') ? `${protocolStr}://home/` : config.get('homePage.defaultPage'))) => {
589- ipcRenderer.send(`browserview-add-${this.props.match.params.windowId}`, { url, isActive: true });
590- ipcRenderer.send(`browserview-get-${this.props.match.params.windowId}`, {});
612+ ipcRenderer.send(`browserView-add-${this.props.match.params.windowId}`, { url, isActive: true });
613+ ipcRenderer.send(`browserView-get-${this.props.match.params.windowId}`, {});
591614 this.setState({ current: this.state.tabs.length });
592615 }
593616
594617 removeTab = (i) => {
595- ipcRenderer.send(`browserview-remove-${this.props.match.params.windowId}`, { id: i });
596- ipcRenderer.send(`browserview-get-${this.props.match.params.windowId}`, {});
618+ ipcRenderer.send(`browserView-remove-${this.props.match.params.windowId}`, { id: i });
619+ ipcRenderer.send(`browserView-get-${this.props.match.params.windowId}`, {});
597620
598621 this.forceUpdate();
599622 if ((this.state.tabs.length - 1) < 1) {
@@ -602,7 +625,7 @@ class BrowserWindow extends Component {
602625 }
603626
604627 updateTab = () => {
605- ipcRenderer.send(`browserview-get-${this.props.match.params.windowId}`, {});
628+ ipcRenderer.send(`browserView-get-${this.props.match.params.windowId}`, {});
606629 }
607630
608631 getForegroundColor = (hexColor) => {
@@ -662,7 +685,7 @@ class BrowserWindow extends Component {
662685 <TabContainer ref={ref => { this.tabContainer = ref; }}>
663686 {this.state.tabs.map((tab, i) => {
664687 return (
665- <Tab isDarkModeOrPrivateMode={config.get('design.isDarkTheme') || String(this.props.match.params.windowId).startsWith('private')} isActive={tab.id === this.state.current} isFixed={tab.fixed} accentColor={tab.color} onClick={() => { ipcRenderer.send(`browserview-select-${this.props.match.params.windowId}`, { id: tab.id }); this.forceUpdate(); }} onContextMenu={this.handleContextMenu.bind(this, tab.id)}>
688+ <Tab isDarkModeOrPrivateMode={config.get('design.isDarkTheme') || String(this.props.match.params.windowId).startsWith('private')} isActive={tab.id === this.state.current} isFixed={tab.fixed} accentColor={tab.color} onClick={() => { ipcRenderer.send(`browserView-select-${this.props.match.params.windowId}`, { id: tab.id }); this.forceUpdate(); }} onContextMenu={this.handleContextMenu.bind(this, tab.id)}>
666689 <TabIcon src={tab.icon !== undefined ? tab.icon : (config.get('design.isDarkTheme') || String(this.props.match.params.windowId).startsWith('private') ? DarkPublicIcon : LightPublicIcon)} width={18} height={18} />
667690 <TabTitle color={this.getForegroundColor(!config.get('design.isDarkTheme') || !String(this.props.match.params.windowId).startsWith('private') ? (platform.isWin32 || platform.isDarwin ? `#${systemPreferences.getAccentColor()}` : '#353535') : '#353535')} isAudioPlaying={tab.isAudioPlaying} isFixed={tab.fixed} title={tab.title}>{tab.title}</TabTitle>
668691 <TabCloseButton isActive={tab.id === this.state.current} isFixed={tab.fixed} isRight={true} src={this.isDarkModeOrPrivateMode.bind(this, LightCloseIcon, DarkCloseIcon)} size={14} title={lang.window.titleBar.tab.close} onClick={() => { this.removeTab(tab.id); this.forceUpdate(); }} />
Binary files /dev/null and b/app/static/fullscreen.png differ
Binary files /dev/null and b/app/static/fullscreen@2x.png differ
Binary files /dev/null and b/app/static/zoom_in.png differ
Binary files /dev/null and b/app/static/zoom_in@2x.png differ
Binary files /dev/null and b/app/static/zoom_out.png differ
Binary files /dev/null and b/app/static/zoom_out@2x.png differ
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
11 {
22 "name": "Flast",
33 "description": "Cross-platform browser based on Chromium.",
4- "version": "2.7.4",
4+ "version": "2.8.1",
55 "flast_channel": "Stable",
66 "flast_package_id": "org.aoichaan0513.Flast",
77 "private": true,
Show on old repository browser