Chrome android html source

How do I view source code in an Android web browser?

You can use Javascript’s alert method to return the source code, type this in the address bar:

initially, I had doubt that javascript: URI scheme would work on Android’s browser, but it seemed to work on my 2.1 browser. However, you don’t get syntax highlighting and you cannot copy the text, so it’s not very usable for long HTML pages.

Doesn’t work for me! The emulator always adds the http:// prefix and I get a site not found by Google.

In Firefox or Chrome on Android it’s possible to view source by prefixing the URL in the address bar with » view-source: «, i.e. » view-source:http://google.com «.

Great solution. It even generates syntax coloring (at least on Chrome) and allows to copy source code to the clipboard.

For Firefox for Android there is an add-on which lets you view source code without prefixing URLs each time, just click the «View Source» entry from the app menu and you’ll see source code for currently open webpage. The add-on is View Source Mobile

This does not work for modified pages, because it gets the source from the server, not the browser. So if you have for example JavaScript that has modified an element, you will not get the updated HTML, but the old/updated HTML from the server.

Look for an app called View Web Source in the market and install it.

Then when browsing, open your menu and tap «share», in the list that pops up choose View Web Source.

Link to app: market.android.com/details?id=com.jamesob.vwsource just tried it out, looks good. No syntax highlighting, but does the job. Puts the source into a normal text box which does mean you can easily copy text out of it.

The app mentioned in this answer hasn’t been updated since 2009.

This has syntax highlighting and is very easy to use. Works with the default Android browser and Chrome. Latest Firefox for Android has it’s own View Source, so it does not need this.

Another tool that is useful for viewing source AND modifying them live, in Firebug/Web Inspector-like manner, is the weinre remote debugger.

Create a new bookmark (bookmarklet) on Mobile Chrome with:

URL: javascript:document.location=’view-source:’+document.location; void(0);

Now when on a page, tap the address field and start typing: vs. The bookmarklet should appear, click it and you are ready.

IN chrome, there is remote debugging facility. If you install Chrone on your phone. If you connect your phone through usb to PC,you can view the Javascript modified source on your PC in a Chrome browser.

If this is for debugging (from your comment it looks like it is) something even better is installing a user agent switcher extension for Firefox or Chrome on your desktop. Change the user agent to Android and you get the mobile version of the site, but with all the source and debugging tools you’re used to.

Читайте также:  Slider with jquery and css

you can capture the source to your shell or to a text file if you’re using an emulator, which is very handy for development. To do this you’ll need to install Android Developer Tools, which comes with adb. Fire up your emulator then from your OS’s shell run the command:

This will output anything from the browser app on your emulator and suppress any other log messages. From there any javascript console.log commands will be captured by adb and output for you to view. So, if you’re using JQuery, you can add this to your page and it’ll output the whole page html to the log:

This will output everything within your html tag on the page to the log.

You can capture the output of your log (using BASH, at least, I can’t speak to other shells) with:

adb logcat browser:V *:S > log.txt 

now, any output from the log gets dumped into your log.txt file. This is really handy for a whole page’s worth of HTML, as you can then search through it as you would any other text doc.

If you want to grab a specific bit of the page rather than the whole thing, you can specify that part of the page rather than the html tag in your JQuery, so if you need to look at a single div that has a class/id associated with it (for this example, it has a class named ‘inspect-me’), you can change your JQuery to:

Источник

Как посмотреть код страницы на телефоне или как обходиться в работе без ПК

Хозяйке на заметку: Если вы работаете на телефоне или планшете и вам нужно посмотреть код страницы или найти что-то в коде HTML, выполните следующие простые действия:

  1. Откройте требуемую страницу в Google Chrome на телефоне или планшете
  2. Допишите в начало адреса страницы “view-source:” и нажмите [Enter] (перейти)
  3. Выберите в меню (три точки справа) пункт “Найти на странице”
  4. Введите нужный текст для поиска

Screenshot_20181111-083339

Телефон вместо компьютера

Вообще на эту заметку меня сподвигла статья в Ферре “Почему смартфон так и не заменил компьютер, хотя нам давно это обещали“, которую я прочитал за утренним кофе. Вообще, я во многом не согласен с Денисом Поповкиным, автором статьи. Наверное, потому, что телефоны УЖЕ заменили компьютеры. И это легко увидеть. Автор подходит со своей колокольни, со своей проблематикой, но мне она кажется довольно однобокой. Если в общем говорить о том, чем является “работа на компьютере”, то можно выделить следующие пункты:

  • Работа на работе (офис, бизнес-задачи)
    • Коммуникации (почта, всякие мессенджеры, Скайпы, совещания и т.п.)
    • Документооборот (документы, таблицы, формы)
    • ERP / CRM (клиенты, задачи, финансы, бизнес-процессы)
    • Специализированный софт (ну тут уже зависит от темы)
    • Коммуникации (почта, мессенджеры)
    • Презентации и демонстрации
    • Документооборот
    • Коммуникации (мессенджеры, Скайпы и т.п.)
    • e-Commerce (шоппинг)
    • Интернет и развлечения
    • Хобби (например, фотография, видео, кодирование и т.п.)
    • Редко, ведение домашнего хозяйства (финансы, планирование и т.п.)

    Так вот, из этих трех групп в одной уже однозначно телефоны заменили ПК — это работа дома. Включать персональный компьютер, чтобы посмотреть рецепт пиццы или погоду на завтра уже никто не будет. Аналогично шоппинг и большей частью хобби давно и успешно решаются на телефоне или планшете.

    Ну а первые два пункта, думаю, всё зависит от направленности бизнес-задач. Конечно же, фотошоп или какой-нибудь CAD на телефоне запустить очень и очень проблематично, если вообще возможно, но все остальные задачи решаются легко, хотя и немного непривычно первое время. Например, я уже не раз и не два отправлялся в командировки на неделю и более вообще без ноутбука, планшет, мышка и хорошая BT-клавиатура (это важно!) вполне заменяют рабочее место.

    20181025_083510-01

    Ведь первоочередная задача в работе — это не специализированный софт, а всё же коммуникации, а они как раз на мобильных устройствах более-менее полно реализованы.

    Всевозможные ERP / CRM — опять же, зависит от реализации. У нас в компании худо-бедно наша система работает с мобильника (хотя клиенты и жалуются, что не очень удобно. Мы это слышим и что-то даже исправляем). Про всякие 1С молчу, это — харам, мы не пользуемся!

    Следующий момент – сами приложения. Казалось бы, да – можно напечатать текст даже на смартфоне. Хорошо, но нам ещё нужно подобрать изображения для статьи, обрезать их под нужное соотношение сторон и ширину пикселей, а потом вставить в админку CMS.

    Ребята, открою вам страшную тайну: у вас CMS — говно! Нормальные CMS давно и успешно решают любые задачи, связанные с публикацией либо полностью автоматически (“обрезать их под нужное соотношение сторон и ширину пикселей”), либо великолепно это делают с любого устройства. Например, эту заметку я пишу хоть и на десктопе (большей частью), но и на телефоне, в том числе:

    Так что, проблема в конкретной CMS, а не в возможности удобной работы. У Ферры самописка из разряда “Самостряп-303”, ну и если разработчики не предусмотрели таких функций — то это проблемы коллектива Ферры.

    Специализированный софт — вот это да. Для меня специализированным софтом является прежде всего IDE для написания софта и работы с сайтами (собственно об этом и заметка), и вот здесь не все так гладко. Нет, сама IDE есть на планшете и мобильнике, но из-за особенностей клавиатуры и мышки Android писать софт не совсем удобно. Хотя допускаю, что я просто не настроил клавиатуру должным образом.

    Ну и наконец, выезды и командировки. Для себя я давно перешел на исключительно на телефон. Таскать с собой ноут (хотя он и легкий у меня — менее 1.5 кг.) или даже планшет с клавиатурой и мышкой не очень хочется. Поэтому я перешел на работу в командировках, курсах и выездах с исключительно телефона.

    Например, вот такой нехитрый набор позволяет легко проводить лекции и презентации. В Московском Политехе я вот так недавно отчитал трехмесячный курс. В набор входят:

    1. Современный смартфон
    2. Доп.аккумулятор с подставой для смартфона
    3. HDMI-донгл Miracast для трансляции презентации и экрана на любой проектор или ТВ-панель
    4. Кликер для презентации с лазерной указкой
    5. Складная клавиатура с тач-панелью
    6. Резервный Powerbank на случай длительных занятий (более 4 часов)

    Все это весит менее 500 гр. и легко помещается в маленькую сумку или барсетку.

    В качестве резюме можно сказать, что ПК, конечно же, полноценно телефон пока не заменяет, но львиную долю задач на смартфоне или планшете вполне можно делать и делать успешно. Важно лишь правильно подобрать софт.

    Источник

    How to view website HTML/CSS source code on Android

    view HTML source code android

    This is one of those things that has always bothered me, but I never got around to doing and that is being able to view the source code of a website on Android.

    For the most part I don’t do any actual coding on my phone, but there are many circumstances where I have to view the source code of a website while on my Android phone.

    As an SEO, being able to view HTML source code on the fly is very important for me. I am always analyzing new websites, doing proposals and helping people with issues. As an SEO there are many times when I can’t get to a desktop and need to view the HTML or CSS source code on my Android phone.

    View HTML source code on Android Without an app

    While there is a way to view the HTML source code of a website on an Android via chrome natively (without a plugin or an app) there really isn’t much flexibility. To do so, all you need to do do is go to Chrome and within the URL / location bar enter:

    view-source:http://www.example.com

    Once you do that Chrome will display the source code right within the browser:

    no app native android view HTML source code howto

    So if you are viewing a website and want to view the source code, just replace the “http” with “view-source” and it’ll pop right up for ya.

    View HTML source code on Android with an app (my preferred method)

    While in general I am not a huge fan of using apps for things a device can do natively, in this case I do prefer using the VT view source app to view HTML or CSS source code on my Android device.

    This is the best app that I’ve found so far, and has done me well over the last few months.

    The app is called VT View Source. The VT I believe stands for Vagharshak Tozalakyan who is the developer of this app.

    I normally keep this app on my secondary home screen, alongside my other apps so I can launch it easily:

    1 view HTML source android desktop

    This is the first screen that you’ll see when you launch the app. Enter a URL and you are good to go:

    2 view website HTML and CSS source code android open URL

    Bam: you can view the source code on an Android phone. It does a great job of showing lien numbers, and highlighting HTML syntax. Links are clickable (if you choose) and will take you to the source code of the link you click, not the actual website.

    3 view source android source code

    There are a number of settings on this app.

    4 view source android menu

    You can easily highlight code and copy / paste it into another program.

    5 view source for websit HTML on android copy selection

    One feature that I like is the ability to validate the HTML via w3.org.

    6 view source HTML and CSS on website android validate

    With one click you can view some cool page info, such as how many lines of code it is and the total number of characters.

    7 view CSS HTML source android basic info

    Landscape view is also quite nice, and in my opinion the preferred way to view the code.

    8 view website source android landscape

    You can bookmark websites, and manage your bookmarks.

    10 view source android bookmark organization

    Another view of the settings. You can change the background color, text color, zooming, font size (%), syntax highlighting and a number of other options.

    11 settings view source android

    In addition to HTML and CSS, this app can also view source code for other languages such as JavaScript. I did not test any other languages:

    Источник

Оцените статью