I am planning to use chrome.exe to take a png snapshot of a web page.
The web page has references to js files that are served by an application server. Application server needs session cookies to authrize and server the pages.
I could not find any options to pass cookies to chrome.ext.
I have searched in google, but most suggestions are pointing to use selenium web driver. Making use of selenium web driver for chrome is making me choose compatible versions only. I have to frequently update the driver if the chrome version changes. It is not acceptable for my use case.
Executing the command mentioned below using java process builder.
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe " -headless -hide-scrollbars -disable-gpu -screenshot=C:\Users\abc\Desktop\tmp\file1.png C:/Users/abc/test.html
I need a way to pass cookies without using any third party libraries (webdriver, puppeteer etc..)
Related
Unable to parse Build/Pain.framework.js.br! Loading pre-compressed (brotli or gzip) content via a file:// URL without a web server is not supported by this browser. Please use a local development web server to host compressed Unity content, or use the Unity Build and Run option.
Monopoly A3
The message is pretty self-explanatory: you'll need a local server to do that. They're countless ways to do that but here's one of them:
XAMPP
Just download it and run it (The XAMPP Control Panel - Apache -> Start). Then put your files in C:\xampp\htdocs\ (On Windows, not sure for other systems).
C:\xampp\htdocs\ Will be the equivalent of http://localhost in your browser, so if you put example.txt in C:\xampp\htdocs\, it will be available at http://localhost/example.txt.
Other options
XAMPP is my personal favorite, but they're other options, like the other *AMP, like WAMP, MAMP and LAMP, for Windows, MacOS, and Linux respectively (XAMPP being multiplatform - Also more exist is you're curious).
They're also "simpler" solution (in the sense of more lightweight ones) like http-server for NodeJS, or Python's http.server. But they need to be executed on the right folder each time. Both solutions works fine so it's up to you to choose your preferred.
I'm trying to run tests in headless Chrome using Geb. Before enter the page, I have to select client certificate for authentication. How to do this in headless mode?
Robot class not working without UI.
Is there any way to handle certificate selection? I read about policies and AutoSelectCertificateForUrls but I can't find way to load policy from file or set this particular parameter as option/argument (Chrome on Linux).
In PhantomJS there is option to provide certificate as argument but how to do this using Chrome driver?
I had the same problem and ended up running in headful mode instead. There are some stuff required to be installed on the server though to be able to run Selenium in headful mode. I wrote an article on the subject using Selenium with .NET Core in linux with environment setup through docker.
https://sgedda.medium.com/running-selenium-with-chromedriver-together-with-client-certificate-set-in-headful-mode-with-net-a79bde19e472
Dockerfile
https://gist.githubusercontent.com/sgedda/584aa35a0d9162ad24f9cca836266959/raw/1fc0b4e6e8c76b791437bc847b67b2ed676c5d9b/Dockerfile
I have a web application hosted on azure apps that I publish using visual studio. It is a flask app. One of the templates is called searchresult.html. I am making changes to this file that are made when I run locally. When I run it on the server though the changes are absent.
Using the azure console I can see that the changes are present in the file that is stored on the server, but the application continues to deliver the old html.
How can I force azure to see my updated file?
Things I have tried:
Deleting the file directly on the server and re-publishing it
Committing changes to git, even though I knew that would do nothing
Testing it locally (it works)
Restarting the application
Since you said you already check the file has been changed on the Kudu, so it supposed not an issue of deployment. You could disable caching in your browser.
such as in chrome browser, navigate to F11 window and select the Disable cache blanket.
or please try to access your website via incognito model.
In addition, I crashed into similar issue with you in other web app. My previous solution is that enable always on option on the portal and restart my app, it worked.
Just for your reference.Hope it helps you.
I want to build a web site using my laptop in areas where I often do not have internet access - no active browser. How do I check my pages to see how things are going without a browser?
Just drag-and-drop the .html file into your favourite web-browser. It should open up with the "file:///" protocol automatically.
You should always have a local web server installed on your machine for development.
For example, Mac OSX comes with Apache pre-installed. You might have to activate it. You can also install a server language like PHP or Python. Again, OSX comes with those pre-installed, might just need activation. Google how to set up a local server on the type of OS you have.
You should try to replicate the type of server setup you will be using in production.
That will permit you to code locally and test in your browser.
You should also use some kind of versioning system like Git. So, you code on your local machine, then you can push your code to the cloud once in a while for backup. When you're ready, upload your code to the production server and try it out.
I am developing a chrome extension which needs to fetch some configuration from a system file... Earlier chrome provided NPAPI plug-ins, which could access any system resource (win registry, file system, IPC calls etc...)
However knowing that NPAPI will be discontinued soon, i am looking for alternatives.. one of the ways to build a plug-in is using Pepper clients, but pepper clients read/write only to chrome local storage.. which looks like a more data version of cookies...
So is there any other alternative to access system resources (like registry, files etc) in chrome extensions now??
The suggested alternative to NPAPI for many cases is "Native Messaging", where you provide an installer to users which adds binary code that chrome can communicate with via message passing. See http://developer.chrome.com/extensions/messaging.html#native-messaging.
For file access, in packaged apps there is the fileSystem API that lets you get access to the actual (non-sandboxed) filesystem. See http://developer.chrome.com/apps/fileSystem.html.