mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-01-08 16:14:07 +00:00
When the `getCurrentUrl` function was refactored to make use of the `withFocusedWindow` function in ac99c6424d
, it stopped returning a value and broke the "Copy Current URL" feature (#633).
This change restores the original behavior of the getCurrentURL function and makes the "Copy Current URL" feature functional again.
This commit is contained in:
parent
0b47999c3e
commit
c065cad01a
@ -129,8 +129,9 @@ function createMainWindow(inpOptions, onAppQuit, setDockBadge) {
|
||||
const withFocusedWindow = (block) => {
|
||||
const focusedWindow = BrowserWindow.getFocusedWindow();
|
||||
if (focusedWindow) {
|
||||
block(focusedWindow);
|
||||
return block(focusedWindow);
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
const adjustWindowZoom = (window, adjustment) => {
|
||||
@ -194,11 +195,8 @@ function createMainWindow(inpOptions, onAppQuit, setDockBadge) {
|
||||
});
|
||||
};
|
||||
|
||||
const getCurrentUrl = () => {
|
||||
withFocusedWindow((focusedWindow) => {
|
||||
focusedWindow.webContents.getURL();
|
||||
});
|
||||
};
|
||||
const getCurrentUrl = () =>
|
||||
withFocusedWindow((focusedWindow) => focusedWindow.webContents.getURL());
|
||||
|
||||
const onWillNavigate = (event, urlToGo) => {
|
||||
if (!linkIsInternal(options.targetUrl, urlToGo, options.internalUrls)) {
|
||||
|
Loading…
Reference in New Issue
Block a user