MacOS usage tips 19: Safari bunker function 2 view webpage source code, ossafari

Source: Internet
Author: User

MacOS usage tips 19: Safari bunker function 2 view webpage source code, ossafari


In my junior year, I chose search technology and learned some information about search engines and web crawlers on the Internet. Later, we made a bit of water, this means that only the scores and downloads of dozens of software from several large download websites are obtained. when you enter a program name, we will sort the recommendations based on the downloads and scores. Cough. At that time, we needed Firefox in windows to view the source code of the Web page. This powerful Safari can also do, and even Safari provided a stronger function to view the source code, but it was hidden.
Next I will introduce the hidden feature of Safari: view the web page source code.
Go to Safari, choose menu> preference settings, or click "command" + comma to enter. On this page, open the Advanced tab and select the "show" development "menu in the menu bar at the bottom"

Next, go to the extra development menu and click here to display the page source file. Then we can see the source code of the webpage.

After selecting the displayed source file, we can see the messy source code.


Do you think Safari is exceptionally powerful. Make good use of it.

2014.10.1 0: 45 By Mr. Losers


How does safari view source code?

The IOS system mainly uses Apple's Safari browser to surf the Internet and view webpages.
However, unlike IE, Safari does not support viewing source code.

Here we recommend a method to view the html source code:

1. Save a bookmark for the webpage that needs to view the source code;

2. Edit the bookmarks and change the URL to the following code:
Javascript :( function () {var a = window. open ('about: blank'mirror.doc ument;. write ('');. close (); var specify umentElement. innerHTML)}) (); 3. close the edit bookmarks. Click the bookmarks from the bookmarks menu in Safari. The source code is displayed.


[Tips] How to "view source code" in iOS Safari"

The following is how to set up: save this page (or any page) as a bookmarkdonator in Safari on iPad, iPhone, or iPod touch, and name it "View Source Code". Click here to view the JavaScript code of the bookmarks, select all-copy and click the bookmarks icon in Safari, and click "edit ", click the bookmarks saved in step 1 and paste the JavaScript code copied in step 2 to the URL address bar. Click "finish" to save the changes. Now, when you want to view the source code of a webpage, open the bookmarks menu and click "view source code" to view the source code after syntax highlighting and link clickable processing. It should be noted that the JavaScript here will send the current page to Michelin. if you are not at ease with this, you can consider other viewing methods. dk syntax highlighting is really great.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.