{"id":708,"date":"2012-01-19T11:35:42","date_gmt":"2012-01-19T21:35:42","guid":{"rendered":"http:\/\/mymonkeydo.com\/?p=708"},"modified":"2020-05-03T16:30:16","modified_gmt":"2020-05-04T02:30:16","slug":"debugging-websites-for-iphone","status":"publish","type":"post","link":"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/","title":{"rendered":"Debugging Websites for iPhone"},"content":{"rendered":"

Problem<\/h2>\n

I created a website that looked great in IE7+, FF, Chrome, and Safari, but on the iPhone a few things looked off. \u00a0Problems could be from the viewport being 480px wide but the website is 1000px wide so using percentages can mess it up… that’s another post sorry. \u00a0The problem is, how do I use something like firebug to debug the css and html in the iPhone mobile Safari browser?<\/p>\n

 <\/p>\n

Solution<\/h2>\n

<\/strong>
\nThe best solution is if you have a Mac OS X and the iOS 5 SDK. \u00a0If you don’t have a Mac or \u00a0you don’t have iOS5 SDK and don’t want to download it from the Mac App Store, move on to the next solution. \u00a0This solution involves a great FREE tool to debug, profile, and inspect \u00a0web applications running in the iPhone simulator is iWebInspector <\/a>by Max Firtman. \u00a0 This tool, as it says in the tool, enables a private API available on the iOS 5 framework. \u00a0It lets you inspect the web page or webapp \u00a0similar to firefox. \u00a0To use it:<\/p>\n

    \n
  1. Download, install, and open \u00a0iWebInspector<\/li>\n
  2. Click on the “Open iOS Simulator” button<\/li>\n
  3. In the Simulator, open Safari and go to the URL you wish to debug.<\/li>\n
  4. In iWebInspector click on the “Load from Safari” button.<\/li>\n
  5. Click on the link it displays<\/li>\n
  6. Now you should see the DOM and all it’s CSS attributes.<\/li>\n<\/ol>\n

    One thing annoying is that you can’t add CSS attributes to existing CSS classes. \u00a0A way around this is to add attributes to the element.style section for the element you want to alter. \u00a0Another thing I noticed is that the Simulator freezes from time to time. \u00a0To “unfreeze” it I had to quit both the simulator and iWebInspector and start over. \u00a0Other that it’s great!<\/p>\n

     <\/p>\n

    \"\"
    \nA second option to debug a website in the iPhone is by using
    Firebug Lite<\/a>. \u00a0Here’s what you do:<\/p>\n

      \n
    1. Open this page in your iPhone browser and bookmark it.<\/li>\n
    2. Rename the bookmark to “Firebug”.<\/li>\n
    3. Tap the code below twice and choose “Select All” and then “Copy”.\n
      javascript:(function(F,i,r,e,b,u,g,L,I,T,E){if(F.getElementById(b))return;E=F[i+'NS']&&F.documentElement.namespaceURI;E=E?F[i+'NS'](E,'script'):F[i]('script');E[r]('id',b);E[r]('src',I+g+T);E[r](b,u);(F[e]('head')[0]||F[e]('body')[0]).appendChild(E);E=new%20Image;E[r]('src',I+L);})(document,'createElement','setAttribute','getElementsByTagName','FirebugLite','4','firebug-lite.js','releases\/lite\/latest\/skin\/xp\/sprite.png','https:\/\/getfirebug.com\/','#startOpened');<\/pre>\n<\/li>\n
    4. Edit the Firebug bookmark. \u00a0Remove the URL and paste the copied code into the bookmark.<\/li>\n
    5. Save it.<\/li>\n
    6. Go to the page you want to debug<\/li>\n
    7. Once the page loads, select the bookmark named “Firebug” and it will run firebug on the page.<\/li>\n<\/ol>\n

      I prefer the first solution over this one because obviously, Firebug is very small on the iPhone.<\/p>\n

       <\/p>\n

      keywords:\u00a0iphone safari on desktop, iphone firebug
      \nsources:
      \n
      http:\/\/www.iwebinspector.com\/<\/a>
      \n
      http:\/\/martinkool.com\/post\/13629963755\/firebug-on-ipad-and-iphone<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[2],"tags":[17,21,38],"yoast_head":"\nDebugging Websites for iPhone - My Monkey Do<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Debugging Websites for iPhone - My Monkey Do\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/\" \/>\n<meta property=\"og:site_name\" content=\"My Monkey Do\" \/>\n<meta property=\"article:published_time\" content=\"2012-01-19T21:35:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-05-04T02:30:16+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/getfirebug.com\/wiki\/images\/5\/56\/Flaming-firebug-logo-with-text.png\" \/>\n<meta name=\"author\" content=\"Webhead\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Webhead\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/\",\"url\":\"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/\",\"name\":\"Debugging Websites for iPhone - My Monkey Do\",\"isPartOf\":{\"@id\":\"https:\/\/mymonkeydo.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/getfirebug.com\/wiki\/images\/5\/56\/Flaming-firebug-logo-with-text.png\",\"datePublished\":\"2012-01-19T21:35:42+00:00\",\"dateModified\":\"2020-05-04T02:30:16+00:00\",\"author\":{\"@id\":\"https:\/\/mymonkeydo.com\/#\/schema\/person\/b16fc650a8c182faaac896bab099b829\"},\"breadcrumb\":{\"@id\":\"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/#primaryimage\",\"url\":\"http:\/\/getfirebug.com\/wiki\/images\/5\/56\/Flaming-firebug-logo-with-text.png\",\"contentUrl\":\"http:\/\/getfirebug.com\/wiki\/images\/5\/56\/Flaming-firebug-logo-with-text.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/mymonkeydo.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Debugging Websites for iPhone\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/mymonkeydo.com\/#website\",\"url\":\"https:\/\/mymonkeydo.com\/\",\"name\":\"My Monkey Do\",\"description\":\"A Log of Coding Solutions\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/mymonkeydo.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/mymonkeydo.com\/#\/schema\/person\/b16fc650a8c182faaac896bab099b829\",\"name\":\"Webhead\",\"url\":\"https:\/\/mymonkeydo.com\/author\/corey\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Debugging Websites for iPhone - My Monkey Do","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/","og_locale":"en_US","og_type":"article","og_title":"Debugging Websites for iPhone - My Monkey Do","og_url":"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/","og_site_name":"My Monkey Do","article_published_time":"2012-01-19T21:35:42+00:00","article_modified_time":"2020-05-04T02:30:16+00:00","og_image":[{"url":"http:\/\/getfirebug.com\/wiki\/images\/5\/56\/Flaming-firebug-logo-with-text.png"}],"author":"Webhead","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Webhead","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/","url":"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/","name":"Debugging Websites for iPhone - My Monkey Do","isPartOf":{"@id":"https:\/\/mymonkeydo.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/#primaryimage"},"image":{"@id":"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/#primaryimage"},"thumbnailUrl":"http:\/\/getfirebug.com\/wiki\/images\/5\/56\/Flaming-firebug-logo-with-text.png","datePublished":"2012-01-19T21:35:42+00:00","dateModified":"2020-05-04T02:30:16+00:00","author":{"@id":"https:\/\/mymonkeydo.com\/#\/schema\/person\/b16fc650a8c182faaac896bab099b829"},"breadcrumb":{"@id":"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/#primaryimage","url":"http:\/\/getfirebug.com\/wiki\/images\/5\/56\/Flaming-firebug-logo-with-text.png","contentUrl":"http:\/\/getfirebug.com\/wiki\/images\/5\/56\/Flaming-firebug-logo-with-text.png"},{"@type":"BreadcrumbList","@id":"https:\/\/mymonkeydo.com\/debugging-websites-for-iphone\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mymonkeydo.com\/"},{"@type":"ListItem","position":2,"name":"Debugging Websites for iPhone"}]},{"@type":"WebSite","@id":"https:\/\/mymonkeydo.com\/#website","url":"https:\/\/mymonkeydo.com\/","name":"My Monkey Do","description":"A Log of Coding Solutions","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mymonkeydo.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/mymonkeydo.com\/#\/schema\/person\/b16fc650a8c182faaac896bab099b829","name":"Webhead","url":"https:\/\/mymonkeydo.com\/author\/corey\/"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/mymonkeydo.com\/wp-json\/wp\/v2\/posts\/708"}],"collection":[{"href":"https:\/\/mymonkeydo.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mymonkeydo.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mymonkeydo.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mymonkeydo.com\/wp-json\/wp\/v2\/comments?post=708"}],"version-history":[{"count":0,"href":"https:\/\/mymonkeydo.com\/wp-json\/wp\/v2\/posts\/708\/revisions"}],"wp:attachment":[{"href":"https:\/\/mymonkeydo.com\/wp-json\/wp\/v2\/media?parent=708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mymonkeydo.com\/wp-json\/wp\/v2\/categories?post=708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mymonkeydo.com\/wp-json\/wp\/v2\/tags?post=708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}