Programmatically retrieving the contents of the chrome://gpu url - chromium

I am trying to programmatically retrieve the contents of the chrome://gpu url.
As a start I tried to load up chrome://gpu from the command-line, but chromium refuses to start up with a url that is prefixed with a chrome: prefix.
Then I tried to out-clever that limitation by using a redirect page:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="refresh" content="7; url='chrome://gpu'" />
</head>
<body>
<p>Please follow this link.</p>
</body>
</html>
But that page, although it can be launched from command line, would not refresh for me.
Even clicking the link does not work, which leads me to determine that you cannot link to chrome://gpu at all.
When I tried right-click open-in-tab on the link, I get:
Which means that chromium is actively blocking access to it, unless it is typed out by the user.
I have two questions:
Can this block be disabled?
If not, how can I retrieve this information programmatically? Can I somehow feed artificial keystrokes into chromium?
Update 1
Tried to add virtual key-strokes with:
$ wtype test
Compositor does not support the virtual keyboard protocol
Update 2
I have gotten further: I can use ydotool to make chromium browse to chrome://gpu and then do Save-As, but that saves a nearly empty html page that references a gpu_internals.js script.
Is it possible to save the output of that script instead?

Access to the "chrome://gpu" URL is restricted and cannot be directly accessed programmatically. This restriction is in place to prevent malicious actors from manipulating the internal settings of the browser.
An alternative approach could be to use a headless browser like Puppeteer or Selenium to automate the process of retrieving the information from the "chrome://gpu" page.

I've found ydotool to be a good solution for this.
With it, you can automatically open a page to chrome://gpu and then click in the browser window, followed by Ctrl+A, Ctrl+C to retrieve to contents to the clipboard.
You can then use wl-paste from the wl-clipboard package to get it.

Related

Vue favicon doesn't change in ios chrome & safari browser

I alredy change the favicon.ico to the logo file which I want to use In Vue-cli's public folder, and named it the same file name.
In web browser the Favicon and title be changed successful
but in the mobile browser neither safari or chrome are fail
I didn't use pwa so probably not have manifest.json problem
And I already tried to clean both browser's cache or open it on Incognito Windows, but still the same, is anything I neglect to do with my index.html or vue-cli config?
You can add <link rel="apple-touch-icon" href="/custom_icon.png"> so that your favicon is shown when you favorite the page or view it in that tabs view. This is mentioned here.
For the webpage itself its very likely your iPhone is still caching the old icon regardless of your attempts to clear said cache. In my experience trying to load the page with no network connection, waiting for the time out error and then connecting to the network and reloading the page is the best way to "force" the device to clear its cache. Alternatively with the dev tools open and a keyboard attached type command + option + r. If not, patience, it'll update... eventually.

Displaying TVHeadend stream in a browser

I am trying to display a TVHeadend stream in the browser as a pre-cursor to get this running on my TV. So I whipped up this sample HTML code where 192.168.0.4 is my server running TVHeadend and the channel UUID is 3df2b09783d8afeb8a323f5025431df7:
<html>
<body>
<video width="720" height="567" autoplay="true" controls>
<source src="http://192.168.0.4:9981/stream/channel/3df2b09783d8afeb8a323f5025431df7?profile=webtv-h264-aac-matroska" type="video/webm">
Your browser does not support the video tag.
</video>
</body>
</html>
Whether I show the HTML page locally on my computer or served via a local Apache webserver, the result is always the same: I get an emtpy video player control. The network tab does not show any errors, neither does the console. It does bring a warning however:
"Empty src!"
However the src is clearly not empty.
When I copy the src URL to my browser (Chrome) and call it, it starts downloading the stream (instead of showing it, but that might be expected). Why does the video control not seem to be able to show the video?
Do I have any other debug options I can check out? This problem has bugged me for a while now and I have tried to drill down to the source of it by removing the TV SDK and all other side code just to see if the actual video will play (which it does not).
At first I thought it might've been an authorization issue but then why does Chrome seem to be able to download the stream just fine? I have logged on to TVHeadend in the same browser (in a different tab) to make sure that a missing logon is not in the way of things.
I have also tried putting : in between the "http://" and the IP address to pass the parameters required for basic auth - but to no avail.
Does somebody have any hints as to what might be the roadblock here?

How to preview a static site?

With Ruby on Rails I can run rails s -p 3000 and preview my site at localhost:3000.
With React I can run npm start and view the site at localhost:8080.
What if I just have html and CSS files, how do I preview that?
On OSX, you can run a simple web server from any directory using this command:
python -m SimpleHTTPServer 8000
Then, you can hit the directory in your browser by going to http://localhost:8000/path/to/file.html
You can try click 2 times in index.html to open the file in browser.
Every time you update the code in sublime text, you need to reload the browser and the updates will be aplied.
This usually depends on your device/OS and what your eventual goals are, but usually you can either use (online) software that renders the HTML and the CSS for you (such as Brackets.io, etc.) whilst you are typing it (to live preview any modifications/additions), or you can put the documents live using a local webserver such as Xampp or OSXs built in simple web server, and check their respective localhost locations every time you save changes using your code editor.
You could also simply use online applications like Codepen, which can also render HTML and CSS, and even JavaScript. Codepen just today launched Codepen Projects which allows you to create entire website projects at their website. It is however, a pro (paid) feature.
Here's a short overview of code playgrounds that offer the functionality you requested (by no means an exhaustive list):
JSFiddle
CSSDeck
CodePen
JSBin
And ofcourse you can insert Snippets here on StackOverflow, which is also able to render HTML and CSS (and JS).
If you really only use HTML and CSS, previewing in a browser is also possible, opening the .html file by double clicking and opening in Internet Explorer, Chrome, etc.

IE 11 Compatibility Issue, setting document mode to 9 by default after making changes also in meta tag

I made changes in the master page of my SharePoint site. I have added a meta tag in my header like so:
<meta http-equiv="X-UA-Compatible" content="IE=8,9,10,11" />
and I've also changed the doctype, but the emulation is still rendering in IE9 document mode.
Attached is the screenshot.
Please let me know where I need to make changes. This site is using custom master page. I have updated it in the Custom as well as the V4 master page but no luck.
A few suggestions:
Set the content attribute of the <meta> tag to "IE=8" instead of "IE=8,9,10,11".
Make sure that the <meta> tag containing your IE rendering directive is the first <meta> tag in the header.
To prevent the F12 developer tools window from forcing the page into a particular document mode, close all instances of Internet Explorer, then start it up again and revisit the site without the F12 developer tools open. Open the F12 developer tools to check the page document mode only after the page has loaded.

vb.net Webbrowser Control not displaying Javascript

I have tried this on numerous pc's and are receiving the same error. My webbrowser control isnt displaying javascript or jquery.
Here is a example:
when i visit this url in my browser: https://binarykings.co.uk/traderoom-aspx, it looks great with the charts and prices etc.
example: http://i.imgur.com/1Lmq4em.png
same in internet explorer: http://i.imgur.com/3KP864X.png
however in my vb.net webbrowser control it looks like this: http://i.imgur.com/qjme2Yg.jpg
What is causing this ? Its not just this site but any other site that has a similar way of displaying things via jquery/javascript.
I do have script errors suppressed however when i disabled this and clicked yes to the errors manually it still displayed the same empty page.
Thanks
The WebBrowser control uses the Internet Explorer rendering engine. But by default, for compatibility reasons, it is stuck using the IE 7 rendering engine, even if you have a later version of the browser installed on your computer.
There are a couple of ways to convince it to use a newer version of IE to render the page. One involves editing the registry, while the other involves modifying the web page.
In general, it is best to avoid attempts to solve local problems with global solutions like registry edits. There might be another app running on the same machine that uses the WebBrowser control and relies on the behavior of the IE 7 rendering engine. If you go changing global settings, you'll mess up that other app.
Therefore, the best solution, if possible, is to edit the web page. This is quite simple, and probably a good idea anyway. All you need to do is add the following code inside of the <head> section:
<meta http-equiv="X-UA-Compatible" content="IE=9" >
If you absolutely must use the alternative approach of editing the registry, you'll find the information you need here in the documentation.