Chrome developer tools not displaying full html/js file - google-chrome-devtools

I see an error in the console view. I click on the line number, and it opens the HTML file in the sources tab. But that line is not displayed because only the first 11 lines of the HTML file (which is mainly JS) are shown. This is a recurring problem for me. The full file is loaded and successfully parsed and executed by the browser, when I view the file in the browser the full source is there. If I load the page before opening the developer console everything works as expected. What might be happening?
Version 37.0.2062.44 beta-m

Related

How to deeplink a file from macOS app to browser print preview (like sublime text does)?

The functionality I'm after is where Sublime Text opens the browser to the print preview of the file currently edited.
This is the following:
Have a txt file (in sublime).
Select File > Print
Observe that the default browser opens up to the print preview page (tested in firefox and safari)
The urls seem to point to the file being in a temp directory and generated as a html file.
file:///private/var/folders/05/q2p__63n3zx9k3yzcb8f9n0c0000gn/T/tmpbfkdzvmq.html
Note html generation isn't necessary for my use case, remaining as txt is fine.
The answer can be for either swift or objective-c. I'm after how to open the browser to print preview.
I believe the answer involves using Apple Events as mentioned by #Willeke.
These is the information I found that assisted me:
https://applescriptlibrary.files.wordpress.com/2013/11/apple-events-programming-guide.pdf
http://webcache.googleusercontent.com/search?q=cache:B5zOBQgWUoMJ:mirror.informatimago.com/next/developer.apple.com/technotes/tn2002/tn2082.html+&cd=1&hl=en&ct=clnk&gl=ae
https://discussions.apple.com/thread/7743420
In pseudo AppleScript code, it would be something like this:
tell default browser
launch
print document
endtell

Visual Studio Code - Live Server - Html Displays but no CSS markup

I have used VSC with LiveServer for some years with only 1 problem, back a few years ago when either LiveServer or Windows10 had an update installed, next time I opened my HTML file in LiveServer, the HTML was rendered in a "basic" layout, and did not include my CSS Styles.
On an Internet search I found a solution for either this site or similar where I needed to add a line of code to either LS or Windows, sorry but I cant remember which. And all was well again until, now. The very same problem has returned, and no matter how much I search, I cant fine the solution.
There are plenty where there were errors in HTML or CSS, but this is occurring on files which haven't changed, and on new ones from the same master I use for my new pages. The screenshot included shows the HTML, LS as basic HTML and how the page loads on the browser directly. I am using Chrome, but have tried on Firefox with same results.
How LS displays and how it should be
You need to open your VS Code project from a directory that contains your HTML and CSS.
Your HTML document is in the root directory of your project (hence the URL being /filename) but you are trying to load CSS from ../../css/filename.
The project needs to be two directories higher for the webserver to include that path.

Visual Studio Code link to local HTML file

I have a LSP server that returns hovers/tooltips containing links.
If I link to an HTML file on the web (https://...) when you click it it opens that link in the browser.
If I link to a local HTML file (file://...) it opens that HTML file in VSCode, as if you wanted to edit the file.
Is there any way to make it open the local HTML file in your browser?
Edit 1: I found the code that handles this. Seems it just checks for http, https or mailto and opens those externally. Everything else it opens with VSCode.
Edit 2: Found an identical issue. Looks like there is code to work around this here and here

Prevent Chrome from closing tab that downloads CSV

I want to find out the URL to a specific CSV file on a web page. The page is built using some arcane system called QLIK, and for some reason, the CSV path does not show up in my networks panels in Chrome when hitting the download button.
When I download the CSV, a new tab is opened. I want to keep that tab open and inspect the developer tools. But Chrome immediately closes it. How do I prevent Chrome from closing the tab?
Chrome doesn't pipe network information on downloads to the network panel. They go through a different pathway then page-pound network operations. You can't inspect binary downloads.

Web App Manifest not parsed by Chrome Dev Tools

I have a manifest.json according to the MDN spec and while it works correctly when browsing the website from a mobile device (add to homescreen popup shows up, theme color and icons load...etc) Chrome Dev Tools is unable to parse it. The same problem persists on Lighthouse (chrome extension).
Has anyone seen a similar issue? I would think that the JSON is invalid however copy-pasting into Web App Validator it is marked correct, but when inputting the URL it giving a parse error:
File isn't valid JSON: SyntaxError: Unexpected token in JSON at position 0
It is probably a BOM character issue in the manifest.json file.
If you have Notepad++ on your machine, try open the file, click menu "Encoding" -> "Encode in UTF8 without BOM" and then save the file.
If you don't have Notepad++, search Google for "Remove BOM character" for your favorite IDE/editor.