I am trying to manipulate the audio context fingerprint the browser leaves when using selenium webdriver.
I am using https://browserleaks.com/javascript to check the properties for my audio device and this are the results I am getting:
Now I am looking for a way to edit all these values using selenium or some kind of JavaScript hook.
One of the solutions I found was using this chrome extension https://chrome.google.com/webstore/detail/audiocontext-fingerprint/pcbjiidheaempljdefbdplebgdgpjcbe/related?hl=en
They are able to change the fingerprint hash, so the device is not detectable in pages like https://pixelscan.net/
However, I need a solution to do this programmatically.
Thanks for your time!
Related
In WebUSB to connect to a device we must select a configuration and interface.
There's also the option to using an alternate interface.
How can I know which ones to use?
Do I need to know this beforehand or can I try to detect for each device?
if (!device.configuration) await device.selectConfiguration(0);
await device.claimInterface(device.configuration.interfaces[0].interfaceNumber)
Lets say I can have thermal printers and cameras for example, would I be able to detect for each one?
Also, how can I check if a device is already claimed? Do I have to check every interface?
How can I know which ones to use? Do I need to know this beforehand or
can I try to detect for each device?
As https://web.dev/devices-introduction/#:~:text=human-readable%20protocol.-,With,-WebUSB%2C%20without%20clear says, without clear documentation for this device and what USB commands this device supports, it's hard but still possible with lucky guessing.
Watch Exploring WebUSB and its exciting potential from Suz Hinton. You can also reverse-engineer this device by capturing raw USB traffic and inspecting USB descriptors with external tools like Wireshark and built-in browser tools such as the internal page about://usb-internals in Chromium-based browsers.
Lets say I can have thermal printers and cameras for example, would I
be able to detect for each one?
Camera will likely be blocked. Inspecting your device in about://usb-internals/ will tell you as you should see "Blocked by WebUSB" when it's the case.
Also, how can I check if a device is already claimed? Do I have to check every interface?
In general, I'd recommend https://web.dev/usb/ and https://www.beyondlogic.org/usbnutshell/usb1.shtml to start respectively with WebUSB and USB.
For your specific questions, device.open() and device.claimInterface() promises will fail if those actions can't be performed.
I'm trying to install a google chrome extension on a large amount of my desktop computers using python. I've gotten Selenium to open a simulated browser with the extension, but that doesn't actually download it to the computer, so that doesn't necessarily help. My current code is
import webbrowser
webbrowser.open_new_tab(
"https://panelresearch.google.com/browser/extension/download")
This just opens the page where I can find the extension, can anyone show me a library where I can click buttons that are on this page?
Additionally, I'll need to identify the extension popup and I realized that I cannot inspect any elements in that popup.
As far as I know, there is no way of operating the extension popup using any API other than simulating the clicking on OS level.
When you're testing an extension using Selenium, you have to specify a custom profile as an argument during the start of the process connected to the WebDriver. More info here or use a special ChromeDriver API.
If you just want to force install an extension in an enterprise/educational environment, you can follow this guide.
You can also edit already existing profiles (to some extend and in my experience unreliably) by editing the Preferences file in the profile directory. Just make sure you have backups and an instance of Chrome is not running with that profile.
Good luck.
I'd like to have a single 'Get App' link that auto-detects the user's device type and browser and directs to the appropriate location (iTunes, Google Play, or website sign-up). I am currently using Onelink.to, but it has the following limitations:
if you're on iOS using a non-Safari browser (like Chrome) you end up looking at a bunch of raw JSON because it doesn't know to launch the App Store app. In this case, I'd prefer to direct to the iTunes website or better yet, deep link into the App Store app.
if using the link on your own site and a user is on a device that redirects to a different page of your own website, it complicates setting up event-based goals in Google Analytics
Are there any good JavaScript solutions that handle the App Store redirect while excluding this action on browsers that don't support the iTunes headers?
Thanks!
You can use javascript navigator.userAgent and parse it to detect the device. Then just generate the link according to it.
Here is an example for ios detection:
Detect if device is iOS
From the command line, I can open a url as a chrome application by running e.g.
chromium --app=https://www.stackoverflow.com
Is it possible to do open a url in this mode from javascript in an existing page? To be clear, the url should ideally be opened in a new window, which has the properties implied by the --app flag (e.g. no address bar), whether or not the current page is running in that mode.
My reason for asking is that I'd like to integrate this into vimium.
There is no way to do what you need directly from Javascript. I think you'll need to create an Chrome extension to do that.
You still can find an extension called "Open with external application" which do that, but its use NPAPI and NPAPI is not supported anymore by latest Chrome version. The source is hosted on BitBucket.
The new way to do the same thing is using the native messaging API. In this case the external application would have to register a native messaging host in order to exchange messages with your application. You can see more at http://developer.chrome.com/extensions/messaging.html#native-messaging
I'm trying to click on a javascript button in this site(its the search button on the left):
http://www.amadeusepower.com/trek/portals/trek/default.aspx?Culture=en-US
I couldn't find a way to click on it using htmlunit. Now I am thinking of switching to selenium but there is a problem. My application should fill the forms and get the results from the site and parse them to get some data from the results page and send it to an android device. It will need to run one instance for each android device connected to it so if I use selenium it probably will pop up a new window for each user and that may complicate things. I want to use a headless browser but as I said htmlunit has an issue which I asked in here How to click on a javascript button in htmlunit
Does anyone know a way to run selenium as a headless browser on windows or can you suggest another tool I can use in eclipse in windows for this purpose?
You can use phantomjs. It is a complete webkit based headless browser that has builtin webdriver support.