mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-01-24 07:38:36 +00:00
When the `getCurrentUrl` function was refactored to make use of the `withFocusedWindow` function in ac99c6424d7326ad7d1da86922866e6776ce3220, 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 withFocusedWindow = (block) => {
|
||||||
const focusedWindow = BrowserWindow.getFocusedWindow();
|
const focusedWindow = BrowserWindow.getFocusedWindow();
|
||||||
if (focusedWindow) {
|
if (focusedWindow) {
|
||||||
block(focusedWindow);
|
return block(focusedWindow);
|
||||||
}
|
}
|
||||||
|
return undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
const adjustWindowZoom = (window, adjustment) => {
|
const adjustWindowZoom = (window, adjustment) => {
|
||||||
@ -194,11 +195,8 @@ function createMainWindow(inpOptions, onAppQuit, setDockBadge) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const getCurrentUrl = () => {
|
const getCurrentUrl = () =>
|
||||||
withFocusedWindow((focusedWindow) => {
|
withFocusedWindow((focusedWindow) => focusedWindow.webContents.getURL());
|
||||||
focusedWindow.webContents.getURL();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const onWillNavigate = (event, urlToGo) => {
|
const onWillNavigate = (event, urlToGo) => {
|
||||||
if (!linkIsInternal(options.targetUrl, urlToGo, options.internalUrls)) {
|
if (!linkIsInternal(options.targetUrl, urlToGo, options.internalUrls)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user