The Emacs eww doesn't load the YouTube - emacs

When I type the command eww and enter the url google.com it just loads the front page of Google nicely just the way it should be loaded.
But when i search for YouTube on this Google front page and hit search, a new buffer starts but nothing gets loaded on it. Just nothing.
Only the cursor remains still at the beginning of the buffer for the whole time.

I believe this is also your question?
https://old.reddit.com/r/emacs/comments/vc3zxs/the_eww_doesnt_display_my_html_file_like_it/
Both questions can be answered thus:
eww is not a fully-featured web browser. Not by a long shot. It handles much of the basic markup, which is entirely sufficient in certain cases; but it is absolutely not a full replacement for the likes of Firefox as far as the web in general is concerned.
Of particular note1:
Stylesheets are not supported (which seems relevant to the other question).
Javascript is not supported (which is relevant to this question).
That all said, there is experimental work for handling <video> elements in eww if you have built Emacs from the master branch with xwidget support. See https://lars.ingebrigtsen.no/2021/11/09/finally-videos-in-eww/ for more. This will (probably) be included in Emacs 29.
1 In an ideal world, most web sites would function acceptably in the absence of both these things. In reality, that's not even close to accurate. The web developers who care about users without javascript have been on the losing side of that battle for about 15 years, and it's only getting worse as time goes on.
On the positive side, I think the CSS situation is actually improving slightly on account of the Accessibility requirements which various governments have introduced in recent years, as these requirements always have "use correct semantic markup" at their core. That still doesn't help you when a lack of javascript results in a blank page, but it's something...

Related

Google Chrome Code Coverage - Removing the unused code

I have a hand-me-down WordPress site (passed down from one dev to another, to another, and so on), which is more or less a garbled mess. I'm on the fence between wanting to optimize it and starting fresh. After checking the current state of CSS files with Chrome's Code Coverage, it seems that a lot of the rules (98%, according to the Code Coverage tool) are unused.
Other than testing different resolutions and checking if anything is changing, is there a better (more efficient) way for me to know whether the CSS rules are truly unused? I've been resizing the browser window, and reloading the page (just one out of many), but the number of unused bytes was always the same.

How does being blind affect your coding style? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
The question of how blind people program has been answered over and over already, but I couldn't find anything on how being blind and using a screen reader or braille display affects your coding style.
Can you tell code created by blind people apart from other code?
Does being blind cause you to think differently about a problem and look for other solutions?
I'm a blind developer. I will try to answer to your question according to what I do and what I already saw in codes coming form other blind developers.
However, remember that my answer absolutely isn't a reference at all. There are probably as many different usages, habits, preferences as sighted common developers have.
When working in a company and/or for an open source project, we have anyway to format our code as defined by the rules of the given company and/or project. There is no question, it's required.
IN this case me and most of the blind programmers I know of first write unformatted code, compile, test, etc. and only format it when it's time to commit.
Auto-formatting tools as there are in IDE are extremely precious, otherwise it would often be a real pain. If not using an IDE, command-line tools are also common, e.g. astyle for Java and C/C++.
If a given format isn't required by a company and/or project, many of us:
don't indent code, as it usually is more pain to navigate and edit within it, especially if we want to take care of not breaking it. In contrary to sighted people, indentation generally don't help us to quickly identify blocks. Even with a braille display if we have one, we can only see one line at a time.
use other tricks to identify where blocks end, if necessary in case of doubt / when nesting is deep. Most often, this takes the form of a comment following the closing brackets, e.g. } // end for. When the need arrise to do this, it can be a good indicator to tell us that we should better organize the code / better split into different functions.
use a lot of small tricks to be able to jump quickly to a part of code of interest. This can be simple comments like //constructor, which can be immediately be found with Ctrl+F, but it can also be more subtle. For example, one of my personal tricks is to put a space between the name and the open parent when defining or declaring a function, but don't when calling the function. So I can quickly go to the definition (by searching for "name ("), or the places where it is called (by searching for "name(").
hate ASCII art because it's totally useless, ex: a long line of /**********
often use shortcuts to avoid long code that give no real information, e.g. import java.util.* instead of importing 50 classes one by one.
often prefer using simple text editors rather than complex IDE, or only use them for specific functions such as auto-formatting because it's absolutely needed. Two reasons for this: many IDE are unaccessible, only partially accessible, or are mostly accessible but it's not necessary easy or comfortable to use a given feature; or because responsiveness with speech and braille displays is quite poor, i.e. when pressing up/down arrow to read the next/previous line of code, there is a too long delay before it starts speaking (it becomes quickly very annoying, if you multiply 100ms a thousend times).
Well, I answered this question partially here. Basically, you rarely can tell that a piece of code is written by a blind person, unless he/she breaks rules in quite a rude fashion (for example, uses tabs and camelCase instead of spaces and snake_case in Python, like me).
but even those things might be seen only in individual pet projects or quick and dirty scripts. Most of the blind people acknowledge they live in a sighted world, and if you want your pull request to be merged or your code to be reviewed by a superior at work, you must obey the code styling of the project, whether you like it or not, whether you're blind or not. In this situation people at Go made a wise decision to include a formatting utility that every Go developer must run before committing his/her code. "Nobody likes the Gofmt style", says Rob Pike, and he's wrong: I like its style very much: camelCase and tabs, what a delicious thing! But even you don't like it, you must run the tool because it is the language rule to do so.
And to the last part of your question: yes, being blind sometimes makes me to choose a solution, namely a language. As I hate snake_case, I can't think about serious development in Rust, for example, because (again) it's a language rule to write code like this. I do write Python code, but it's... oh well... kind of other thing because Python is so quick and flexible in resolving everyday problems that here I decided to cope with its (annoying) multiple underscores and the absence of block ending markers. BTW, another possible sign of a blind coder is comments like this: } // end if (in something like Javascript or C), or #end if as a whole line in Python. I don't deny sighted people can use those, but if you see every if and for and while ending commented like this, a great chance is that the code was written by a blind person. I personally don't do this, but I know people that like it very much.
I know this question is quite old, but the answer might be relevant still:
I am blind developer and I always intent to follow a coding style of a company or some standard given by developers of a language.
I always indent my code instantly when I write it and screen reader reports the indentation level. Honestly I do not longer have a habit to read unformatted code, but I know blind people who do;
Do the regular docblocking;
Fold/unfold some parts of a code when I need to navigate through large chunks of it;
Regular snakecase / camelcase habit (depends on a language);
Sometimes write longer lines of code and then use IDE to fix the formatting, because it is not always that longer code tends to be more complex for me to read;
Try to enforce myself to restrict the length of a line to be no greater than 80 characters, but it's a bit of a pain to ensure that to happens due to a lack of a good tooling;
Sometimes add some useful comments to help me to debug code (I mean some calculations / formulas in a comments that are not necessary important to others, but it depends).
Personally I found the biggest challenge is to write a code in docblocks (annotations) like in Doctrine or APIPlatform for example, because screen reader reads an indentation to the first non-space / non-tab character in the line which is asterisk (*) in a case of a docblocks.

Can Windows Theme files (aero.msstyles) be sideloaded with spyware in their resources, specifically in UI scripts

Short version: see topic
Detailed version:
I want to use a specific 3rd party theme for Windows. I'm already using an open source solution which I've compiled myself to disable Window's restriction on Themes.
In the past, when using 3rd party theme related mods that come with DLLs (for example authui.dll for the login ui, or imageres.dll for modding system icons), I avoid using unknown DLLs by simply copying the unknown DLL's theme related resources (such as Bitmaps, Icon groups or UI scripts) unto it's virgin MS Dll counterpart. I call this resource grafting, where resource are changed but the executable elements of DLLs or exes are left alone.
Going back to the theme I want to install, I used sha256 hashing to determine that only aero.msstyles which is also modifiable by resource hacker. So I did the same thing I usually do and transferred resources from the third party theme to Window's own aero.msstyles. Problem is that I ran into a type of resource that I am unable to read or know the contents of. It's called VARIANT. From some experiments done in a VM, it seems to be some kind of binary UI script that resource hacker is unable to decompile. I usually like to be able to read any UI scripts that I transfer but I am unable to do so with this one.
Would this constitute any real security risks? Can UI scripts be side-loaded with some kind of exploit? Seems unlikely to me since the function of a theme file (msstyle) is to coordinate the appearance of the system UI but I don't know enough about the inner working of the whole theming system to be sure. I thought I'd get some other point of views before I take the theme out of the Virtual Machine.
I used vBinDiff to compare the hex code the altered VARIANT/NORMAL binary to that of the original theme. You can also copy the binhexes and save them to two text files which you would compare with WinMerge.
vBinDiff and WinMerge will highlight what modifications and what additions/substractions were made to the binaries, displaying them side by side. I read through the differences, 90% of them were no larger than 4 octals (4bytes), typically what you would expect to see when modding colors using a hex editor. The biggest divergence was an added 32bytes of code.
There are two possible explanations for the such an addition: (1) the author added extra image resources and added the entries necessary to reference them, (2) there is some kind of unwanted code that has been slipped in.
To address the possibility of 2, I did a search to see how small trojan code can get. How likely is it that a trojan has been stuffed into 32bytes if compiled UI scripts? I found a few mentions of an old 17byte virus from the DOS era called trivial which I disegarded right away because it would become apparent very quickly given it's known behavior. As far as full fledged trojans with backdoor and downloading abilities, the smallest I found was 20kb (trojan tinba), discovered in 2012. There is also Catchy32 which is still considered a Trojan but with simpler and very specific functionalities and that one's about 580 bytes (reference). Based on this info, I established that it is highly unlikely (if not impossible) to slip any code in 32bytes of code and established that the resource in question is clean.
Mind you, this doesn't answer the question I asked (can binary UI script resources in a theme carry mal-code) but it does solve my dilemma. Thought I'd share it.

Proofreading Browser Plugin

As part of our site deployment process we typically have proofreaders go through content on site at various stages in the process. For editing that happens before it gets to the site there are plenty of tools for tracking edits, but once the content is up on the site, we do not have a good method for this. I was thinking there might be a plugin or program that would allow our editors to load the site and mark-up the content in page as they would a tracked changes word document.
It seems like the kind of thing that aught to exist, but so far I have not found any god options for Chrome or Firefox. Has anyone made use of a tool like this in the past that they might recommend.

Benefits and concerns with Google Chrome Frame

Is this a technology I should spend much time evaluating?
http://code.google.com/chrome/chromeframe/
Chrome Frame is a plugin for Internet Explorer (IE6-IE8) that gives it, well, what all the other major browsers have.
Biggies for me are the Canvas tag and a fast JavaScript.
As I do a lot of JavaScript dataset visualization, IE6 is a perpetual thorn in my side, and I often have to write extra code for it, and I often have to slow down the frame rate of user-driven real-time visualizations. Using Google Chrome Frame will allow me to produce a much more responsive experience for IE6 users.
But I wonder if IE6 users may be in situations where their computers are under some kind of IT lockdown hell where they aren't even allowed to install a plugin (why else would they be using IE6?)
So I'd still be left with what to do with the last poor souls in IE6.
Still, IE8 lacks Canvas and the JavaScript is slow, so some of my users would see increased performance, maybe even up to Google Chrome and Safari levels.
So again, my real question: Is this a technology I should spend time evaluating?
Note: Google will be throwing up alerts to IE users to encourage them to download Google Chrome Frame for Google Wave. So maybe Google will get enough Google Chrome Frames out there on IE machines that I can just detect it and use it if it's there, and warn the user that experience may suffer without it. I hate to demand anything of my user. http://googlewavedev.blogspot.com/2009/09/google-wave-in-internet-explorer.html
Given the visualizations you're working on, I'd definitely evaluate it. The potential upside for you as a developer and for your users is significant. You do not have to force all Internet Explorer users to use Chrome Frame. You can simply include the meta tag and the users that choose to install the plugin will almost certainly have a better experience.
That said, in my evaluation of Chrome Frame I have encountered some pretty big caveats that might be showstoppers for your project:
Older versions Chrome Frame can't print (see bug list). Depending on what kind of visualizations you're doing, this might be a real deal killer.
Downloads work but appear to the user like nothing has happened (see bug list again).
Chrome Frame is basically the Google Chrome browser shoehorned into the IE browser chrome. As such, any interaction with the browser inside the frame is with Chrome, not IE. If you right click and select Inspect Element you will get the Chrome developer tools window with its Vista-like look and feel. You'll need to make a judgment call as to whether your users will be comfortable with that.
In my testing, it appears like Chrome Frame is only looking at the meta tag:
<meta http-equiv="X-UA-Compatible"
content="chrome=1">
I was unable to get Chrome Frame to activate by setting the X-UA-Compatible HTTP Header as you would with EmulateIE7 mode:
Header set X-UA-Compatible "chrome=1"
It is also worth noting that this meta tag will override EmulateIE7 mode if you have that setting configured and I believe the inverse is also true too. They are both setting X-UA-Compatible. The last tag to set this will take precedence.
One power testing tip that will help save you from having to go in and edit your pages, is that you don't have to do anything to your site to test it with Chrome Frame. Once you have the Chrome Frame plugin installed in IE, simply prepend gcf: to the any URL and it will load it in Chrome Frame (e.g. gcf:http://dshaw.com ).
Happy coding,
- #dshaw
Think you should really spend some time on it since i just tested it and it works very well !
It gives you ie6 with the chromium speed !
And google will surely have enough power to spread it a little. Also you can advice your users to install chrome frame for your application if you really need it.
If you can install flash on ie6, you'll be able to install chrome frame.
Some users that can't install google chrome, will be able to install chrome frame.
I agree with you when you say that you don't like to demand anything of your users. That's generally a good philosophy. I would recommend evaluating how much you need the Canvas and how slow JavaScript really is.
Considering that IE is still the most popular browser (well, the most widely used, anyway), if your web-application is going to be used, you have to take IE into account (as you already are). The real question to ask is, "How much is the user's experience going to suffer if they use IE 'as is'?" If it really will degrade performance, and it will hurt your user base, then, yes, I would check out Google Chrome Frame.
I think it is a good alternative to sites which are considering not maintaining support for IE6.
Recently some big sites stopped working in IE6, they could ask for chrome frame instead of showing you can't access that site in your browser.
Is something good also for improving performance for google chrome frame users.
I'd say no. It is a waste to spend time evaluating it.
Whoever can and want to install extensions to IE6/7/8 can and should install a modern browser (Firefox/Safari/Chrome). The benefit would be both better performance and better support of standards across the board, more than a plugin for IE can provide.