Log in

View Full Version : (MY) MAJOR BREAKTHROUGH: now, you can use Opera Mini as the system-level Web browser!


Menneisyys
11-27-2007, 04:58 PM
You, hopefully, already know Opera Mini 4 (http://www.pocketpcmag.com/blogs/index.php?blog=3&p=2302&more=1&c=1&tb=1&pb=1), which, currently, I recommend the most for all Windows Mobile users as the primary browser. It’s especially useful if you are on either a slow (say, GPRS) or expensive (non-flat rate) data plan and/or you also use Opera on the desktop and, therefore, can make use of the excellent, remote (!) favorite synchronization offered by Opera Link.

So far, it was impossible to quickly invoke Opera Mini from any mailer applications by just clicking / activating Web links in them. This was a major stumbling block for many, which is quite understandable. Yes, it’s a major pain in the back to having to rely on Internet Explorer (Opera Mobile, Netfront etc.) for displaying the given Web page - instead of the much faster / cheaper / prettier Opera Mini.

Of course, Pocket PC (using the new terminology, Windows Mobile 6 Professional / Classic) users have always had an escape route. They still could highlight the link and, then, copy it to the clipboard. After that, they could still invoke Opera Mini, go to Menu / Enter Address and paste the URL there. (Assuming, of course, they use a copy/paste-capable MIDlet Manager. The outdated and, unless you have specific needs or an old operating system, in no way recommended TAO isn’t one of them; the recommended Jbed is.) An example of highlighting a link and copying to the clipboard is depicted in the following screenshot:

http://www.winmobiletech.com/112007OM4Final/HighlightURLandCopy.png

This, however, resulted in multiple screen taps and has never been so simple as just clicking a link in the mail body and let the system invoke the browser and pass the link to it.

And, of course, the above-explained way of copying URL’s to Opera Mini doesn’t work with touchscreen-less MS Smartphone (in the new terminology, Windows Mobile 6 Standard) models. Not even with external Copy/Paste tools like VITO’s excellent, free CopyPaste.

Because of the acuteness of the problem, I’ve thought very hard on solving the problem and making Opera Mini (OM for short) a browser that doesn’t suffer from this problem. And, during a lengthy swimming & sauna session, it occurred to me how it can be solved. Yeah, it’s mostly during swimming that I get the best, most revolutionary ideas :)

First, the pros and the cons so that you can see what you can expect of my solution.

Pros

Fully Seamless integration into Messaging (or any other mailer app), Notes, Word Mobile, PDF readers, MobiPocket (or any other text processing / viewing app) etc under ALL Windows Mobile / Pocket PC operating systems before Windows Mobile 6, on both the Pocket PC and Smartphone platforms
While it’s not compatible with WM6 Smartphones (WM6 Standard devices), on WM6 Pocket PC’s, you can still pretty easily invoke OM and pass the given URL to it.
It’s free and pretty easy to set up



Cons


It isn’t compatible with WM6 Smartphones like the HTC Vox (s710) or the HTC Wings (s730). Sorry.
With WM6 Pocket PC’s (unlike previous OS version), some additional manual work is needed, compared to the pre-WM6 cases. That is, just clicking the link won’t suffice.
It will NOT work on local HTM(L) files on your device – that is, not external links. That is, you won’t be able to render a local HTML file if you click it from File Explorer. However, as it’s mostly remote links that you’ll want to view, not local files, this isn’t that big a problem.

Again, let’s emphasize it again:

with WM6 PPC’s (unlike with pre-WM6 ones), you must copy the URL to the clipboard and only after this click the link!
It does NOT work with touchscreen-less WM6 Smartphones (WM6 Standard devices)! That’s because of the operating system’s inability for any kind of copy/paste operation.


Installation, usage

download and install MortScript (http://www.sto-helit.de/index.php?module=page&entry=ms_overview&action=view) if you haven’t already done so. Make sure you install it in the main memory (unless you’re ready to modify the scripts I’ve provided).
download THIS (http://www.winmobiletech.com/112007OM4Final/OperaMiniDefaultBrowser.zip) file
depending on your operating system version, go to either the WM5 or WM6 directory of the ZIP file downloaded in the previous step. Note that if you’re still using a pre-WM5 operating system, you’ll need the WM5 version.
transfer OMInvokeAndPasteScript.mscr to \Program Files\MortScript on your device
import the registry file into the Registry (WM5: OMInvokeAndPaste.reg; WM6: OMWM6DefBrowser.reg). if you do this on a MS Smartphone, make sure it is application unlocked. I’ve published several articles on (the absolutely legal) app unlock; see for example THIS (http://www.pocketpcmag.com/blogs/index.php?blog=3&p=2004&more=1&c=1&tb=1&pb=1)

If you absolutely don’t know how the Registry import file needs to be imported, do either of the following:


either get (and, even better, purchase - they DO deserve it as it’s a REALLY excellent app) SOTI’s Pocket Controller (http://www.pocketpcmag.com/blogs/index.php?blog=3&p=2106&more=1&c=1&tb=1&pb=1). Install it, connect to your device, click the Registry icon. Then, select Edit / Import in the new remote Registry Editor window. Search for the registry file and import it.
or, get Resco Explorer (http://www.resco.net/pocketpc/explorer/default.asp). Install it on your mobile device; make sure you don’t disable the Registry editor install. Start the latter and, then, just exit it – this makes sure .REG files become associated with the Registry editor. Now, after you’ve transferred the REG file to your handset, just click it from inside File Explorer. Voila: it gets imported into the local Registry.

That’s all – from now on, clicking links in mails, documents etc. should fire up OM and pass the URL.

How you can (and when you must) modify OMInvokeAndPasteScript.mscr ?

The majority of the application logic is, in both the WM5 and WM6 versions, in OMInvokeAndPasteScript.mscr. Therefore, you’ll need to modify it in the following cases:

first, the most important instruction you’ll need to modify is the second row Run("\Windows\jbed.exe", "-run sX_"), where X is either 0 or 1 (I’ve set it to 0 in the WM5 and to 1 in the WM6 script).

As is explained in my earlier Opera Mini & Jbed-tutorial and posts (see for example THIS (http://my.opera.com/community/forums/topic.dml?id=210354&t=1196171032&page=1#comment2333092)) , along with other people (see for example THIS (http://pdaphonehome.com/forums/ppc-6800-xv6800/91837-opera-mini-4-beta-2-released-includes-info-new-java-midlet-manager.html)), X stands for as how manieth OM was deployed under Jbed.

also note that, if you have to use a pre-WM5 operating system, it’s here that you need to define your TAO / IMB J9 links. Please consult the related section in the MIDlet Bible for more info on how these links need to be created.

Just remember the following: the Run() function requires two parameters, both enclosed in “’s. First is the executable; the second is the passed parameters. The latter string, of course, can (and with both IBM J9 and TAO, will) consist of several parameters.

the script is geared towards Opera Mini 4 users. Under Opera Mini 3 (or previous versions), the initial two SendLeftSoft calls will NOT result in the “Enter address” dialog coming up. With Opera Mini 3, therefore, you will need to change the second SendLeftSoft to SendCR as follows:

#SetClipText(url)
Run("\Windows\jbed.exe", "-run s0_")
Sleep(6000)
SendLeftSoft
Sleep(400)
SendCR

Note that the above code snippet has SetClipText(url) commented out (note the # at the beginning of the row). This is only needed under WM6; under previous operating systems, you MUST NOT comment it out.

finally, you can fine-tune the parameters of Sleep() in the code so that OM is still reliably invoked. With the code above, for example, I let MortScript wait for 6 seconds (6000 milliseconds) before starting to emulating left softkey presses.


Quick explanation for the different behavior under WM6 (only for geeks / hackers / programmers!)

Under WM6, invoking the default Web browser isn’t any more done the same way as under previous operating systems. There, the contents of HKEY_LOCAL_MACHINE\ SOFTWARE\Microsoft\ Shell\Rai\ : DEFBROWSER\1 tell the system what to invoke. Here, unfortunately, it’s impossible to define additional command-line parameters. Parameters DO get passed (in the background), but you can’t name them. MortScript, however, relies on the latter – that is, named parameters referable under their name, NOT their index.

Under pre-WM6 operating systems, it was easy to name the parameters you passed to programs as can clearly be seen in the WM5-specific Registry import file, which just overwrites the old value of HKEY_CLASSES_ROOT\ http\Shell\Open\ Command:

@="\"\\Program Files\\MortScript\\MortScript.exe\" \"\\Program Files\\MortScript\\OMInvokeAndPasteScript.mscr\" url=\"%1\""

Here, I’ve named the parameter “url”. This is why the first row in the MortScript file is as follows:

SetClipText(url)

This just instructs MortScript to copy the contents of the “var” variable (which, now, comes from the “outside” of the script) to the clipboard so that, later, it can be pasted back to the URL input field.

Feel free to quickly scrutinize the two, WM6- and pre-WM6-specific Registry import files so that you can see this for yourself.

Currently, I don’t know a way of naming parameters under WM6. Of course, when I come up with a solution, I let you all know.

Menneisyys
11-29-2007, 10:53 PM
UPDATE (11/29/2007): thanks to badbob001 on my blog (http://www.pocketpcmag.com/blogs/index.php?blog=3&p=2334&more=1&c=1&tb=1&pb=1), now, as opposed to the initial case, WM6 devices (both Pocket PC's and Smartphones) are FULLY supported!!!!!!!

This all means there is no longer a difference between how WM6 and pre-WM6 operating systems behave. You only need to make sure to get the right .MSCR and Registry import files from the already-updated ZIP file (http://www.winmobiletech.com/112007OM4Final/OperaMiniDefaultBrowser.zip), depending on your operating system version. That is, for WM6, get the files from the WM6 subdirectory, for pre-WM6 operating systems, from the WM5 one. And, of course, modify the scripts if Opera Mini isn't deployed as the first app under Jbed, the, by default, supported (and highly recommended) MIDlet manager.

Again: Under WM6, manual link copying to the clipboard is no longer needed and, again, it works 100% on WM6 Smartphones as well!

(note that now that WM6 is fully supported, I haven’t edited the original article; its WM6-related parts are now outdated. Again, WM6 is fully supported now and there's no difference between the usability on pre-WM6 and the WM6 platforms any more.)

Menneisyys
12-04-2007, 06:51 PM
UPDATE (12/04/2007): Major WM6-related updates have taken place in the meantime.

In the meantime, my blog reader badbob001 has refined the script (http://www.pocketpcmag.com/blogs/index.php?blog=3&p=2334&more=1&c=1&tb=1&pb=1). Now, if you click a link, you’ll be presented a choice list, where you can select whether to pass the given URL to Internet Explorer Mobile, Opera Mini, just copy to the clipboard or just cancel the operation. This will help you in selecting the right browser if you (still) plan to use IEM (or other native Web browsers like Opera Mobile, Netfront or Minimo).

http://www.winmobiletech.com/112007OM4Final/OpenInSelectableBrowser.png

Cool, eh?

Remember that you don’t need to deploy this script if you don’t need this kind of functionality but always want to be redirected right to Opera Mini. Therefore, I’ve also included the older version of this script in the ZIP file (http://www.winmobiletech.com/112007OM4Final/OperaMiniDefaultBrowser.zip). It’s in the NoBrowserSelectionDialog subfolder. Note that this script has also been updated a bit: it checks for Jbed already running; if it is, then, it doesn’t wait that much. Again, thanks for badbob001 for refining and performance-tuning my initial script.

Note that the usual stuff applies: if the script doesn’t invoke Opera Mini but invokes something else, edit both occurrences of s0 and appropriately change 0 to a greater number.

Finally, note that, these updates & bugfixs being all WM6-related, I haven't edited the old, WM5-related, working MortScript file. If you need some speedup and/or dynamic, runtime selection of the browser you'd like to use, you'll want to copy either of the two new MortScript files - it'll work.

2. Upon HowardForums forum member volwrath’s bug report (http://www.howardforums.com/showpost.php?p=10312153&postcount=22), I’ve enhanced the Registry import file to support invoking Opera Mini from all applications, not only Messaging and Notes. I wouldn't have thought WM6 is so half-baked (that is, half of the apps still depend on the pre-WM6 (that is, the HKCR/http/Open/Command) way of invocation). That is, the WM6 Registry import script has also been enhanced (basically, I've just added the contents of the old WM5-related Registry import file to it), not only the MortScript file.

Note that reading local files will still default to the system-level browser as I haven’t redefined the default application for opening .htm(l) files. That is, by default, Internet Explorer Mobile will open these.

Again and again, it can’t be stressed enough how much these hacks enhance the usability of Opera Mini under Windows Mobile! I really recommend giving Opera Mini a try – you certainly won’t regret it!

Menneisyys
12-12-2007, 04:11 PM
UPDATE (12/12/2007): upon the problem reports of several Smartphone users (see the posts for example HERE (http://www.howardforums.com/showthread.php?t=1283853&page=4&pp=15)), I’ve released a slightly modified version of the script that, instead of pasting, uses keyboard emulation. This makes it possible to use the script on some Smartphones that are incompatible with pasting.

The script is available HERE (http://www.winmobiletech.com/092007MidletBible/OMInvokeAndPasteScript.mscr.SP.2). Remember to remove the SP.2 extension before deploying it. Note that, again, it's ONLY meant for Smartphone users that previous script versions didn't work with!!!

Note that while it works on for example the I3 Beta of WM6 of the Samsung BJ, it doesn’t do the same on the (original) WM5 version of the same device or the HTC Vox (s710). It seems it’s impossible to support these devices with the current MortScript version. I'll also try to reimplement the script in nScriptm (another, less widely used scripting language / interpreter) - hope it is able to paste / send characters to these, still incompatible MS Smartphone models.

Menneisyys
12-14-2007, 03:11 PM
UPDATE (12/13/2007): I’ve also made available the Registry import file you’ll need to use when reverting to the original, Internet Explorer-only associations. It’s HERE (http://www.winmobiletech.com/112007OM4Final/DefIEBrowser.reg).

Menneisyys
12-15-2007, 07:20 PM
UPDATE (12/15/2007): XDA-Devs forum member shlomki has just released the different hacks in CAB format so that they’re very easy to install. They’re available HERE (http://forum.xda-developers.com/showpost.php?p=1740111&postcount=17). Comments are welcome. (Note that, due to lack of time, I haven’t checked them.)

Menneisyys
04-04-2008, 04:40 PM
UPDATE (04/04/2008): Now that Opera Mini 4.1 beta has been released (see THIS (http://www.pocketpcmag.com/blogs/index.php?blog=3&p=2571&more=1&c=1&tb=1&pb=1)) with a, by default, slightly modified address input field, you’ll need a modified version available HERE (http://forum.xda-developers.com/showpost.php?p=2082313&postcount=83).

Also, there’s a full native (C++), MortScript-free implementation of the invocation script HERE (http://forum.xda-developers.com/showpost.php?p=2048809&postcount=79). It’s (still) not compatible with 4.1 unless you untick "Direct address input" in Settings.

Menneisyys
04-05-2008, 12:33 PM
UPDATE (04/05/2008):

XDA-Devs user JZ SmartMort has released a very promising title making Opera Mini the system-level browser much simpler and offering a LOT of additional functionality. See his thread HERE (http://forum.xda-developers.com/showthread.php?t=382043). Note that he also posted a somewhat shorter post HERE (http://forum.xda-developers.com/showpost.php?p=2087762&postcount=88) (in THIS (http://forum.xda-developers.com/showthread.php?p=2087807) thread, should you also want to read the possible, future discussion of his app).

Menneisyys
04-06-2008, 10:16 AM
UPDATE (04/06/2008): The native C++ version of the invocation script has been updated to be compliant with 4.1 (http://forum.xda-developers.com/showpost.php?p=2088121&postcount=91). In addition, badbob001 has updated his MortScript to be compatible with 4.1 and he is also doing automatic (!!!) descriptor parsing & discovery to automatically find the current position of the OM deployment (just like the JZ SmartMort's brand new script I've reported on above), which, so far, needed to be done (once) by hand. See his updated script HERE (http://forum.xda-developers.com/showpost.php?p=2090371&postcount=95). Both advancements are discussed HERE (http://forum.xda-developers.com/showthread.php?t=347689&page=10), starting with page 10 (post #91).