StatCounter

Tuesday, June 3, 2014

How To Hack Computer Applications

Hi! It's been a long time since I've been making a post.

For this post, we will hack Safari's "Failed to open Page". I chose this because I thought the error messages were dull in color. To solve this, I tapped into Safari's internal CSS code and edited it.

We will start with the dull page:


This page is boring, as there's only white,grey,and black.

To edit the code, you will have to use Terminal. You need this to sudo into the safari application. (sudo means super-user, you must do this to tap into the system generated files)

Now double-click Terminal, and cd into the folder the document is located. 
(this command shows the computer to locate where you are)

Type in prompt: cd /Applications/Safari.app/Contents/Resources/

This will direct you to the main folder in the app. 
(Fun Fact: Apps have sub folders in them, it's not just a piece of code!)

Next, you will access the code called page-load-errors.css , as superuser(sudo), as mentioned before. I will use nano, a text editor that it is connected to Terminal.
(there are also other text editors in terminal, such as vim, emacs, you may also use these if you like)

Type in: sudo nano page-load-errors.css

This may probably ask for a user password, so you type in your login password. Then, you come to the editor. Here's the fun! 
(note each section of the code describes one particular object, such as the compass logo)

These are the highlights to the code editing:
  1.  scroll of find ".error-title.error-text" , and edit the rgba() part. (make sure to edit both error-title error-text!) The rgba() will have four parameters of color: red,green,blue,transparency. This code will fill a object a particular color. Change the first rgba() on the next line to rgba(255,0,0,0.9) and the second rgba() to rgba(0,255,0,0.9) and notice how the error text transitions from red to green.                                       
  2. Find ".suggestion-prompt.error-text, .error-message.error-text", and edit the rgba() on the next line to rgba(255,0,255,0.9). This turns the bottom "safari cant open..." into violet font.
  3. Find ".error-title" and on the next line, change the "font-size" number. This will expand or decrease the font. I chose 24px, so the font slightly increased.
This is the result form all changes:




















No comments:

Post a Comment