Browse Source

add chrome extensions support

pull/2626/head
Valentin Cocaud 5 years ago
parent
commit
6db4c4d2f8
  1. 9
      app/view/preferences/Preferences.js
  2. 7
      electron/main.js

9
app/view/preferences/Preferences.js

@ -280,6 +280,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]']

7
electron/main.js

@ -479,6 +479,13 @@ if ( config.get('disable_gpu') ) app.disableHardwareAcceleration();
// initialization and is ready to create browser windows.
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.

Loading…
Cancel
Save