Extensions :  K-Meleon Web Browser Forum
All about K-Meleon extensions. 
javascriptia UPDATE V4_3.3.2014 (long bookmarklets / javascript / userscripts)
Posted by: siria
Date: August 06, 2010 03:17PM

Sometimes bookmarklets are too long for K-Meleon, which currently only can handle a few lines.
This macro allows to use longer ones, up to max 32kB (hundreds of lines), provided you have them previously saved into a file on disk ;-)

Name and ending don't matter, can be everything.
You can also use this macro to run normal javascript files (like userscripts) that contain line breaks.
You can add notes on top of such a file (e.g. origin and description of a script), if the code in it starts with "javascript:"
If javascript and popups are blocked in the browser, those scripts will ignore the blocks and work anyway.
The last called script file will be remembered in this session, there's an own command for repeating it.

To add more script files, just save them to disk, then click "Bookmark from file" to pick and run one.



.


.

Context menus
= if you right-click on a page, on a selection, or (new in version 02) on an image or a link:
. . .

So far I think it's rather easy, but now it gets a little bit more complicated, sorry. It does work out-of-the box and most people will probably never customize anything, but *IF* you want to customize the menu, especially to configure the presets in the flip out menu, edit the macro file (javascriptia.kmm)
In the macro file there's also more info and advanced CONFIGURATION, like auto-loading a script for certain URL's.

UPDATE 2011-05-21:
DOWNLOAD v2 as .kmm:
(old version deleted, see Version3 further down!)


Tested in KM 1.5.4 and 1.6beta, probably works in other versions too.

This is a pure KM-macro in one kmm-file, it doesn't change or store anything, no prefs etc., no webservices used of any kind. Just save it into your macros folder and it works after a browser restart. Or remove it from the macros folder and it's completely 'uninstalled' ;-)

Just one thing, if you edit it to customize the menu, you may prefer to put it into the USER macro folder in your profile, considering that old prob with writing rights in XP+.

__________________________
Version update:
V2, May-2011: Extended menu, there's now also a line "Inject a Script..." in the context-menu of links and images (if you right-click on them). And added "how to" example for keyboard shortcuts, if you're ready to invent your own key combinations.

Note: The new download file is named "javascriptia_v2.kmm", to avoid accidentally overwriting a possibly customized (modified) old version with it. After updating, it may first look as if your customizations were vanished, or perhaps you get double menus. Then click Edit>Configuration>Macros (or User-Defined Macros) and find your old file in the KM macros folder. You can copy over the parts that you had modified into the new version. V2.kmm only has the beginning and the end changed (the menus), but the middle part with the user stuff can be copied over.

__________________________
Version update:
V3, Feb-2014: See own post, a couple posts further down



Edited 16 time(s). Last edit at 03/03/2014 08:33PM by siria.

Attachments: javascriptia01_menu1.png (24.1 KB)   javascriptia02_menu_img.png (9.3 KB)  
Options: ReplyQuote
Re: javascriptia (long bookmarklets / javascript / userscript from disk)
Posted by: siria
Date: May 20, 2011 10:51PM

Update to version v2 smiling smiley
Nothing major, just menu lines added to the context menus of images and links. And added examples for setting keyboard shortcuts in the macro.

Options: ReplyQuote
Re: javascriptia (long bookmarklets / javascript / userscript from disk)
Posted by: siria
Date: May 21, 2011 07:13PM

Oops... And sorry! Had a little typo in the new version yesterday, which made that the "Help + Configuration" didn't open the macro file, argh *blush*
There was 1 download yesterday, if you read this, please download again from the new link in the first post.



Edited 1 time(s). Last edit at 05/21/2011 07:18PM by siria.

Options: ReplyQuote
Re: javascriptia (long bookmarklets / javascript / userscript from disk)
Posted by: siria
Date: January 06, 2014 05:56PM

New version for testing in K-Meleon 1.7alpha:

(OLD) http://www.file-upload.net/download-8489037/javascriptia_v2.1.kmm.html

No new functions in it, just a workaround for newer KM-versions.
Old ones should still work too with it, but no need to update.
Also works in win98se, provided you got KM1.7 running on it smiling smiley

Stupid workaround for KM1.7+: If javascript is disabled in the privacy menu there appears now a little popup-notice "OK", otherwise auto-toggling of JS on-off wouldn't work any more.

Just drop the kmm-file into your macros folder and restart K-Meleon.

Attention, if someone CUSTOMIZED the old version kmm, do not delete it, or your modifications are lost. For a start you can just try with both versions active, old and new. If that doesn't work correctly, open both files in an editor, search for "injectjs", and overwrite that 1 line in the old version with the corresponding part in the new version, between "#####", it's about 14 lines. 2-3 lines lower copy over the 1 line with &_pref_SyncButtons. Now you can disable or remove the new version and use only your old one again.



Edited 1 time(s). Last edit at 02/28/2014 09:27PM by siria.

Options: ReplyQuote
Re: javascriptia (long bookmarklets / javascript / userscript from disk)
Posted by: siria
Date: February 28, 2014 09:06PM

NEW Extended Version V4:

DOWNLOAD:
http://kmeleonbrowser.org/forum/file.php?9,file=765,filename=javascriptia_v4.kmm
(v4 is just a little bugfix for v3)

Added another submenu to inject a temporary (session) script from copied text in a Link-URL or selected text or from the clipboard:



KM1.6 or older: Can now finally inject scripts in Cross-site-frames, if the mouse hovers over it or if text is selected in it. Of course not the whole page, but before those frames didn't work at all.
An example for testing, on this site at the bottom is an embedded frame from amazon.
www.schlagerportal.com/singlevorstellung/nicole-ein-neuer-tag-260214

KM1.7 Bugfix/workaround (works partly, not yet in cross-site-frames, and if Javascript is blocked there's a little popup message needed as pause.)

KM 1.8 / 74: Would anyone like to test if it runs there too? Do the current betas also have the injectJS bug as 1.7? At the moment the macro is set to use the 1.7-workaround for newer versions also, but that can be changed by editing the "version number" limit in it.

The macro should now also work if JS policy manager default setting is "noAccess" (temporary auto-toggle), although other settings may still block it.

Have now shortened the flipout menu in the bookmarks/favorites/hotlist to 1 line. But that's only the default setting, if anyone prefers the previous 3-line version it can be changed again by editing the macro, set or remove the # signs at the setmenu lines.

If anyone has an older version running already, please rename it to _kmm or whatever to disable it. If your old version has customizations in it, just copy over that block into the new kmm.

PS: GREAT that attachments work now and can be edited and deleted again!!



Edited 6 time(s). Last edit at 03/03/2014 10:57PM by siria.

Attachments: javascriptia03_menu1.png (43 KB)   javascriptia_v4.kmm (18 KB)  
Options: ReplyQuote
Re: javascriptia (long bookmarklets / javascript / userscript from disk)
Posted by: Zero3K
Date: March 02, 2014 07:49PM

What kind of userscripts are useable with it?

Options: ReplyQuote
Re: javascriptia (long bookmarklets / javascript / userscript from disk)
Posted by: siria
Date: March 02, 2014 09:35PM

Uhm - javascripts, obviously...
Not sure what you mean?

Options: ReplyQuote
Re: javascriptia (long bookmarklets / javascript / userscript from disk)
Posted by: siria
Date: March 02, 2014 11:03PM

Just went looking for some example as test, and found this nice one:
It's one of the many youtube downloaders. But unlike most others, this one is below the 32kB limit yet, just so barely! (at the moment yet, version 1.7.18)

http://userscripts.org/scripts/show/25105

The script is linked with the green install button in the right upper corner. Save the link to disk and then open it with this macro.



Edited 2 time(s). Last edit at 03/02/2014 11:27PM by siria.

Options: ReplyQuote
Re: javascriptia (long bookmarklets / javascript / userscript from disk)
Posted by: Zero3K
Date: March 02, 2014 11:10PM

Please add a dialog box that will popup to allow easy adding of a url to a list containing sites that will automatically use a certain userscript with no more user input needed. Thanks in advance.

Options: ReplyQuote
Re: javascriptia (long bookmarklets / javascript / userscript from disk)
Posted by: Zero3K
Date: March 03, 2014 04:56PM

Btw, how do I set it to automatically inject "C:\Program Files\K-Meleon\userjs\chat_filter.user.js" into http://www.twitch.tv/twitchplayspokemon via its AUTO-LOAD by URL function?



Edited 1 time(s). Last edit at 03/03/2014 04:56PM by Zero3K.

Options: ReplyQuote
Re: javascriptia (long bookmarklets / javascript / userscript from disk)
Posted by: siria
Date: March 03, 2014 07:35PM

NEW UPDATE to version 4 (nothing new, just a little bugfix for v3)

@Zero3K:
For automatic stuff I think there are far more comfortable and famous extensions out there , although I never looked for them, so don't know which name. Lots of extensions can be found on kmext.sf.net

This macro here was in the beginning just meant as a little basic one, although it started growing bit by bit. The prob is I'm no programmer and can do only macrolanguage, that restricts inputs to simple 1-liners and menus, or to editing the macro file directly.
But I'm afraid the crude v3-method for automatic loading is really WAY too complicated.

Will try to simplify it in the next days, but cannot promise.
The configuration will still have to be done inside the macro file, but really a lot easier - IF it works as I have in mind now.

Meanwhile please download version 4 above, it already has prepared a menu for your chatfilter script.
To activate it, open the macro file in a text editor (please tell if it also works via macro menu: Help+Configuration?)
Go to Line 100 and Line 120 and remove the # signs at the beginning of the line, save and restart browser.



Edited 1 time(s). Last edit at 03/03/2014 07:36PM by siria.

Options: ReplyQuote
Re: javascriptia (long bookmarklets / javascript / userscript from disk)
Posted by: Zero3K
Date: March 03, 2014 10:00PM

Hmm, how about having it remember if AUTO-LOAD is enabled or not?

EDIT: I got the AUTO-LOAD function to work with the script I mentioned. The only issue is that its being injected more than once which is causing its options menu to display more options than it actually has with all of them being unchecked.



Edited 1 time(s). Last edit at 03/04/2014 02:33AM by Zero3K.

Options: ReplyQuote
Re: javascriptia (long bookmarklets / javascript / userscript from disk)
Posted by: Zero3K
Date: March 08, 2014 06:09PM

Any luck on improving the auto load function? Btw, yours is the only macro which can load UserJS into websites that works with the latest beta of K-Meleon 74.

Options: ReplyQuote
Re: javascriptia (long bookmarklets / javascript / userscript from disk)
Posted by: siria
Date: March 08, 2014 06:29PM

Stay tuned... I'll need a beta tester grinning smiley
Oh wll, this looks like turning into one of my 'monster macros' again, want to add this, and then that, and then it gets complicated, and the menus keep growing, and.. and... It's slowly progressing, can now also execute css-files, but the rest will take some more time yet sorry.

Options: ReplyQuote
Re: javascriptia (long bookmarklets / javascript / userscript from disk)
Posted by: siria
Date: March 16, 2014 02:56PM

Finally - almost ready!! At least for a beta stage, my little tests seem to work on KM1.6 and 1.7, that is on win98 of course :cool:
Just a bit rough code cleaning to do yet, then will post my test version, late today or tomorrow evening.

Options: ReplyQuote
Re: javascriptia (long bookmarklets / javascript / userscript from disk)
Posted by: Zero3K
Date: March 21, 2014 03:55AM

Well, where is it?

Options: ReplyQuote
Re: javascriptia (long bookmarklets / javascript / userscript from disk)
Posted by: siria
Date: March 21, 2014 08:53AM

Sorry, still very busy working on it. Always when you think you're finally done, oh well... Couldn't resist adding yet another nice feature, which made me discover yet more bugs, now trying to bugfix those while struggling with KM17 own bugs with injectJS... it's a mess, but keep progressing, slowly.
As we say here: Mühsam ernährt sich das Eichhörnchen - ächz ;-)

Options: ReplyQuote
Re: StyleScriptia v5 (sucessor to javascriptia)
Posted by: siria
Date: March 30, 2014 05:25PM

Baah... thought I'd never get that darn thing finished, it's really turned into a monster macro again, and am long since running out of time!! Kinda stupid idea to create a macro needing avascripts without knowing even basics about that weird language. But at LAST - ready!!

Have renamed it now to StyleScriptia(+Rename), because it can load JS+CSS now and can rename page titles.
All automatically or manually as a user wishes.
Also created some toolbar buttons incl. a special "Flex" one which can change it's function during a session.
And a "Flex" keyboard shortcut too.
Tried to work around the KM1.7 bugs and the flip-page-back double-injection bugs, but only partly successful :-/

Has 3 files now:
StyleScriptia.kmm (main macro)
StyleScriptia_userconfig.kmm (for user rules and other settings)
StyleScriptia_HELP.txt
+ toolbar images.

Please unzip it directly into the KM-folder, or alternatively sort the files manually into the macros folder, and the image into KM/skins/default.

For the beta the userconfig still contains a TON of example rules for testing, more or less silly ones, probably a bit too many for most people, but oh well. And I DID a lot of testing, but the prob is it has grown into a card house, slightly over my own head: changing a tiny bit code at one corner can crumble the whole thing, and not sure if last minute additions may not have affected any older functions again. Anyway, hope it works...

Download the attachment to this post:

Attachments: StyleScriptia_v5.zip (31.6 KB)  
Options: ReplyQuote
Re: StyleScriptia v5 (sucessor to javascriptia)
Posted by: Zero3K
Date: March 30, 2014 09:34PM

The TwitchPlaysPokemon script doesn't work with the latest version of it.

Options: ReplyQuote
Re: StyleScriptia v5 (sucessor to javascriptia)
Posted by: siria
Date: March 31, 2014 08:19AM

Hmm, it should, there's no really fundamental change in injecting JS from files, at least not intentional, except one little thing which can be toggled off in the debug-submenu for testing. Just a but hard to analyze from the distance since I cannot test that specific script myself.

Does it not work only from the userconfig? Because I forgot to adapt your specific folder and filename, oops. Can you please update that yourself in the userconfig.kmm?
$_file="C:\\Program Files\\K-Meleon\\userjs\\chat_filter.user.js"
Then restart the browser and try again.

Or does it also not work if you definitely get the correct path via "Userstyle: File JS" and picking the file manually, what ignores what's in the userconfig?

Does that manual way produce any error popups?
Does the error console say anything and what? (make sure to switch on JS+KMM errors)

If that doesn't help, toggle in the menu "Help+Config>debug>toggle function()" and try again manually (Userstyle: File JS)

Options: ReplyQuote
Re: StyleScriptia v5 (sucessor to javascriptia)
Posted by: siria
Date: August 28, 2014 09:03AM

FINALLY found a solution for that annoying 32kB limit!!
The (minor) catch is that users must simply split their long files on disk, but IMO rather easy using 7z (Start run: 7zFM.exe), navigating it to your scripts folder, then right-clicking on the long files. Or other tools can do it too, or even do it manually without any tools, just make sure the endings of the split files are .001 / .002 / etc.
Will just take a bit yet until the new macro version is finished...

Options: ReplyQuote
Re: StyleScriptia v5 (sucessor to javascriptia)
Posted by: rodocop
Date: August 29, 2014 09:25PM

siria,
the question from Russia (not my own) is: does your current StyleScriptia understand and automatically handle long scripts divided by your method?

Or we need to wait for a new version?

Options: ReplyQuote
Re: StyleScriptia v5 (sucessor to javascriptia)
Posted by: siria
Date: August 30, 2014 12:29AM

No sorry, only the next version. But I'm working at it...

Options: ReplyQuote
Re: StyleScriptia v5 (sucessor to javascriptia)
Posted by: rodocop
Date: August 30, 2014 05:18PM

Thank you for all your efforts! (and for your answer too, of course)

Options: ReplyQuote
Re: StyleScriptia v5 (sucessor to javascriptia)
Posted by: siria
Date: September 03, 2014 09:45PM

sorry nothing new yet, just need to upload the macro editor somewhere hasslefree ;-)

(Size cut in two otherwise too big. For gluing together again use 7z, or the fancy splitter from martinstoeckli.ch, or create a file with those 2 lines as content, name it xy.bat and put into same folder, then doubleclick:
copy /b "editor_scite_kko-modsiria_2013.7z.001" "editor_scite_kko-modsiria_2013.7z"
copy /b "editor_scite_kko-modsiria_2013.7z" + "editor_scite_kko-modsiria_2013.7z.002"

Attachments: editor_scite_kko-modsiria_2013.7z.001 (500 KB)   editor_scite_kko-modsiria_2013.7z.002 (151 KB)  
Options: ReplyQuote
Re: StyleScriptia v5 (sucessor to javascriptia)
Posted by: Zephyr
Date: September 25, 2016 10:09PM

I am having no success with using StyleScriptia v5 with viewtube.user.js and K-Meleon 75 in order to play HTML5 video with a WMP plugin and suitable DS decoders for h264 video and AAC audio. Is Stylescriptia intended to inject any java script into a page, or is it only intended for user styles?

After installing the macro and rebooting I am presented with two items in the Bookmarks menu titled 'Bookmarklet from File...' and the submenu'USERSTYLES (StyleScriptia_Rename)'. The first item will open a box to browse to the location of a user script to be opened. When I open this script with a page for a Youtube video loaded nothing happens, even when I reload the page. The submenu'USERSTYLES (StyleScriptia_Rename)' has an item titled 'User Style: Files JS' which also opens a box to browse to a user script, but again nothing happens. Another item in this submenu is tiled 'User Style: LAST USED which also opens a box to browse to the location of a user script.

There are two buttons on the K-Meleon toolbar which have exactly the same function as the two items in the Bookmarks menu titled 'Bookmarklet from File...' and the submenu'USERSTYLES (StyleScriptia_Rename)'

If I right click on a page with a Youtube video or on a link to a Youtube video I get these same two menu items apparently performing no function.

I despair of using user scripts under K-Meleon, after having tried to install GreaseMonkey and the GreaseMonkey mod by burp to no effect.

Options: ReplyQuote
Re: StyleScriptia v5 (sucessor to javascriptia)
Posted by: siria
Date: September 26, 2016 02:24AM

Quote
Zephyr
I am having no success with using StyleScriptia v5 with viewtube.user.js and K-Meleon 75 in order to play HTML5 video with a WMP plugin and suitable DS decoders for h264 video and AAC audio. Is Stylescriptia intended to inject any java script into a page, or is it only intended for user styles?

Uhh.... it's been awhile, and memory slowly fading, only remember having given up some day on struggling with all that complicated JS headache stuff, at least temporarily, after
- Mozilla decided to STOP the whole "bookmarklet" system in newer versions (but guess other inject-JS methods still worked)
- the early KM7X beta versions had just too many bugs, especially in the macrolanguage plugin, and also Mozilla's new JS prefs getting too complicated for my limited testing possiblity on win98 with live websites....

=> If you're using the old KM75, but are able systemwise to use KM75.1 too, would recommand to install that one parallel and portable, just for testing. Macrowise that was a lot better.
Not sure about KM76 dev-versions, partly improved yet more, especially for using Firefox-addons in KM, on the other hand yet more restricted by the gecko engine in general. Would just try parallel test installations too.

=> there are 2 separate probs in your post: one about userstyles/scripts, but the other about video playing in general. Newer KM/gecko versions have a hundred different prefs for that, it has gotten a real jungle! Do a forum search, and perhaps create a new posting in the general section. Other people than me know a lot more about this subject. Although all of us are struggling mighty with that jungle.

=> Firefoxish addons (*.xpi) are able to modify webpages BEFORE they start loading, which I strongly suspect is needed for this video thing.
But pure KM "macros" can only inject scripts AFTER pages have already fully loaded. So some userscripts may work in KM and others not, depending what they need to do.

=> regarding StyleScriptia, uhm.... was stuck in the middle somewhere with the new version, sorry sad smiley Yes it definitely is meant to use both, userstyles (css) and userscripts (js) alike. Have some unfinished v6-beta version on my disk, never posted, too many unsolved probs yet, and meanwhile have it all forgotten again, that complicated stuff.
Only some day had posted a much smaller alternative, called "StyleonMini". Can't fully remember anymore, both macros are very similar in purpose and methods, but guess that one was also improved codewise. Worth a try, although probably not much hope for this video thing.
And when the newer KM-versions started supporting FF-addons better, all that futile endless macro-js-struggling seemed obsolete anyway, with everyone always requesting only FF-addons like greasemonkey etc. and those starting to work natively in KM too.
But all in all, without own testing possibilities for new KM-versions on live websites, due to old system on internet-machine, cannot go much further with this. And of course, like everyone always lacking enough time, sigh.

Options: ReplyQuote
Re: StyleScriptia v5 (sucessor to javascriptia)
Posted by: Gudzini
Date: June 30, 2018 06:08PM

I cannot download anything from this page sad smiley

P.S. After I post this message a download become possible smiling smiley



Edited 1 time(s). Last edit at 06/30/2018 06:10PM by Gudzini.

Attachments: K-meleon download.png (16.1 KB)  
Options: ReplyQuote


K-Meleon forum is powered by Phorum.