Viewing and Exporting Source in Opera Mini

Opera Mini is one of our products available for mobile phones and tablets. It's available for iOS, Android and Symbian platforms, a range of J2ME feature phones, and other devices.

Opera Mini is a proxy browser, which means that the parsing of web pages occurs on Opera's servers, rather than the device. Opera Mini merely forwards the user's request to Opera's proxy servers and displays the OBML image that those servers send back to the user's handset or tablet.

Each request for a URL requires a request to the proxy server. That much is obvious. What's less obvious, though, is this: any interaction that changes the DOM tree also generates a request to the proxy server. Opera Mini's servers also impose execution time limits on JavaScript. As a result, some DOM changes may not complete before the server sends the result to the user.

Thankfully, Opera Mini offers the ability to inspect the current DOM tree as rendered by Opera's proxy servers. Enter server:source in the Opera Mini address bar to view the source of the currently loaded page.

Viewing the source on a device, of course, is far from ideal. That's why Opera Mini also makes it possible to export the current DOM tree's source. To do this, append a post variable containing the URL of the script: server:source?post=http://url/to/your/script.

Opera Mini will send a POST request to that URL containing three fields: url, host, and html. Your script can save the code to a database, save it as a file, or e-mail it.

To get you started, you can use this Opera Mini Export Source script. You will need a server with PHP 5.2+ and an Amazon S3 account. The script will capture the source output and save it as an object to the S3 bucket you provide.