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

Search This thread

ItsDon

Senior Member
Mar 29, 2008
2,122
312
Dripping Springs, Texas
Menneisyys,

Found this over on ppcgeeks, coded in C++. works the same as yours but does not need mortscript. might be worth adding to your first post as an alternative? to quote the developer (and with thanks to same)

"Attached is a beta app that will set opera mini as the default web browser and open links when clicked from email, etc. The app has been tested to work in wm6. It assumes that java is at /windows/jbed.exe and the Opera mini app is the first applet installed. This app is similar to the mortscript version, but, is coded in c+ and does not rely on delays."

Just a heads up for folks here that this .cab file works great on my Dash with WM6.1. I do still get the nag/warnings the initial time Opera is invoked but other than that it works like a charm! Thanks for posting it!
 

kino-kino

Member
Mar 5, 2008
23
0
I used that mortscript with sucess with opera mini.

Unfortunatly it does not run well with that new opera mini beta 4.1

There seems to be something new in that beta.

The copied link does not get pastet in the field for the url anymore.

Does anyone know how to add the script, thanks!
 

dgaud007

Senior Member
Oct 12, 2007
323
11
Ponce
I have this working with 4.1 beta and some modifications to the script (see below).In my case, it kept duplicating or echoing each character in the url string, like wwwwww..xxddaa-- ... etc. so I replaced the SendKeys(url) statement with a for next loop. (this trick was suggested by Menneisyys on post # 16 of this thread). It is kind of slow doing it now, so please let me know if there is an easier fix or setting. Thanks,

#Open Address Box
SendLeftSoft
Sleep(1000)
SendLeftSoft
Sleep(1000)​
#Clear default www. characters
SendEnd
SendBackspace
SendBackspace
SendBackspace
SendBackspace
Sleep(100)​
#Input link
ForEach char in charsOf %url%
SendKeys(%char%)
Sleep(1)
SendBackspace
Sleep(1)
EndForEach
Sleep(100)​
#Click OK
SendLeftSoft​
 
Last edited:

Menneisyys

Retired Moderator
Jul 25, 2005
5,511
138
www.winmobiletech.com
I have this working with 4.1 beta and some modifications to the script (see below).In my case, it kept duplicating or echoing each character in the url string, like wwwwww..xxddaa-- ... etc. so I replaced the SendKeys(url) statement with a for next loop. (this trick was suggested by Menneisyys on post # 16 of this thread). It is kind of slow doing it now, so please let me know if there is an easier fix or setting. Thanks,

#Open Address Box
SendLeftSoft
Sleep(1000)
SendLeftSoft
Sleep(1000)​
#Clear default www. characters
SendEnd
SendBackspace
SendBackspace
SendBackspace
SendBackspace
Sleep(100)​
#Input link
ForEach char in charsOf %url%
SendKeys(%char%)
Sleep(1)
SendBackspace
Sleep(1)
EndForEach
Sleep(100)​
#Click OK
SendLeftSoft​



Cool, will link to your post in my next article.
 

Menneisyys

Retired Moderator
Jul 25, 2005
5,511
138
www.winmobiletech.com
Menneisyys,

Found this over on ppcgeeks, coded in C++. works the same as yours but does not need mortscript. might be worth adding to your first post as an alternative? to quote the developer (and with thanks to same)

"Attached is a beta app that will set opera mini as the default web browser and open links when clicked from email, etc. The app has been tested to work in wm6. It assumes that java is at /windows/jbed.exe and the Opera mini app is the first applet installed. This app is similar to the mortscript version, but, is coded in c+ and does not rely on delays."

Will definitely do.
 

Menneisyys

Retired Moderator
Jul 25, 2005
5,511
138
www.winmobiletech.com
UPDATE (04/04/2008): Now that Opera Mini 4.1 beta has been released (see THIS) with a, by default, slightly modified address input field, you’ll need a modified version available HERE.

Also, there’s a full native (C++), MortScript-free implementation of the invocation script HERE. It’s (still) not compatible with 4.1 unless you untick "Direct address input" in Settings.
 

badbob001

Senior Member
Mar 28, 2005
324
17
If your device supports control-v, then this mort script works for me on 4.1 with direct address input still enabled. Pasting is certainly much faster than sending characters to the device one at a time. I mainly added the "if (direct_address_input = True)" parts to send extra keystrokes to get to the enter symbol option and clear out the existing address. Then the script can paste the url as before. If you use this script with 4.0, then just set direct_address_input = False and it work as before.

Only tested it briefly so it may not be perfect. Be sure to change the beginning variable values to suit your device.

Update: using ctrl-home and ctrl-end to simulate ctrl-a, the script is slightly faster due to fewer steps.

Code:
direct_address_input = True
jvm_string = "\Program Files\Jbed3DMod\jbed.exe"
applet_string = "-run s1_"
delay_if_jbed_running = 3000
delay_if_jbed_not_running = 8500

if (substr(url,1,1) eq " ")
	url = substr(url,2)
EndIf

If ( Find( "file:///", ToLower(url) ) )
	Run("\Windows\iexplore.exe", url)
Else
	Call OpenOM
EndIf

Sub OpenOM
	If (ProcExists("jbed.exe"))
	   Run(jvm_string, applet_string)
	   sleep(delay_if_jbed_running)
	Else
	   Run(jvm_string, applet_string)
	   sleep(delay_if_jbed_not_running)
	EndIf
	
	SendLeftSoft
	Sleep(100)
	SendLeftSoft
	Sleep(100)

	if (direct_address_input = True)
		sendup
		Sleep(100)
		sendup
		Sleep(100)
		sendcr
		Sleep(100)
	Endif
	
	SetClipText(url)
	
	SendHome("",1,0)
	sleep(100)
	SendEnd("",1,1)
	sleep(100)
	
	SendCtrlKey("V")
	Sleep(100)
	SendLeftSoft
	sleep(100)

	if (direct_address_input = True)
		sendcr
	endif
EndSub
 
Last edited:

JZ SmartMort

Senior Member
Mar 24, 2008
784
16
Burbank
Full MortScript Solution for Windows Mobile Devices - JZ SmartMort

Hi everyone,

JZ SmartMort is a new Mort script pack of mine. It has some logic enhancements to ones in this thread, like a self installer/remover, also not having to deal with finding your java application ID for Opera, my script figures it out. It has clipboard history ability and many more features. Screenshot is attached. You can find more info HERE or HERE. Read below for a little more specific info. Thanks to this post I learned a lot and now contributing something worthwhile IMHO.

The script pack is meant for SmartPhones and Pocket PC devices running Windows Mobile 5 and above with Mort's MortScript installed as the macro engine mapped to the Notes hardware button.

Copy/Paste: This was the first task since SmartPhones don't have the function.

Clipboard History: Added ability to select the last 10 items copied to the clipboard.

Browsing: Opera Mini 4 & Opera Mini 2.00 Mod are free, some sites look and feel better using Opera, so I wanted to make it a system level browser with the option to revert to IE as needed. Also added support for the non-free version of Opera Mobile.

IE Favorites: Ability to open Internet Explorer favorites under \Windows\Favorites where .url files are stored.

Java: TAO Intent Java Midlet which came on my Cingular 3125 phone, is garbage in comparison to Jbed. Esmertec Jbed is about twice as fast and I highly recommend using it, so I added support for jbed.exe.

Activation: JZ SmartMort comes with a self installer/remover. Once installed, script is activated by pressing the Voice Notes button.
 
Last edited:

Menneisyys

Retired Moderator
Jul 25, 2005
5,511
138
www.winmobiletech.com
Hi everyone,

JZ SmartMort is a new Mort script pack of mine. It has some logic enhancements to ones in this thread, like a self installer/remover, also not having to deal with finding your java application ID for Opear, my script figures it out. It has clipboard history ability and many more features. Screenshot is attached. You can find more info HERE or HERE. Read below for a little more specific info. Thanks to this post I learned a lot and now contributing something worthwhile IMHO.

The script pack is meant for SmartPhones and Pocket PC devices running Windows Mobile 5 and above with Mort's MortScript installed as the macro engine mapped to the Voice Notes hardware button.

Copy/Paste: This was the first task since SmartPhones don't have the function.

Clipboard History: Added ability to select the last 10 items copied to the clipboard.

Browsing: Opera Mini 4 & Opera Mini 2.00 Mod are free, some sites look and feel better using Opera, so I wanted to make it a system level browser with the option to revert to IE as needed. Also added support for the non-free version of Opera Mobile.

IE Favorites: Ability to open Internet Explorer favorites under \Windows\Favorites where .url files are stored.

Java: TAO Intent Java Midlet which came on my Cingular 3125 phone, is garbage in comparison to Jbed. Esmertec Jbed is about twice as fast and I highly recommend using it, so I added support for jbed.exe.

Activation: JZ SmartMort comes with a self installer/remover and the script is activated by pressing the Voice Notes button.

Wowz! Great! Will soon post an article update!
 
Last edited:

Menneisyys

Retired Moderator
Jul 25, 2005
5,511
138
www.winmobiletech.com
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. Note that he also posted a somewhat shorter post HERE (in THIS thread, should you also want to read the possible, future discussion of his app).
 

chrisd1a1

Retired Forum Moderator
Nov 7, 2007
1,395
597
leeds
4.1 working with c++ version

As far as i can see the default setting for both the mort and the c++ varies depending on when the application was added to jbed, (ie if it is the first app you ever added will be s_0 if it is the second s_1 etc. which means this will vary for everyone.

have tweaked the c++ as easier to hexedit.

1/ open and install the cab
2/ copy the exe from the seperate folder (the default for the cab is s_0, so start at s_1?) and paste into windows, overwiting the original
3/ try an email link
4/ if does not work try the next exe

i,ve edited and signed up to s_6 so should work for most. and quick and easy to do

with the fact that this can be set as default for email, you can upload and download, and it's faster than the 4.0 ver, i gotta admit i'm impressed. works well for a beta

think this is my new browser:)
 

badbob001

Senior Member
Mar 28, 2005
324
17
If you look at JZ's scripts, he actually parses the selector.utf file to figure out which suite number Opera Mini is installed under, which eliminates the guessing. He also parses the registry to find out where the jvm executable is located so most things are pretty automatic. Very cool work.
 
Last edited:

chrisd1a1

Retired Forum Moderator
Nov 7, 2007
1,395
597
leeds
If you look at JZ's scripts, he actually parses the selector.utf file to figure out which suite number Opera Mini is installed under, which eliminates the guessing. He also parses the registry to find out where the jvm executable is located so most things are pretty automatic. Very cool work.

i know, very neat work (i go with brute force and ignorance) must improve my skills one day:D
 

JZ SmartMort

Senior Member
Mar 24, 2008
784
16
Burbank
Give me a break :)

We can trade skills :) you did it in C++, the real way, I just took a shortcut cuz it was available :) and heavily documented on forums like this.

I did put some love into that script though, for a good 2 months, saying to myself I wish it could do this or that. It's finally a script full of many features and if I see more suggestions, I'll add them in. That's the nice thing about the script, easy editing --- but you were right Chris, pauses are a ***** to deal with. I already replied to somebody with that issue on the BrightHand crosspost of this thread. Next version will have the pauses at the top with an explanation in the release notes.
 
Last edited:

badbob001

Senior Member
Mar 28, 2005
324
17
This updated script contains parts that is based on JZ's automatic detection of jbed's location and opera suite number. The script works with both Opera mini 4.0 and Opera mini 4.1.

You will need to edit the top part of the script to specify the opera mini version you are running: opera_version_to_run = "4.1" or opera_version_to_run = "4.0". While the script can detect if opera mini 4.0 or 4.1 is installed, it can't read your mind to figure out which Opera to run if you have both installed.

If you have 4.1 with direct address input turned off, then set direct_address_input = False. This is ignored if you have 4.0.

Adjust the delays as needed.

Tested with jbed 20080222.3.1 on a T-mobile shadow.

Much thanks to JZ for your great work and inspiration for me to dust off my old script.

Code:
direct_address_input = True
opera_version_to_run = "4.1" # Use 4.0 or 4.1
delay_if_jbed_running = 3000
delay_if_jbed_not_running = 8500

if (substr(url,1,1) eq " ")
	url = substr(url,2)
EndIf

If ( Find( "file:///", ToLower(url) ) )
	Run("\Windows\iexplore.exe", url)
Else
	Call OpenOM
EndIf

Sub OpenOM
	opera40_string = "Opera Mini,"
	opera41_string = "Opera Mini 4.1,"

	utf_file = ReadFile(RegRead("HKCR","jarfile\Shell\Save\Save Location","") & "\selector.utf")
	counter = 0
	opera_found = 0
	ForEach line in split (utf_file, "^LF^", 1)
		If (opera_found = 0)
			counter = counter+1
			opera_version_found = "unknown"
			
			If (Find(line,"suite=" & opera40_string) ne 0)
				opera_version_found = "4.0"
			ElseIf (Find(line,"suite=" & opera41_string) ne 0)
				opera_version_found = "4.1"
			EndIf
			
			if (opera_version_found eq opera_version_to_run)
				prog_line = Part( utf_file,"^LF^",counter+3,1 )
				prog_id = SubStr( prog_line , Find(line,"=") , 3 )
				if (prog_id ne "")
					jbed_params = "-run " & prog_id
					opera_found = 1
				EndIf
			EndIf
		EndIf
	EndForEach

	If (opera_found = 0)
		message ("ERROR: Unable to find Opera Mini " & opera_version_to_run)
	Else
		jbed_exe = Part(RegRead("HKCR","jarfile\Shell\Open\Command",""),"""",2,1)
		
		If (ProcExists("jbed.exe"))
		   Run(jbed_exe, jbed_params)
		   sleep(delay_if_jbed_running)
		Else
		   Run(jbed_exe, jbed_params)
		   sleep(delay_if_jbed_not_running)
		EndIf
	
		SendLeftSoft
		Sleep(100)
		SendLeftSoft
		Sleep(100)
		
		if (opera_version_to_run = "4.1" AND direct_address_input = True)
			sendup
			Sleep(100)
			sendup
			Sleep(100)
			sendcr
			Sleep(100)
		Endif
	
		SetClipText(url)
	
		SendHome ("",1,0)
		sleep(100)
		SendEnd ("",1,1)
		sleep(100)
	
		SendCtrlKey("V")
		Sleep(100)
		SendLeftSoft
		sleep(100)

		if (opera_version_to_run = "4.1" AND direct_address_input = True)
			sendcr
		endif
	EndIf
EndSub
 
Last edited:

Menneisyys

Retired Moderator
Jul 25, 2005
5,511
138
www.winmobiletech.com
UPDATE (04/06/2008): The native C++ version of the invocation script has been updated to be compliant with 4.1. 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. Both advancements are discussed HERE, starting with page 10 (post #91).
 

JZ SmartMort

Senior Member
Mar 24, 2008
784
16
Burbank
Much thanks to JZ for your great work and inspiration for me to dust off my old script.

Anytime! I'm glad people are finding it useful. badbob you should see some of your code in my scripts, so thanks goes to ya as well!

I have a little dilemma though, just released the friggin thing less than a week ago, and now Opera 4.1 beta comes out, and a few easy suggestions came in. I think I'm gonna release a new version, but I feel like I punked out with having a version 1.0 which lasted a week :)
 
Last edited:

JZ SmartMort

Senior Member
Mar 24, 2008
784
16
Burbank
JZ SmartMort 1.1 Released - 04/06/2008

Hi all,

Posting new version of JZ SmartMort 1.1 - 04/06/2008

Download HERE on XDA-Devs or at SourceForge.

Pasting below the enhancements, please let me know if there are any issues. A few big reasons for re-release. Opera 4.1 beta came out so I added support. Also a lot of people like me tried Opera Mobile 9.x beta which really messed my WM5 with regards to icons and file associations. My Install script has functionality to clean the mess up, but you will need to use the Install script again to "re-activate" the JZ SmartMort Browser script after fixing your icons and associations.

- Added Opera Mini 4.1 support - leave Opera's defaults alone, don't mess with direct URL input. I try to build my scripts for default settings of all software.
- Added "DefaultBrowser" to the top of "JZ SmartMort Browser.mscr" script. Basically bypassing the question of "which browser" but you still have the option to use the browser script from the main Action script.
- Placed pause/sleep durations to the top of "JZ SmartMort Browser.mscr" script, so slower/faster devices can adjust accordingly. The settings you see, fit my Cingular 3125 like a glove. Up to you to try different sleep durations for your specific unit.
- Killing jbed.exe and jmm.exe to make sure that my script has success every time. It's a tradeoff, I sacraficed Java load time for constant success of my script.
- Added "Fix icons & associations" to the Install script. Opera Mobile 9.x beta messes with a bunch of defaulticons and associations. This function resets everything to Microsoft defaults. I had to do a lot of research comparing registry exports of before and after Opera Mobile 9.


Future enhancement: Add another item to "JZ SmartMort Install.mscr" script which allows users to change their "device speed" and I can manipulate the key press pauses accordingly, for now just modify top of browser script.

Sorry, screenshots are old, don't have time and with my luck, Opera Mini 5 will come out in the next 20 minutes and then I gotta go through this fiasco again :)
 
Last edited:

badbob001

Senior Member
Mar 28, 2005
324
17
This is an experimental version of my script that tries to eliminate any need to edit parameters in the script.

1. It tries to detect when Opera Mini is active by looking for the red color of the Opera Mini title bar in the upper-left corner. This eliminates figuring out the arbitrary wait time after launching or switching to opera mini. If you use opera in full screen, then this will not work. If you have a windows theme where the upper-left corner is the same red as opera's, this *might* not work.

2. If you only have one copy of Opera Mini installed, be it 4.0 or 4.1, the script will launch that version despite the opera_version_to_run setting in the script. If you have more than one copy of Opera Mini installed, it will try to run the version specified by opera_version_to_run.

3. If you run the script directly or via shortcut, there will obviously be no url specified and the script will just launch Opera Mini. So now instead of messing with the 'run s0_' stuff in shortcuts and in other launchers, you can just link to the script and have it figure it out for you.

The only time you should need to change a parameter in the script is if you have Direct Address Input disabled, then you need to set direct_address_input = False.

There is some delay while the script tries to figure out how to run opera mini, so I added a wait cursor. My code is not very clean so suggestions to improve speed are welcomed. For the impatient, it certainly would be fastest to just tell the script how to run opera instead of having to figure it out every time. Another idea was to have its settings saved to an .ini file. If the .ini file does not exist, such as when running for the first time, the script runs the detection routines and creates the .ini file.

I did notice one or twice the script close Opera accidentally. Most likely a sent key in the middle got ignored and the following sent keys hit exit. Oh well.

Anyone notice when you switch away from Opera Mini 4.1 and then back, it sometimes appears that it's not responding to your key presses, but in fact it is but it is just not updating the screen? If you switch away and then back a few times, it will update itself and you'll see that your key presses did get through. It is beta...

Code:
direct_address_input = True
opera_version_to_run = "4.0" #Use 4.0 or 4.1

ShowWaitCursor

if (substr(url,1,1) eq " ")
	url = substr(url,2)
EndIf

If (url eq "")
	Call OpenOM
ElseIf (Find("file://", ToLower(url)))
	Run("\Windows\iexplore.exe", url)
Else
	Call OpenOM
EndIf
HideWaitCursor

Sub OpenOM	
	opera40_string = "Opera Mini,"
	opera41_string = "Opera Mini 4.1,"

	utf_file = ReadFile(RegRead("HKCR","jarfile\Shell\Save\Save Location","") & "\selector.utf")
	linenum = 0
	opera_count = 0

	ForEach line in split (utf_file, "^LF^", 1)

		linenum = linenum + 1
		opera_version_found = "unknown"
		prog_id = ""
					
		If (Find(line,"suite=" & opera40_string) ne 0)
			opera_version_found = "4.0"
		ElseIf (Find(line,"suite=" & opera41_string) ne 0)
			opera_version_found = "4.1"
		EndIf
				
		prog_line = Part( utf_file,"^LF^",linenum+3,1)
		prog_line_position = find(prog_line,"root=")
		if (prog_line_position ne 0)
			prog_id = substr(prog_line, prog_line_position+5, 3)
			if (prog_id ne "")
				opera_count = opera_count + 1
				opera_array[opera_version_found] = prog_id
			EndIf
		EndIf

	EndForEach

	If (opera_count = 0)
		HideWaitCursor
		message ("ERROR: Unable to find Opera Mini")
		exit
	ElseIf (opera_count = 1)
		ForEach opera_array_key, opera_array_value in array (opera_array)
			opera_version_found = opera_array_key
			jbed_params = "-run " & opera_array_value
		EndForEach
	Else
		ForEach opera_array_key, opera_array_value in array (opera_array)
			if (opera_array_key = opera_version_to_run)
				opera_version_found = opera_array_key
				jbed_params = "-run " & opera_array_value
			EndIf
		EndForEach
		If (jbed_params eq "")
			HideWaitCursor
			message ("ERROR: Unable to find Opera Mini " & opera_version_to_run)
			exit
		EndIf
	EndIf
		
	jbed_exe = Part(RegRead("HKCR","jarfile\Shell\Open\Command",""),"""",2,1)
	Run(jbed_exe, jbed_params)
	Call waitForOperaRed

	if (url ne "")
		sleep(100)
		SendLeftSoft
		Sleep(100)
		SendLeftSoft
		Sleep(100)
		
		if (opera_version_found = "4.1" AND direct_address_input = True)
			sendup
			Sleep(100)
			sendup
			Sleep(100)
			sendcr
			Sleep(100)
		Endif
	
		SetClipText(url)
	
		SendHome ("",1,0)
		sleep(100)
		SendEnd ("",1,1)
		sleep(100)
	
		SendCtrlKey("V")
		Sleep(100)
		SendLeftSoft
		sleep(100)

		if (opera_version_found = "4.1" AND direct_address_input = True)
			sendcr
		endif			
	endif

EndSub

sub waitForOperaRed
	operaRed = rgb(107, 12, 8)
	loop_count = 0
	loop_done = 0
	while (loop_done = 0)
		upperRightColor = colorat(0,0)
		if (upperRightColor = operaRed)
			loop_done = 1
		ElseIf (loop_count >= 60)
			HideWaitCursor
			message("ERROR: Did not detect Opera Mini after 30 seconds.")
			exit
		Else
			sleep(500)
			loop_count = loop_count + 1
		EndIf
	endwhile
endsub
 
Last edited:

JZ SmartMort

Senior Member
Mar 24, 2008
784
16
Burbank
This is an experimental version of my script that tries to eliminate any need to edit parameters in the script.

1. It tries to detect when Opera Mini is active by looking for the red color of the Opera Mini title bar in the upper-left corner. This eliminates figuring out the arbitrary wait time after launching or switching to opera mini. If you use opera in full screen, then this will not work. If you have a windows theme where the upper-left corner is the same red as opera's, this *might* not work.

badbob001, I think this time you did the motivating. You finally figured out how to get rid of the hard coded pauses, very cool! I tried messing with this concept a while ago but gave up after 20 minutes of no success, go figure. Hope you don't mind I snagged your concept also :) I decided to validate 2 pixels, to really make sure. I got it fully working in my script on all 3 browsers OM2, OM4 & OM4.1 but only in JBed, I should probably drop TAO Intent support, the blue softkeys at the bottom make it a pain to get color. I wonder what the market share is comparing TAO & JBed. Do most Windows Mobiles now use JBed or is TAO still in the game? Anybody?

badbob001 and I should just team up on SourceForge :)
 
Last edited: