dev tools console: don't show path in the links of console messages? - hyperlink

Is it possible to make chrome dev tool's console shorten the source code link by only showing the base file name and line number without the whole path?
--BobG

Related

Can lighthouse-ci output the line of code that has error?

Currently using lighthouse-ci for CI pipeline. Whenever I run lighthouse-ci, the terminal output shows the failings of the website, but does not show which exact line of code is erroneous. The chrome extension however, does show the line of code that is erroneous. Is it possible to configure lighthouse-ci such that they show in the terminal output?

How to configure better errors rails for firefox

how to configure better errors for ROR on linux with firefox. Better errors gem is useful to open rails application error file with line number from browser only, so it will be less time consuming for developer to correct the error and no need to search file and line separately
First of all download and install sublime url handler patch to handle the url with line number. Download sublime-url-handler.
Goto to development.rb file and add BetterErrors.editor = :sublime
Goto firefox and type about:config in url and hit enter
Right click and create new property with boolean type with name " network.protocol-handler.expose.subl" set "False".
Restart firefox.
Run your rails app and get the error link page, click on error link it will ask open open with if sublime-url-hanlder is shown here well done choose and cheers if not shown than give your sublime executable path here and done.
Remember give sublime executable path only not /usr/bin/subl, or shared lib path. You can find the executable path by running subl and see the process details like "ps -eaf | grep subl" copy the path and give this path in firefox choose application.

Applescript: print first or other specific pages

How can you instruct an application or the printer to only print the first page, a page range or just odd or even pages of a file? I attempt this with the help of the Preview app, which looks promising:
set theFile to "[file-path/file]""
tell application "Preview"
activate
print theFile with properties {target printer:"Printer", ending page:1} without «class pdlg»
--these properties isn't available for the printer app, here just limiting amount of printed pages
quit
end tell
But with this I'm bitten by the sandboxd process that tells me the file can't be opened for printing and I get a deny file-read-data result in the log.
In the CUPS suggestion by adamh I encounter issues with umlauts and have other execution issues as well, possibly also because of sandbox rules. The code works from the command line, but not when called in automated fashion.
I tried to look up useful examples of the print command in a reference, in my books and tried searching the online Apple references, but I can't seem to find many examples fitting to the present day situation with sandbox, if any.
You could script printing by command line tool lp & lpr.
These talk to CUPS, Common Unix Printing System
To target pages / ranges:
lp -o page-ranges=2-4 "my_great_document.pdf"
To call it from applescript use do shell script
e.g,
do shell script "lp -o page-ranges=2-4 'my_great_document.pdf'"
For more ideas see: http://www.cups.org/documentation.php/options.html

Why running the generated Angular index.html without Grunt shows an empty page?

I generated an Angular app and when I run grunt server it works (it shows the default page) but when I browse the files and double click index.html I get an empty page (except for the grey background).
Why is that? Isn't it just JS/CSS/HTML?
Depending on your setup some files usually need conversion- for instance your styles may well be in compass or SASS and need to be converted to regular css. Grunt handles all the various conversions you need (as well as launching the static page server).
Check out your console error log in the browser and I'll bet you'll see some "Failed to load resource" errors- for instance the css file may well not be there (when you're trying to run index.html directly).
By the way, you can run:
grunt build
This will create a new directory "dist" with everything converted and ready for distribution- sounds like this might be what you're looking for.

How to log from Javascript Module in Firefox extension

I'm modifying a Firefox extension that has been written by someone else, and I'm not very experienced with Javascript and Firefox, so my question is probably fairly simple.
I have a lot of code in a Javascript Module (.jsm file), and I want to produce some outputs form this module to help with debugging. I can't seem to use javascript alerts (alert("blah");) or log to the javascript console (console.log("blah");) as both of these give errors saying that console or alert cannot be found.
Is there any way to produce this sort of debugging output from code running in a Javascript Module? All I want is simple text output to help with my development/debugging process.
There are two common options:
Use dump(), the output will be printed to OS console (on Windows you need to run Firefox with -console command line option to see it).
Use Component.utils.reportError, the output will be printed to Error Console - use Ctrl-Shift-J to open it.

Resources