Show non-ascii characters in chrome console (without percent signs) - google-chrome

Is there a way to show non-ascii characters in Chrome console to be showed properly, i.e. without percent signs?
For example, I'm testing some local webpage. It have connection to three different javascript files. One of this files is located at D:\[some non-ascii-characters].
And so, for example if this file is missing, I will see in Chrome console something like:
GET file:///D:/2%20---%20%D1[here will be more percent-encoded characters] net::ERR_FILE_NOT_FOUND
So, I want to show the actual clean easy to read path, without percent-encoded %20 %D1 and so on.
Is there a way to fix it?

There isn't an option to convert and there probably won't be one. Since this is the actual URL requested by the network it is what is put into the console. Doing any conversion on this can be misleading as to what is actually being requested.

Related

How to ignore requests

I started using debugger for PHP recently and it's working well, but I have one problem. When I open page from Chrome I get notification from PHP Storm "Incomming connection from XDebug"...and I can accept or ignore it, which is ok. Then I can debug. And that's connection for the first page, i.e. index.php
Problem is that on page I'm opening I'm displaying i.e. some images and I'm including some CSS or JS file. For all those files Chrome is making additional requests and for all of them I'm getting also that message "Incomming connection from XDebug". So for every valid request I have to click Ignore about 20 times more...to ignore every other file after first one, containing page source.
I tried adding path to dirs I want to ignore in "Skipped paths" under Languages & Frameworks -> PHP -> Debug, but it's not working.
Can it be set somehow? Maybe some obvious ignores - I can't debug i.e. image files.

Base 64 PDF blocked - reason reflected-xss block?

I'm trying to show a base64 pdf that I get through a GET request but for some reason it gets blocked in Chrome for the following reason or at least I think it gets blocked because of this since I see an error in the console stating the following:
Unrecognized Content-Security-Policy directive 'reflected-xss'.
When I check my logs, I see that the pdf is correctly formatted in base64 because decrypting it results in the PDF, but Chrome just doesn't want to open it
In the response header I do see the following:
Content-Security-Policy:reflected-xss block
Content-Type:application/pdf
however, I'm not too familiar with this so any idea how I go about this to make this work? Or can anyone at least tell me why I'm getting that?
I do notice that when I try another pdf it works but that the response header for the one that works has Connection:keep-alive?
Entering my own answer to this question so that it has an official one (after all this time):
As per my comment, the root cause was the way I created the header to send the pdf to the front end was badly formed. It got blocked by my company's F5 firewall.

How to insert the percentage sign into a local URL

Good day
I wanted to have a general URL to access the Desktop of the local machine for every local user, but when I put this link into the shared HTML page:
href="file://%userprofile%\Desktop"
the URL that appears on the browser is:
file://%25userprofile%25\Desktop
How to remove that '25' so every local user can access his/her Desktop?
Thank you very much
% is a special character on the URL - it is used to encode special characters, giving their HEX ASCII value as result.
Hence, in order to pass a % on the URL, you need to encode it - this results in %25 - the browser is doing the right think and you don't need to do anything.
I am not sure the browser can interpret local environment variables, by the way - it may also not have direct access to the user desktop.
Use %25 without space. it will show the percent symbol in the url.

How do I "UTF-8 encode" my JavaScript files so that Google Chrome can use them in an extension?

I am writing a fairly simple extension for Chrome. The main graphical body of it (the part dealing with html, i.e. the front-end) works fine, but when I try to include a second JavaScript file that uses Jquery's $.ajax() function to return some info from another page to the front-end, Chrome throws the following error and won't let me load the extension:
Could not load extension from "Path\to\extension". Could not load file "filename.js" for content script. It isn't UTF-8 encoded.
I don't honestly know enough about UTF-8 encoding to be able to tell what would make Chrome say that about my file. I have no special characters, no accent marks or anything, which i know can screw things up. I haven't been able to find a good solution anywhere, either.
An easy way to UTF-8 encode your files, is to use an editor that allows you to choose that encoding. If you can't do that, there are (fairly standard) tools on linux/unix system to check (file) and to change (iconv, recode) the encoding. If you use Windows, such tools can be installed.
I ran into this issue even though the file was saved a UTF-8. However the code contained a U+FFFF character, which is invalid by definition. It's the same for U+FFFE.
The solution was to use "\uffff" instead of using the character directly.

Opening a folder through FireFox with HTML

I recently built a HTML and Javascript web application that opens specific folders throughout a network of accessible drives. This app works well when it is rendered in IE; however, the folder paths do not work in FireFox.
The following is an example of the path format that I am using to open the folders in IE:
{
window.open('\\\\Server-1\\Folder-1\\Folder-2');
}
The path actually has 4 backward slashes at the beginning and 2 bakcward slashes between each folder. It appears different when rendered.
When I run this app in FireFox, the window or new tab appears, but there is nothing rendered. I've manually entered the path and FireFox converts it to: file://///Server-1/Folder-1/Folder-2. Does anyone know what the correct syntax would be (i.e. window.open(?...))?
Here is something that might help you. It is considered a security risk by Mozilla.
http://kb.mozillazine.org/Links_to_local_pages_do_not_work
according to Daniel's link you need THREE forward slashes not FOUR for local paths...
Path Syntax
You also need to use proper URI syntax
for local file references. It is not
proper to enter an
operating-system-specific path, such
as c:\subdir\file.ext without
converting it to a URI, which in this
case would be
file:///c:/subdir/file.ext. In
general, a file path is converted to a
URI by adding the scheme identifier
file:, then three forward slashes
(representing an empty authority or
host segment), then the path with all
backslashes converted to forward
slashes.