[M] [M-Button] JS-plugin (Greasemonkey for Maxthon)

[M-Button] JS-plugin (Greasemonkey for Maxthon)

JS-plugin (??? Greasemonkey for Maxthon)

"Greasemonkey is a Firefox extension which lets you to add bits of DHTML ("user scripts") to any webpage to change its behavior. User scripts let you easily control any aspect of a webpage's design or interaction..."





To install .js file:
- save it to scripts folder (../JS-plugin/Scripts);
- open Options window and set URLs (included/excluded);

A few principles for coders:
- add header to your script (not required, but... see the screenshot, 8 lines);
- URLs should be divided (if more than one) by comma;
- try to wrap the entire script in an anonymous function (pleeease);

Tips:
- all changes will be saved when you close Options window except changes made to script source (use Save button for it);
- use wildcards to specify URL, (*) means - any character zero or more times, (?) means any character one time;

What's new:
25-04-2005 - 0.4 beta
+ now you can add any script to plugin's menu (use "Menu" button) ;
+ new button to expand source textarea;
+ old meta format is back (sorry... sorry... sorry...);
+ some scripts added;
* other small bug fixes;

19-04-2005 - 0.3 beta
+ "bookmarklets behaviour" added, dblclick on script name to launch this script on current tab, Alt+dblclick to launch and close options window;
* fixed the problem with looping in frames;
* fixed the problem with included/exluded lists;

19-04-2005 - 0.2 beta
+ checking and renaming filenames procedure to escape special characters;
+ wildcard (?) support to specify URL (means any character one time);
+ JS-plugin metadata OR Greasemonkey metadata OR No metadata support;
* JS-plugin metadata format was changed, sorry...;
+ "Address" and "Host" buttons to add current URL to Included (Excluded) lists;
+ "Meta" button to insert JS-plugin metadata to script;
+ "Clear" buttons for all textareas;
+ scripts sorting by name on load;
+ scripts counter;

14-04-2005 - 0.1 beta
- first release;

Ask me if you looking for scripts or if you want to convert scripts from Greasemonkey library...

WARNING:
JS-plugin in its "beta" stage of development... there will be bugs, and they will be worked out... not sure that logic I used in this plugin is the best way to do the task so... I would appreciate any help.

Attachment

JS_plugin_0.4_beta.zip (17.68 KB)

2005-4-25 09:58, Downloads: 8616

Wow! Very nice! I can see this plugin becoming very popular
For all the latest news on anything Tremors, visit Tremors News.
To read my blog, all about my film life, visit End Darko.

Join the Maxthon channel and start chatting now!
Very nice!! What would be nice, is a copy function, so if you have a js that you want to make a variant of, you can just select it, copy it to a new file, and edit that one to your liking. This will certainly be a plugin i will use! []

[Intel Core i7 920, 12GB RAM | ATI 4870 PCI-E 2GB |30" TFT @ 2560x1600 | Windows 7 Ultimate]

Maxthon autologin hangs the browser for me :s

[Intel Core i7 920, 12GB RAM | ATI 4870 PCI-E 2GB |30" TFT @ 2560x1600 | Windows 7 Ultimate]

I'm a bit confused about this plugin's purpose. abc@home's Plugin Manager allows us to run custom userscripts as it is. Are we looking here to run scripts that have already been written for the Firefox Greasemonkey extension, e.g., those listed here? My understanding is that the above listed scripts are for the most part incompatible with IE, so if they have to be re-written anyway, why have two plugins that will run the same scripts? []
rob8grave (Eric)
Max 1.5.6 (build 42) Unicode / Max2 2.02.2961(Unicode)/ WinXP / IE7
They were released within 1 day of each other, so neither one probably knew that the other one was working on a similar solution.

[Intel Core i7 920, 12GB RAM | ATI 4870 PCI-E 2GB |30" TFT @ 2560x1600 | Windows 7 Ultimate]

rob8grave

QUOTE
I'm a bit confused about this plugin's purpose. abc@home's Plugin Manager allows us to run custom userscripts as it is.

Use Plugin Manager, forget about JS-plugin, I guess the first is much better... ;-)
QUOTE
why have two plugins that will run the same scripts

What a strange question... Why have 1000 filemanagers, 100 image viewers, 10 browsers...? Should we stop developing plugins knowing that someone somewhere is coding something similar or even the same. I don't think so.
I like this plugin. It has very good potential. It's easier to manage than abc's version for simple scripts... Everything in one dialog makes it a little easier. There are some bugs though that needs to be looked into. Tried adding a file with a plugin... took the same 8 lines from another files and added some code. The plugin refused to initialise when i went to the setup (all fields completly blank). The Maxthon auto login script doesn't work either... seem to loop endessly for me at least. But once the bugs are fixed, this one will be a keeper for sure [:smile:]

[Intel Core i7 920, 12GB RAM | ATI 4870 PCI-E 2GB |30" TFT @ 2560x1600 | Windows 7 Ultimate]

Somehow this reminds me of Proxomitron.

Maxthon 2.5.14.256 Unicode | IE 8 | Windows 7 Pro x64| E6550 | 4GB ram | M2 Suggestions

QUOTE(Zeroglif @ 2005-04-14 04:48:24 PM)
rob8grave

QUOTE
I'm a bit confused about this plugin's purpose. abc@home's Plugin Manager allows us to run custom userscripts as it is.

Use Plugin Manager, forget about JS-plugin, I guess the first is much better... ;-)
QUOTE
why have two plugins that will run the same scripts

What a strange question... Why have 1000 filemanagers, 100 image viewers, 10 browsers...? Should we stop developing plugins knowing that someone somewhere is coding something similar or even the same. I don't think so.
[snapback]124168[/snapback]


I meant no disrespect by the question, and as a matter of fact, I think there is a sensible enough answer to it, something that I thought of after I posted:

Site Specific scripts, like short-cutting to "Single-Page-Format" for a NYTimes article, would probably be best implemented by your JS Plugin -- and, as I browse through the Greasemonkey list, it is obvious that a choice of site-specific scripts is potentially infinite. I look forward to the time when a list of such choices is available for Maxthon users, and I think your plugin would be best suited for that purpose (better than abc@home's Plugin Manager, which was not really designed with that purpose in mind.)

We do have the advantage, here in the Maxthon community, of coordinating purposes, so as to avoid the confusion that seems to prevail with the Firefox browser, i.e., knowing which of a number of extension options to use. And that was all I had in mind in my original post " border="0" alt="smile.gif" />
rob8grave (Eric)
Max 1.5.6 (build 42) Unicode / Max2 2.02.2961(Unicode)/ WinXP / IE7
Excellent work Zeroglif. I've not had any problems with your plugin till now. I've been using it for some time now and feel you really have something here. To be honest I haven't used Plugin manager, so I don't know how it compares with js-Plugin. I want to write some scripts, but, I'm still learning Javascript. So, to start off I was just changing some scripts that I use with Greasemonkey to be used with Maxthon. Here is the first one, it removes all the Feedburner ads in Bloglines. bloglines_feedburner_ad_remover.zip (571 Bytes) I'll see what other scripts can be used with Maxthon. Please don't stop your development of the plugin.
Thanks for the plugin Zeroglif! Looks really great I see it's currently a beta version. Could I add it to the plugins site then? Or would you rather I waited until the major issues had been solved? Let me know please Thanks again and keep up the good work
xpsp2 pl | IE6 | Proxo 4.5 | the browser formerly known as MyIE2 (1.3.3  ANSI)
screen res: 800x600 px | color depth: 32 bit | font size: 96 dpi (more info here)

Please make sure you follow the Forum Rules when posting. Thanks in advance.

Action speaks louder than words but not nearly as often. - Mark Twain

I have a slight problem here. When I click on the icon and click on 'Options' the options window opens correctly. All buttons are there and so are the titles for all the boxes. The problem is that nothing else comes up. It does not load any of the scripts in the 'scripts' folder. I am running Maxthon 1.2.3(build 52) Unicode. Unfortunately I did not try the plugin with the previous version of Maxthon. Serge
Tara
QUOTE
I see it's currently a beta version. Could I add it to the plugins site then? Or would you rather I waited until the major issues had been solved? Let me know please

Let JS-plugin live here while it's in "beta" stage... Thanks!

jersp carpediem

I wish next version (plan to release it tomorrow or day after) will be more stable. I'm working on it to make logic more clear... metadata (name, version, author...) dependancy will be removed...

thejo

Thanks a lot for your support!
QUOTE(Zeroglif @ 2005-04-15 07:17:27 PM)
Let JS-plugin live here while it's in "beta" stage... Thanks!
[snapback]124784[/snapback]

OK IPB Image Thank you IPB Image
xpsp2 pl | IE6 | Proxo 4.5 | the browser formerly known as MyIE2 (1.3.3  ANSI)
screen res: 800x600 px | color depth: 32 bit | font size: 96 dpi (more info here)

Please make sure you follow the Forum Rules when posting. Thanks in advance.

Action speaks louder than words but not nearly as often. - Mark Twain

how can i change these plugins to userscript? ViewTarget Linkify AutoCopySelection Smart Scroll
UPDATE!

tech

The best way is to ask original plugin author to create .js file for JS-plugin... If you know Javascript you may try to do it yourself:

- Open JS-plugin options window;
- Select any script;
- Enable edit mode;
- replace code inside anonymous function with new one;
- change or remove metadata (name, author...) and Save as new script;

For example this is View Target code for JS-plugin:
QUOTE
/*DO NOT REMOVE LINES 1-8, KEEP ORIGINAL TERMS (Name=,Version=,etc)
Name=ViewTarget
Version=1.0
Author=jpb
Description=Show title, link and target in the popup of every href. Work also when link is a img...
In-URL=*
Ex-URL=
--------------------------------------------------------------------------------*/

(function(){
img = document.getElementsByTagName('IMG'); 
m  = img.length; 
for(i=0; i<m; i++)
{
if (img.parentNode.tagName=="A")
{
if (img.alt && !img.title) img.title=img.alt;
if (img.title) titre=img.title;else titre=img.parentNode.title;
if (img.parentNode.target) texte="\n\n#### ==> target="+img.parentNode.target+" <== ###";else texte="";
img.title=titre+"\n\n"+img.parentNode.href+texte;
}
}
A = document.getElementsByTagName('A'); 
n  = A.length; 
for(i=0; i<n; i++)
{
if (A.target) texte="\n\n#### ==> target="+A.target+" <== ###";else texte="";
if (A.title) A.title=A.title+"\n\n"+A.href+texte;else A.title=A.href+texte
}})()
Hi Zeroglif Love the changes. I have some problems though. The options button often just stop working sometimes, so the only way I can get into the config dialog, is to go via Maxthon Options -> Plugins. The Maxthon Forum autologin does not seem to work either, for me at least. Highlight script works fine, so I'm not sure what the problem can be. EDIT: This actually seem to be a Maxthon problem. I get the same on some other plugins now, i notice. Gonna try a complete re-install of Maxthon on this computer and see if that fixes my problems []

[Intel Core i7 920, 12GB RAM | ATI 4870 PCI-E 2GB |30" TFT @ 2560x1600 | Windows 7 Ultimate]

QUOTE(Zeroglif @ 2005-04-19 02:38:38 PM)
UPDATE!

tech

The best way is to ask original plugin author to create .js file for JS-plugin... If you know Javascript you may try to do it yourself:

- Open JS-plugin options window;
- Select any script;
- Enable edit mode;
- replace code inside anonymous function with new one;
- change or remove metadata (name, author...) and Save as new script;



thank u very much!i will try to do it myself with your example!
carpediem
QUOTE
The Maxthon Forum autologin does not seem to work either, for me at least.

What about this code (based on form name):

(function (){
f=document.getElementsByName('LOGIN')[0];
f.elements[2].value='foo-login';
f.elements[3].value='foo-password';
f.elements[7].click();
})()


And replace *forum.maxthon.com/index.php?act=Login* in included list with http://forum.maxthon.com/index.php?act=Login&CODE=00