Bookmark and Share
Showing posts with label Chrome. Show all posts
Showing posts with label Chrome. Show all posts

Tuesday, January 02, 2018

Chrome dev tools : how to filter css styles by file name

Sometimes you need to analyze the css styles coming from a specific file, and the chrome developer tools shows all the style from all the linked css files.

Here is an example from NYT website:

image

If you need to focus only on a specific CSS file type the name on the filter box in the right upper corner, i.e. “_story.scss” :

image

Now you can browse other pages in the same website and you will see only the styles coming from the _story.scss file.

It works also if you have multiple css files with the same name but with different query strings:

style.css?ver=1.0.1
style.css?ver=2.0.0

Write in the filter box “ver=2.0.0” and you will see only the styles from the 2.0.0 version.

You can also edit and save the css file using this guide.

Hope this helps!

Thursday, March 06, 2014

How to investigate IOS Safari crashes using Chrome

I’ve worked some days on a web app application, completely written using  jQuery, jQuery Mobile and Kendo UI Library.

The application worked successfully on the Android devices but, on Iphone/Ipad crashed unexpectedly.

I’ve tried to investigate the crash logs on the device, with no fortune.

I’ve also connected the device to a mac and tried to debug the web application using the Web Inspector, following these steps http://moduscreate.com/enable-remote-web-inspector-in-ios-6/ , but , when Safari on IOS crashed, the Remote Web Inspector on my Mac was closed too, with no possibility to find what was the latest javascript instruction.

I’ve discovered on the web a great project that enables Chrome debug on Safari for IOS, here is the link:

https://github.com/google/ios-webkit-debug-proxy

You need to install :

After the proxy installation you need to execute it on your mac using :

ios_webkit_debug_proxy





Schermata 2014-03-05 alle 10.12.14



Start the IOS simulator using XCode:



Schermata 2014-03-05 alle 10.22.45



Connect chrome on your Mac to the address…  http://localhost:9221



Schermata 2014-03-05 alle 10.13.15



Choose the device:



Schermata 2014-03-05 alle 10.13.33



Here we are: Chrome web tools debugging Safari!



Schermata 2014-03-05 alle 10.15.17



Network Panel:



Schermata 2014-03-05 alle 10.15.49



Console window:



Schermata 2014-03-05 alle 10.20.57



If Safari crashes… you will be able to see the console message in the web tools window.. this should save a lot of time when you try to find the crash point.



Some tips:




  • don’t use web apps inside iframes : Safari on IOS in really unstable


  • if you need to use jQuery ready event…. wrap the code inside a function and add a timer and call it after 100-200 ms


  • sometimes working on css style overflox-x overflow-y seems to crash Safari


  • read the Apple guidelines for web apps:



Hope it helps!



Matteo

Wednesday, January 23, 2013

How to enable Workspace Experiment on Chrome Canary

Today Addy Osmani has announced a new great feature in google Chrome Canary : the Developer Tools Workspaces.

Workspaces allow you to select custom directories in your file system which are always available for you to edit within the Sources panel.

Here are the instructions on how to enable it:

  1. Download Chrome Canary https://www.google.com/intl/it/chrome/browser/canary.html
  2. Type chrome://flags/ in the url :
    image
  3. Enable the “Developer Tools Experiments”
    image
  4. Close and re-execute chrome canary
  5. Open Developer Tools (F12) or type CTRL + SHIFT + I
  6. Click on the little settings icon in the bottom right corner of the dev tools:
    image
  7. Click on “Experiments” –> “File system folders in source panel”
    image
  8. Close Dev Tools and reopen it
  9. Click on the settings icon (like point 6)
  10. You will see a new tab on the settings column:
    image
  11. UPDATE: you need to add a special empty file to the folders that you want to add in the workspace: open a command prompt , change the directory and type :

    echo  > .allow-devtools-edit

    image

    image

    You need to use command prompt because file explorer raises an error when you try to create a file starting with a “.” (dot)
  12. After this operation the “Add file system” link will work and you will see on the left panel in the dev tools the list of your local files:
    image
  13. Type CTRL + S  if you change the file and you need to save it

 

Hope it helps! Good Experiments!

Wednesday, July 11, 2012

Chrome Developer Tools Autocomplete

If you are using Chrome Developer Tools and you don’t remember a specific CSS value you can ….

Click on the css property and type CTRL + SPACE, the complete list of the accepted values will appear.

image

image

 

Hope it helps!!!

Tuesday, July 10, 2012

Change CSS and SAVE on local file system using Chrome Developer Tools

I’m using chrome for development and I’ve discovered this cool features.
Using the Chrome Developer Tools you can inspect css properties and change on the fly the values.
Try it on CSS garden, download this two files:  html file and css file, and play with them.
Original page:
image
Inspect some elements and change the css properties:
from:
image
To:
image
Here are the changes:
image
Like it? Click on the css name on the right
image
Chrome will go to the Resources Pages…
image
Right Click and… choose SAVE, the first time it will ask you the position of the local CSS file…
image
Next time the SAVE option will save the file silently without popups.
This trick is useful if you use external css files, it doesn’t work on server pages with hard coded css.

UPDATE:
Here is the link to the Google IO 2011 presentation of this functionality: http://youtu.be/N8SS-rUEZPg, the first section of the video shows the CSS edit improvements in Chrome developer tools.