mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
Get Url of window #127
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ru-sh on GitHub (Feb 20, 2018).
Originally assigned to: @GregorBiswanger on GitHub.
Is it possible to get the url of a window?
I'm trying to detect if browser was redirected and find out where it was redirected.
@GregorBiswanger commented on GitHub (Feb 20, 2018):
Hey @ru-sh,
use from the chrome dev tool the console and type:
window.location.hrefAnother way is to send you the information over the IPC... As example:
Your HTML-View:
<script> var { ipcRenderer } = require("electron"); ipcRenderer.send("currentUrl", window.location.href); </script>Your C# Part:
public IActionResult Index() { Electron.IpcMain.On("currentUrl", (url) => { // Here you get the url from url parameter }); return View(); }I hope my answer helps you.