Is there a way to dismiss a native authentication dialog when using Playwright? - 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.

Related

New Google one-tap sign-up from extensions

It looks like calling the googleyolo javascript object doesn't work with chrome extensions, probably because it's using an iframe with redirect under the hood, that extensions do not like.
Am I right in thinking chrome extensions are not supported? If yes, does anyone know if there is a plan to support them?
That’s correct. Currently the API expects the calling page to not run inside an extension. We may change this in the future. However you can accomplish what you want to do via a chrome tab launch to a well known page which the extension can inject content scripts into, and notify via chrome cross tab messaging after sign in.

Electron WebView Back Button clearing form

I want to add back and forward navigation button to my browserWindow in my Electron App, but although with Firefox and chrome when we use the back navigation any form input are reloaded with cached data with Electron webview using goBack()function clear these everytime. Is there any setup, options or way of keeping the data ....
It isn't clear.
Electron documentation doesn't explicitly state whether Electron implements what is called BFCache or HistoryLists.
It isn't clear from Electron source code either. I created relevant issue on Github.
Electron uses Chromium to implement BrowserWindow. Situation with BFCache and Chromium itself isn't very clear. There are multiple issues that state
that BFCache isn't implemented in Chromium (455226 Chrome reinitializes all fields to the value they had on their initial presentation when history back is used, 510340 Investigate faster back/forward page navigation). Although I've seen in practice that BFCache works in Chrome.
You can save and restore form state using JavaScript, sessionStorage and window load and unload events. But in this case you also need a mechanism to clearly identify input nodes and store serialized files in case if form contains file inputs.
For more information check:
You Do Not Understand Browser History article by Matthew Beale
Window.sessionStorage MDN page
MDN page about BFCache

Open a new browser Window from a webview, without user input

I'm looking for a way to open a new browser window from a WebView, from a wp8.1 RT, silverlight or UWP app.
It should happen when the page loads, or after a few seconds, without any user input (I know it's possible if the user clicks on a 'target="_blank"' link)
Does anyone know if any way to do this exists?
I tried with window.open, jquery's .click() or .submit(), but nothing...
Neither the the javascript alert() works, it does work instead redirecting to a uri protocol with location.href and open an app, but unfortunately IE/Edge doesn't have an app protocol to launch it...
Any help would be much appreciated.
Since you put both Windows Phone 8 and Windows 10 in your tags, I can't be sure what to offer you here. SO I will tell you how to do it in 8.
JavaScript in a WebView can call external C# code by using ScriptNotify. You can read more about that in this question: Call Native C# from WinJS that's loaded in a WebView
Also, once you are in C# and you want to launch a browser, the answer is to use the LaunchUriAsync API. Read more about that here: https://msdn.microsoft.com/library/windows/apps/windows.system.launcher.launchuriasync.aspx
Best of luck!

opening default browser with delphi at specific position

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?

grails - how to view resulting page source javascript, when it is updated via Ajax via rendering of a template, for example

If one uses remoteFunction or one of the the Grails Ajax capabilities, rendering a template to update a portion of a page, how does one see any additions made to the Javascript functions associated with the resulting page in Chrome or Firefox?
In Chrome, one is able to see the updated page/DOM via going to their Tools -> Developer Tools menu item, then selecting "Elements". There, I'm able to use the magnifying glass to select a portion of the updated page that I want to see. But, how do I also see the additional Javascript functions added to the page.
NOTE: Originally this question requested to see both html element content and Javascript content. Karthick AK's answer handles both.
In Chrome->Developer tool-> Network tab,
For each request being sent the response obtained can be seen in the Response tab. The rendered content can be seen in here.
Similiar option exists for firefox/firebug.
Another ajax gotcha i have experienced is, sometimes the ajax requests are cached and hence onclick the content is served from the cache and not an actual requests hits the server. This is more prominant in Old IE browsers

Resources