opening default browser with delphi at specific position - delphi

I want to open a web page at default browser at a specific position and also open another webpages at that one, not new task of that browser. maybe user opens new task of that browser but by clicking a button in my delphi program the selected web page have to open at first one. is that possible? my company wants me to program such thing BUT I do not know how to do. I really appricate any help. thanks.

There are instructions here to open the default browser, but you may even be able to "run" a url, as you can from the Windows run command. You then need to retain the handle of that process so that you can do something with it.
To open a web page at a particular point you would ideally use a named anchor in the page, ie, the bit after a hash: http://www.w3schools.com/TAGS/tryit.asp?filename=tryhtml_a_name If you don't have control of the page and there are no named anchors you could try scrolling: How to scroll the scrollbar in external application via WinAPI?

Related

Is there a way to dismiss a native authentication dialog when using Playwright?

I'm using Playwright (Java) to drive a particular third-party Web site, the first page of which apparently containing two images which are password protected; this causes a sequence of basic-authentication dialogs to open when the page loads.
I'd like the script to dismiss these dialogs (cancel), rather than providing any credentials, and then continue working with the page. But as it stands now, the page.navigate() blocks and eventually times out, unless I cancel these dialogs manually with the mouse.
Note that this is the native browser dialog, not anything generated from js on the page.
Is this possible with Playwright?
Interestingly, I was able to work around this by disabling images entirely in Chrome, which might have other (performance) benefits, too.
Added this to the array of Chrome startup arguments:
--blink-settings=imagesEnabled=false
Of course, this only solved this specific case, in which the login prompts were being triggered by image URLs.

Edge developer window automatically pops up

I am doing some web development using Blazor Wasm framework.
I use Edge for debugging. For some reason the browser automatically pops up the following dev page, meanwhile the startup page is in loading status for 20-30 seconds.
Did you experience anything like this or can you suggest anything for fix?
Perhaps when you choose a browser to debugger the Application, you are adding the arguments to open the devtools.
For example, I'm using visual studio 2019, click the down arrow to the right of "IIS Express", and select the "Browse With..." option. The "Browse With" dialog box will open. Click the "Add" button.
Then, in the Program field, enter the path to Microsoft Edge. In the Arguments field, enter the command line switch to open devtools, --auto-open-devtools-for-tabs. In the Friendly Name field, enter something descriptive, for example, Edge Bate w/ DevTools.
After that, when we select this option to browse the website, it will open the website with devtools, like this:
So, check your Visual Studio, and try to re-add the browser without arguments.

URL Redirection Issue in DNN

In my local environment of a particular site, when i click on a particular link ,it redirects to the same page but in the url it shows that the page has been visited.Again when i click on the link, it will direct me to that page. Any reason as to why this happens and what could be the possible solution.
For example: My sites name is abc.com. It has pages like help, contact etc. When i am on my homepage and click on help it redirects me back to my home page but in my browser the URL is shown as abc.com/help.
When i click on help again , it redirects me to the help page(URL in browser is abc/help/Help) on the second click.
This can happen if the cache or system index has been corrupted. The best solution is to typically stop & start the application and see if it comes back.
If it is still an issue and you are on an older version of DNN, make sure that the PortalAlias table doesn't have a trailing / on your portal alias.
If this isn't the case, it is possible that a custom URL impacted this, but doubtful.

How can I make visual studio open the controller Im currently on be default when debugging?

Right now it always goes to default.aspx that subsequently opens the default controller but I would like to go directly to the controller I am editing when I hit the debug button.
Right click on the Web Site in Visual studio and select Property Pages. The Start Options section gives you flexibility as to which page loads first. You can choose and set the Start URL option to something like http://localhost:1324/Home/Index to force debugging sessions to default to the HomeController's Index action.
This requires two things to be true:
1234 is a static port used by the Cassini web server when debugging your pages (you can change this behavior by pressing F4 on the web site's project and setting the Use dynamic ports setting to false and the Port number field to a port of your choosing.
The Web Site automatically starts up when you run the application from Visual Studio. Make sure it is by selecting the Property context menu item from the Solution's right click menu and editing the Common Properties -> Startup Project settings.
Alternatively, you can use the Use Current Page setting of the Start Options dialog. Developer beware though, as I'm not sure how MVC-aware this option is.

Clicking relative link goes to about:<relative link> which does not show wanted page

I am using version 14.67.9 of TembeddedWB in a project in delphi 2007. I use TembeddedWB in combination with loadfromstring. That all works like I want it to but when clicking on a link in the page it goes to a page I am not expecting. If for instance the page is on a particular IMDB result site and one clicks on the link the browser goes to about:/title/tt1041829/. I guess I forgot to set some extra property or I am doing something else wrong. If somebody here can point me in the right way i would appreciate that.
It looks like the browser's current URL is not updated and the default "about:blank" is used. I guess this may happen when you don't navigate to the web site directly by Navigate or Navigate2 method but load the HTML from a local file or stream.
Edit: I see, you are using LoadFromString which confirms that.
In that case, it should be possible to use OnBeforeNavigate2 event to fix the URL.
The problem is that the web page you are accessing uses relative links and the reference point that it would be relative too is your loadfromstring which loads through the "about:blank" page. Another way of fixing this would be to inject a &LT;BASE href="http://www.originaldomain.com/originalpath"&GT; tag in the HTML header (between the &LT;HEAD&GT; and &LT;/HEAD&GT; tags) which points to the location the page was accessed from. This will tell the browser where relative tags start from and will fix the problem without requiring inspection of every link.

Resources