Browse Source

Merge branch 'pr/3'

pull/3163/head
Bluscream 4 years ago
parent
commit
dec092940d
  1. 9
      app/view/preferences/Preferences.js
  2. 14
      electron/main.js

9
app/view/preferences/Preferences.js

@ -315,6 +315,15 @@ Ext.define("Rambox.view.preferences.Preferences", {
width: 360,
emptyText: "Leave blank for default user agent",
},
{
xtype: 'textfield'
,fieldLabel: 'List of Chrome extensions paths comma seperated (needs to relaunch)'
,labelAlign: 'top'
,name: 'extension_paths'
,value: config.extension_paths
,width: 360
,emptyText: '/path/to/extension1, /path/to/extension2'
},
{
xtype: "fieldset",
title: locale["preferences[24]"],

14
electron/main.js

@ -58,7 +58,7 @@ const config = new Config({
user_agent: "",
default_service: "ramboxTab",
sendStatistics: false,
extension_paths: "",
x: undefined,
y: undefined,
width: 1000,
@ -773,9 +773,15 @@ if (config.get("disable_gpu")) app.disableHardwareAcceleration();
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
app.on("ready", function () {
config.get("master_password") ? createMasterPasswordWindow() : createWindow();
// setInterval(availableSpaceWatchDog, 1000 * 60);
app.on('ready', function() {
config.get('master_password') ? createMasterPasswordWindow() : createWindow();
// Load Chrome extensions
const rawExtensionPaths = config.get('extension_paths')
if(rawExtensionPaths) {
const extentionPaths = rawExtensionPaths.split(',').map(path => path.trim())
extentionPaths.forEach(path => console.log('Extension added: ', BrowserWindow.addExtension(path)))
}
});
// Quit when all windows are closed.
app.on("window-all-closed", function () {

Loading…
Cancel
Save