Is it possible to open tabs in existing window? - javascript

Let's say there is a page behind a login system that I would like to run puppeteer for web automation and for simplicity, I don't want to launch a new browser and enter the login system with puppeteer. Instead, I want puppeteer to activate the tab where I've manually logged in to the system.
I found something like page.bringToFront() but it works for pages, not windows/browser.
This leads me to the question: Is it possible to open tabs in existing window with puppeteer?

Related

What's the correct way to open an app from a Landing Page?

I have an app developed in Ionic V4 which uses the deep link plugin, and a landing page developed with HTML and Javascript.
the landing page uses location.href = "com.orgName.appName://" to open the app.
The flow is:
a customer receives a link via SMS and when he clicks it he is redirected to a Landing page.
The landing page checks the operation system (Android or IOS) and then checks if the app is installed on the phone. If it is, it opens it and if not it takes the customer to the App Store/Google Play.
This used to work up until not long ago. now, it says "Redirect Blocked".
I read some articles and found out Chrome blocks the redirect on page load, so you need to create a button for the user to click, and then it works.
Our customer insists that the app/store will open without the user interaction.
I found an app which does that successfully, but I can't inspect to see how they did it because the logic is done on their server.
I've tried:
using location.href on page load or on load events
wrap the redirection in a SetTimeout
use window.open which works for the most part, but not on all devices + requires the user to allow popping windows.
using document.getElementById on a button, and invoking the click() function

How can I manage websites settings in electron

I'm creating a browser using Electron. And it opens websites using webview.
<webview id="View" useragent="..." src="https://example.com/" plugins="" preload="file/dir/webview.js" webpreferences="..." enableremotemodule="false" allowpopups=""></webview>
Now I've got a question, how can I detect when a website is trying to request access to something using JS/Node?
The explanation of my question:
Every website in chrome has its own settings, and they can be access by clicking Site settings in the page info window (look up in the picture) or by going to chrome://settings/content/siteDetails.
And the website settings include whether it can or can't access the user location, use the microphone, use JavaScript, Senf Notifications, etc.
How can I control those settings of websites in electron?
And how can I detect when a website is trying to gain access to one of those permissions? (just like how Wexond does, Wexond is a browser that is built using Electron)

How to restrict more than one session to the Website?

I need not to allow user to open more than one tab or browser window of my website (index.html). So user must have no opportunity to open website in Explorer and Chrome at the same time. This must be done with pure JS or Nodejs. How it can be done?

Chrome extension navigate and scrape several different sites

I want that my chrome extension would navigate to Gmail login page, run a content script that logs in and then to navigate to another site (let's say drive.google.com) and then run another content script.
I want the user to monitor the process and that's why Selenium and PhantomJS are not suitable.
How can I identify that the login was successful?, I tried using MutationObserver but it doesn't work after redirects.
thanks

Close a browser tab opened by Android app

I have an issue where I'm asking my app to open a browser looking at my Server.
From that server page, The user can perform some stuff on an existing site, then redirects the user to a URL that the App catches and the App continues as normal.
The lifecycle looks like this:
App -> Web Site -> App
However, after the life cycle of the app and the app is closed, the webpage is still open in the browser (on the page where the redirect to the app occurred).
It's apparently difficult via javascript to close a tab which wasn't opened by javascript? (In my case, the tab was opened by the app, not by a different tab). Is there any way to get around this?
(I'm aware I could use a WebView, but WebViews are buggy, manufacturer specific, security holes that I want to avoid)
No, sorry. There is no standard Intent structure for this. While it is possible that some browsers offer something, I am not aware of any that do.
Bear in mind that there is no requirement that your ACTION_VIEW Intent open up a browser tab, as the user's chosen browser may not offer any sort of tab UI metaphor. check this reference old question

Categories

Resources