A technical blog about web and database development discussing the various issues and problems I have experienced and overcome in my 25+ years of coding.
All day I have been experiencing problems with Firefox and Flash.
Flash is notoriously buggy and crashes a lot which is why HTML5 offers so much hope for those of us wanting to watch movies online, on our phones or devices and Youtube style with the VIDEO tag and a wrapper iFrame.
I don't have a fix but I just wanted to put it out there that Flash version 11.3.300.257 is causing constant problems when used with Firefox 13.0.1.
A movie will start playing and then hang or the screen will go black before the "flash crash" message appears.
I am trying to watch some comedy central with another header plugin and up until today I have had no problems at all.
I don't know if this a problem with Flash or Firefox or a combination of both but it is really starting to piss me off. I have re-installed both Firefox and Flash multiple times.
I don't know why Adobe cannot get their act together with Flash as people are working their ass off to accommodate them and their notorious bugs, high CPU and memory leaks on devices whereas before they were just going to ditch Flash altogether and wait for HTML5 to spread.
If anyone else is having the same problem with Flash crashing let me know.
The Strictly iPhone Console - Increasing real debugging without simulators
Yesterday I blogged about debugging on iPhones and how useful the Debugger console was which showed up JavaScript errors and console messages without the need for an agent switcher. However I complained about the lack of ability to view the generated source code on the page when viewing on an iPhone.
However I remembered sometime back I blogged about some bookmarklets I was using that enabled me to view the generated source on older browsers like IE 6 and tonight I knocked together a little script that enables you to have basic "onscreen" debugging functionality when using an iPhone.
The code is some basic JavaScript that adds a DIV area to the bottom of the current page with two links at the top that allow you to view the generated and raw source code for the page. These open up in new windows and if you have problems with them opening you might need to enable the popup window functionality in your iPhone Safari settings first.
Underneath is a basic console which due to the lack of scrollbar functionality on DIVs with overflow:auto or overflow:scroll I have created with a readonly textarea. If you need to scroll down the console you should use the two finger drag option to move the content within the textarea up or down.
I have also overwritten the window.console object so that the console.log function pipes out messages to this console if it's being used.
To Install the Strictly iPhone Console
1. On your iPhone visit this page and copy the JavaScript code from the area below into your clipboard. or vis
2 .Bookmark any page on your phone and then go into your bookmarks and edit it. Change the name to "Strictly Console" before pasting in the copied source code as the URL location for the bookmark.
3. Test that the code is working by going to a webpage on your iPhone and once the page has loaded open your bookmarks and select the "Strictly Console" bookmark. The console should appear at the bottom of the page. At the top of the console will be two links in a grey background "View Source" and "View Generated Source". Underneath will be the console area.
Clicking on either of those links will open up a new page with either the original source code or the generated source code from the current page. If nothing happens when you click the link check your Safari settings so that you allow Pop Ups. When you click the link it will ask you whether you want to open the pop up or not. Choosing Yes will show you the source in a new window.
4. To pipe debug out to the Strictly iPhone console window just use the standard console.log('hello'); function to do so.
As with all code that relies on DOM element make sure you check for the the existence of the console before trying to access it e.g a simple debug function could look like this:
function ShowDebug(m){
if(typeof(window.console)!="undefined")){
console.log(m);
}
}
If you have problems copying and pasting from here (due to the crumy formatting of HTML in blogger) then you can download the compressed script from this location: iphoneconsolebookmark.js
You can try the Strictly iPhone debug console out on this page by clicking the following button which will add a new debug message to the console on each click. The console should already have 15 messages inside it which were added when the page loaded. Remember the console will be at the very bottom of the screen so scroll right down to see it.
Obviously this is a very basic iPhone Console and nothing like Firebug or Chromes inbuilt console but it could be easily expanded with a little work and by loading in the jQuery iphone library you could easily create a popup DOM inspector that was initialised by a long tap down event to show the current elements styling and positioning. Let me know what you think and if you amend it to add more features let me know so I can update the code here.
I have an iPhone 3GS and one thing I have always found annoying is that when I am developing web pages for display on the iPhone you cannot debug them as easily as you can with a PC.
Yes you can get simulators and use user-agent switchers but they are not the same as debugging on the real device.
If I use an agent switcher and change my user-agent to GoogleBot or IE 6 that isn't got to simulate a web page that tests for agents and devices properly or handle libraries that test for unique iPhone / iPad features available on the device and loaded in by specialist external libraries such as the two finger scroll etc.
A proper coder will test for a BOT in ways that don't rely purely on the user-agent including checking for known BOT IP addresses that the they crawl from, a reverse/forward DNS check or tests for JavaScript or Flash use or all 3 and a myriad of other techniques.
On the iPhone you can easily test whether a user-agent switcher is being used by creating a flash movie and then testing if it's been loaded as we all know iPhone doesn't support flash so a user-agent sniff for "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8J2 Safari/6533.18.5" is useless for simulating an iPhone and it's workings properly.
Therefore knowing whether there are JavaScript errors on the page or wishing to output debug messages to the console on an iPhone which you can do easily in all other browsers is a very useful thing to be able to do. I didn't actually find this out until this morning but on the iPhone you can actually do this by going to your settings menu option and enabling it with the following steps.
Go to Settings > Choose the Safari Option > At the bottom of the menu select the Developer option > Enable the "Debug Console" option.
If you then go to any web page you should see at the top of the page will now appear a new panel titled "Debug Console" and if there are no errors on the page it will say "No Errors". If there are errors but no output to the console (e.g with a console.log(msg) function call) then it will list the number of errors and if there are console messages it will tell you the number e.g "7 Logs".
Selecting the console option will show a new screen in which you can view all the console messages. At the bottom of the screen are options to view "All messages", "HTML", "JavaScript" and "CSS". Clicking the relevant tab will show you messages related to those errors.
If there are JavaScript errors it will show you the line number, the error message and a description but unlike a proper browser you cannot click on the error message and view the actual source code.
In fact that is the one bug bear I have about iPhone's Safari browser which is the lack of developer options such as being able to view the source and generated source code as well as controlling options such as white/blacklists for 3rd party cookies, JavaScript and so on. However at least you can view the errors on the device properly if you need to.
I recently created an iPhone friendly webpage so that I could access certain stats from one of my websites on my iPhone .
The page was in a subfolder off the main website which was only half related to the stats I wanted to show. Therefore when I created the icon I wanted to use for the Home Screen I used a LINK element to point to the URI of the image I wanted to use so that the main site could show it's own image if it ever needed to.
So I created an icon and referenced in my page like so many examples on the web tell you to:
However when I tried to add my web page to the Home Screen the icon didn't show and instead iPhone created it's own icon using a screenshot of the page in question.
At first I thought it might just take a little time to kick in but even two months after creation the icon was still the screenshot image and not the icon I had created.
The .PNG file was not corrupt and I tried numerous different locations, images and attribute settings to no avail.
However today I just gave up and placed the image in question into the root of the main site e.g
http://www.somewbesite.com/apple-touch-icon.png
Then low and behold the icon immediately showed up on my Home Screen!
What is the point of the LINK element if you cannot point to locations apart from the root of the site?
Surely Apples own iPhone technology is capable of looking for it's own touch screen image tags?
I'm a systems architect with 30+ years of IT experience, add 10 for Amstrad and Spectrum coding in the 80's. I currently work for myself after working for a number of companies automating everything from whole Business Websites, BOTS, SEO, and Trading Software for Betting Sites. I used to work for one of the UK's leading recruitment software houses, creating 3 versions of their leading Jobboard software. I have also ran a number of my own businesses including multiple horse racing tipster sites, as well as working to develop automated systems that utilize Betfair's API in SOAP then JSON. My history also includes jobs working at OCR specialists, an International Management Consultancy and an OFCOM Director run Telecoms company working on one of the first BIG DATA 118 Directory Enquiry services. I'm an experienced developer with skills including .NET, VB.NET, C#, JavaScript, VB, VBA, VBS, ASP, PHP, HTML5, XHTML, CSS, MS SQL and MySQL. I have developed my own JavaScript frameworks, markup languages, Windows apps / services, my own language SCRAPE plus multiple WordPress plugins. If you want to hire me then please email me using the contact link in the footer.