Recently, there are some visits to my site with UserAgent "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; LSIE 1.1.8.4)". What does the "LSIE" stand for?
LSIE is an additional information added to the UserAgent string
Usually a part of the UserAgent is used to add additional info about the used browser/machine/factory; LSIE seems to be an additional info added from BenQ-Siemens systems.
LSIE stands for "large scale internet extraction," which was program by the government to scrape the internet.
After Snowden's revelations the project's name was changed. I think the new name was "Everest."
Related
I am trying to automate a web-app (company specific) using Cypress which contains a page to take a picture using a web-cam. On clicking the 'Take a Photo' button, it shows an error message asking to provide access to the camera.
But, a browser pop-up is not displayed asking for permissions unlike the open-source website - https://webcamtests.com/
On looking at Cypress documentation, a default set of Chrome switches are being added to the browser before the launch which also includes
'--use-fake-device-for-media-stream'
'--use-fake-ui-for-media-stream'
I've removed them using the below code that is placed in the config file .
launchOptions.args = launchOptions.args.filter((arg) => {
return arg !== '--use-fake-device-for-media-stream' && arg !== '--use-fake-ui-for-media-stream'
})
Also, in the documentation it specifically says this reg the default switches- https://docs.cypress.io/guides/guides/launching-browsers#Launching-Browsers
"Disables prompts requesting permission to use devices like cameras or mics"
Am looking to see what is the corresponding switch for this and is there a way to enable the prompt to provide access?
Any help/suggestion is appreciated.
Cypress Version: 12.5.1
Chrome Version: 109
Platform - Mac
Note:
I've also tried using an open source library for enabling the camera permissions but it did not work.
https://github.com/kamranayub/cypress-browser-permissions
The prompt is displayed when automated using Web-Driver.
Please try this:
cy.request({
method: 'GET',
url: 'https://webcamtests.com/',
headers: {
'Content-Type': 'text/html',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36'
},
followRedirect: false,
body: {}
});
Above test simulate a real user request to the target website and trigger camera permissions pop-up.
Please keep in mind, it might not work for all websites as the pop-up is controlled by the website and user's browser.
I'm trying to assert that there is no mixed content in a website. I have set the log level equal to 1 in the chrome switches , but i m still unable to retrieve warning messages from the browser, here is the code im using.
browser = Watir::Browser.new :chrome,
switches: %w[--disable-gpu --no-sandbox
--disable-prompt-on-repost
--windows-size=3200x1800
--log-level=1]
console_log = browser.driver.manage.logs.get (:browser)
What am i doing wrong? or there is other way to set this log level to capture errors and warnings?
Work done ,, just changing the way i was passing the settings to the browsr is working
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--disable-infobars')
options.add_argument('--disable-gpu')
options.add_argument('--no-sandbox')
options.add_argument('--disable-prompt-on-repost')
options.add_argument('--user-agent="Mozilla/5.0 (Linux; Android 6.0.1; SAMSUNG SM-G925F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/4.0 Chrome/44.0.2403.133 Mobile Safari/537.36"')
The code below works fine in HtmlUnit 2.27, but the setUserAgent method is not available in 2.28 what is the correct way of setting the useragent now?
BrowserVersion bv = BrowserVersion.CHROME;
bv.setUserAgent(
"Mozilla/5.0 (Linux; Android 6.0; XT1063 Build/MPBS24.65-34-4; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/59.0.3071.125 Mobile Safari/537.36");
Starting with 2.28 it is no longer possible to modify the build in browser versions. There are various reasons for this and we had some discussions about possible fixes on our mailing lists.
In the end we are using a factory pattern to setup new browser configurations and make them unchangeable afterwards.
final BrowserVersionBuilder myChromeBuilder = new BrowserVersion.BrowserVersionBuilder(BrowserVersion.CHROME);
// do your setup here
myChromeBuilder.setXXX(..);
final BrowserVersion myChrome = myChromeBuilder.build();
If you like you can also use a more fluent style for the code
final BrowserVersion myChrome = new BrowserVersion.BrowserVersionBuilder(BrowserVersion.CHROME)
// do your setup here
.setXXX(..)
.build();
I am trying to fetch an image from amazon with the following code. It fails to download the image, but if I do it with Internet Explorer, it works. Is there another way to simulate IE to make sure it gets the data?
Dim wc As New WebClient()
wc.Headers.Add("user-agent", "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2")
Dim bytes As Byte() = wc.DownloadData("http://ecx.images-amazon.com/images/I/41NGYbQ1G0L._SS160_.jpg")
Dim ms As New MemoryStream(bytes)
You may use the DownloadFile method.
WebClient.DownloadFile Method (MSDN).
In my project, I want to get the PC name of the client user
but the methods I am using just give me the PC name of the server:
System.get(user.name)
Sorry you can't directly
Your best bet is User-Agent header. You can get it like this in JSP or Servlet,
String userAgent = request.getHeader("User-Agent");
The header looks like this,
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.13) Gecko/2009073021 Firefox/3.0.13
It provides detailed information on browser. However, it's pretty much free format so it's very hard to decipher every single one. You just need to figure out which browsers you will support and write parser for each one. When you try to identify the version of browser, always check newer version first. For example, IE6 user-agent may contain IE5 for backward compatibility. If you check IE5 first, IE6 will be categorized as IE5 also.
You can get a full list of all user-agent values from this web site,
http://www.user-agents.org/
With User-Agent, you can tell the exact version of the browser. You can get a pretty good idea on OS but you may not be able to distinguish between different versions of the same OS, for example, Windows NT and 2000 may use same User-Agent.
Remember the scope the client could be behind a proxy
A smart idea is to use javascript and send infos via ajax call
Browser, Operating System, Screen Colors, Screen Resolution, Flash version, and Java Support should all be detectable from JavaScript (and maybe a few more). However, computer name is not possible across all browser at least.
You can do it with IE 'sometimes' as I have done this for an internal application on an intranet which is IE only. Try the following:
function GetComputerName()
{
try
{
var network = new ActiveXObject('WScript.Network');
// Show a pop up if it works
alert(network.computerName);
}
catch (e) { }
}