Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import Positoner from 'electron-positioner';
import { ElectronBlocker } from '@cliqz/adblocker-electron';
import fetch from 'cross-fetch';

let positioner;

export default class AppUpdater {
constructor() {
Expand Down Expand Up @@ -87,7 +88,7 @@ const createWindow = async () => {
icon: getAssetPath('icon.png'),
webPreferences: {
webviewTag:true,

nodeIntegration:false,
preload: app.isPackaged
? path.join(__dirname, 'preload.js')
: path.join(__dirname, '../../.erb/dll/preload.js'),
Expand All @@ -99,8 +100,8 @@ const createWindow = async () => {
blocker.enableBlockingInSession(mainWindow?.webContents.session);
})

var positioner = new Positoner(mainWindow);
positioner.move('topRight')
positioner = new Positoner(mainWindow);
positioner.move('topRight');
mainWindow.loadURL(resolveHtmlPath('index.html'));

mainWindow.on('ready-to-show', () => {
Expand Down Expand Up @@ -128,7 +129,6 @@ const createWindow = async () => {
});

// Remove this if your app does not use auto updates
// eslint-disable-next-line
new AppUpdater();
};

Expand All @@ -155,3 +155,7 @@ app
});
})
.catch(console.log);

ipcMain.on('window-move',(args)=>{
positioner.move(args);
})
11 changes: 11 additions & 0 deletions src/renderer/components/Searchbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import '../App.css';
import { TabContext } from 'renderer/context/TabContext';
import SearchEngineModal from './Settings/SearchEngineModal';



const Searchbar = ({}) => {
const [isModalOpen, setModal] = useState(false);

Expand All @@ -31,6 +33,15 @@ const Searchbar = ({}) => {
if (event.ctrlKey && (event.key === 'E' || event.key === 'e')) {
onClose();
}

if(event.ctrlKey && (event.key === "ArrowLeft")){
window.electron.ipcRenderer.sendMessage('window-move','topLeft')
}

if(event.ctrlKey && (event.key === "ArrowRight")){
window.electron.ipcRenderer.sendMessage('window-move','topRight')
}

nexTab(event);
});

Expand Down
1 change: 1 addition & 0 deletions src/renderer/preload.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ declare global {
}

export {};