Extensions :  K-Meleon Web Browser Forum
All about K-Meleon extensions. 
YesScript 2.1 (extension 1.12)
Posted by: JohnHell
Date: April 18, 2016 01:16AM

YesScript extension macro to make YesScript Firefox add-on compatible with K-meleon.


For installation steps and other details, read Readme.txt file.


For further details related to YesScript itself, read the file README.md inside yesscript folder.

2016-04-19 v 1.12

- title parsing fix
- titleless pages will show the url after the indicator
- Readme.txt update.

2016-04-19 v 1.11

- minor fix to title checks
- Readme.txt updated to show how to deal with favourites/bookmarks.

2016-04-19 v 1.1

- added configuration capabilities to set custom title text indicator for blacklisted domains.

To update overwrite the yesscript.kmm file.

2016-04-18 v 1.0



Edited 8 time(s). Last edit at 04/22/2016 11:45PM by JohnHell.

Attachments: YesScript 2.1_1.12.zip (59.4 KB)  
Options: ReplyQuote
Re: YesScript 2.1 (extension 1.0)
Posted by: anontemp123
Date: April 18, 2016 09:12PM

Can't thank you enough. Works very well for me. In a sense, even more correct than Firefox because in Firefox I can add about:blank to the blacklist.

I tried looking at setbuttonimg code in the ABP macro but it's all very confusing to me.

How does InjectJS work if YesScript has disabled JavaScript?

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.0)
Posted by: JohnHell
Date: April 18, 2016 09:45PM

Quote
anontemp123
Can't thank you enough. Works very well for me. In a sense, even more correct than Firefox because in Firefox I can add about:blank to the blacklist.

That was luck. I followed my coding based on its readme.

Looks like he doesn't, so a bug to report to him.

Quote
anontemp123
I tried looking at setbuttonimg code in the ABP macro but it's all very confusing to me.

As I said, here won't have sense. With tabbed we don't have control to dynamically change the icon correctly.

Quote
anontemp123
How does InjectJS work if YesScript has disabled JavaScript?

The same way add-ons are working in Firefox when you disable JavaScript. The inners of the Gecko browsers aren't affected by the pref, so the call of it from the macro is being executed.

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.0)
Posted by: anontemp123
Date: April 18, 2016 10:22PM

Quote
JohnHell

Quote
anontemp123
I tried looking at setbuttonimg code in the ABP macro but it's all very confusing to me.

As I said, here won't have sense. With tabbed we don't have control to dynamically change the icon correctly.

You mean the KM macro language doesn't have a way to control that, right?

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.0)
Posted by: JohnHell
Date: April 18, 2016 10:34PM

Yes, to macro language.

It has, but not when in tabbed browsing settings.

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.0)
Posted by: JohnHell
Date: April 19, 2016 12:05AM

Extension updated.

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.0)
Posted by: siria
Date: April 19, 2016 01:02AM

Thank you John. Also for the update smiling smiley

Quote
anontemp123
Quote
JohnHell
As I said, here won't have sense. With tabbed we don't have control to dynamically change the icon correctly.

You mean the KM macro language doesn't have a way to control that, right?

Just to explain more in detail, macros are able to change button images, but the prob is: the command for it must be fired each time. This can be done automatically only at certain "events". For example "$OnLoad", which fires a list of autorun-macros every time a page has finished loading. Or "$OnActivateWindow", which fires when switching from one open window to another. Guess you know this from javascript. But there is no event yet "$OnActivateTAB" in macrolanguage. So when a WINDOW has several TABs open and the user switches between them, inside the same window, there is no way to have an automatic action fired and the button doesn't get updated.
Menus with checkmarks are easier in that regard, they get updated each time automatically.

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.0)
Posted by: JohnHell
Date: April 19, 2016 03:09PM

Updated.

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.0)
Posted by: JohnHell
Date: April 22, 2016 08:31PM


The first one is fixable.

And the error brings the reason that I don't like to place JavaScript code directly in a macro file. Sometimes is just absolutely crazy to escape characters.

I think this macro will be the last one. And, for this, if more errors come from parsing, I'll distribute with an independent JS file.

The second one, a quote from the Readme of the macro (not YesScript):
Quote

5. Known issues
---------------

- titleless pages may not dynamically update the title correctly when whitelisting, but doesn't affect to the process.

In this case, the page doesn't have a title. If webmasters out there don't follow the most basic HTML coding guidelines, what can I do?

I could set the title with blacklisting indicator and the url (as it is displayed when not blacklisted), but, I didn't find it..., lets say elegant.

If you prefer, I can set, when blacklisted, the indicator and the url. But you are not missing or gaining anything. The page continues without having title.

In fact, when someone re-blacklists the site, it is double indicated. Why? Because I created a title tag, what was originally missing.

Tell me what do you prefer with this to avoid two different uploads (the first fix it is already done).



Edited 1 time(s). Last edit at 04/22/2016 08:34PM by JohnHell.

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.0)
Posted by: siria
Date: April 22, 2016 09:32PM

Quote
JohnHell
And the error brings the reason that I don't like to place JavaScript code directly in a macro file. Sometimes is just absolutely crazy to escape characters.

Oh yeah I know, but in *this* case just wonder again if macrolanguage wouldn't be a lot simpler as javascript ($TITLE=$_yesscript_titleinfo.$TITLE etc., similar for checking)
$TITLE is dynamic and overwritable. When modifying the title by JS, doesn't $TITLE autochange too? 99% sure ;-)

And/or perhaps a dashed red/green css-border could be tested. Have it in the old jssitelist macro, just a few lines, could copy here if you like.

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.0)
Posted by: JohnHell
Date: April 22, 2016 09:52PM

Ok, I see now how it works now.

When I said in the past you are in macro coding beyond me, it is because it is the truth.

I think I misunderstood the $TITLE overwrite features. Not documented :/

Ok, set $TITLE, discarded injectJS.

EDIT: still would like to know what to do with titleless pages.



Edited 1 time(s). Last edit at 04/22/2016 09:53PM by JohnHell.

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.0)
Posted by: anontemp123
Date: April 22, 2016 11:07PM

I completely forgot about the comment in the README. I would prefer you just leave titleless pages as they are. Even the other thing, I was just pointing it out because you seem like a perfectionist.

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.0)
Posted by: JohnHell
Date: April 22, 2016 11:22PM

I think I would finally add the url. It is ugly, but :/ is "as they are".



No, the other thing was actually a bug xD or a mix of things. Parsing problems between JavaScript and macro code. When used together causes these things.

It is not perfectionism, its bugfix winking smiley. For this and other things it is this thread for winking smiley

In the other hand the less problems for those used to this add-on coming from Firefox, the best for K-meleon xDDD

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.12)
Posted by: JohnHell
Date: April 22, 2016 11:46PM

Updated 1.12

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.12)
Posted by: anontemp123
Date: April 23, 2016 12:41AM

Odd behavior: title bar shows indicator, but tab bar does not. Was not like this before.

Edit: Looks like can't "fix" it without InjectJS. Better (less hacky) the way it is now. I say just leave it.



Edited 2 time(s). Last edit at 04/23/2016 12:43AM by anontemp123.

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.12)
Posted by: JohnHell
Date: April 23, 2016 01:24AM



I see. Thanks for reporting.

I didn't expect that happening to TABs . Awesome. (I know, I know, I didn't test it (signed, that last man standing using windows instead tabs)).

Lets see the bright side of this. Siria's complain/suggestion that the title shown in the tabbar was covered by the indicator, has been fixed Success.

Let me LOL a lot.

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.12)
Posted by: siria
Date: April 23, 2016 05:50AM

Yeah would be perfect, but sadly is useless, because even the window title is lost again when switching tabs. Grmpf.

But that's what I meant with "99%"... it needs more testing to be really sure :cool: And often probs also depend from the KM version.

Anyway - ARGH!! tongue sticking out smiley grinning smiley I did dimly remember some prob about window titles and tab titles awhile ago, but was hoping that was only in some older 74 or 75beta- version! Actually had done a quick check with my very first suggestion for injectJS (d.title=...) to be sure that worked in tabs too, at least in current stable KM75.1. Also have been using that ultrashort way in other macros long since, e.g. in testJS.kmm.

Perhaps try this again, without all that complicated header-juggling? "In theory" this should work for problematic titles too :cool:
$_code="document.title='".$_yesscript_titleinfo."'+document.title;";
injectJS($_code);
Or perhaps for a better chance in various KM-versions:
$_code="(function (){document.title='".$_yesscript_titleinfo."'+document.title;})();";

That said, would still like a dashed css color stripe best, although that may have probs in certain pages too...

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.12)
Posted by: JohnHell
Date: April 23, 2016 03:25PM

Doing that will be going back to 1.11 again.

More code, less code, it is the same.

Mine to be more compliant (with that header-juggling (that is not)), yours less.

The CSS border has the same issues. How thick? (not all screens are equally large), do I create a responsive CSS to deal with this? (which doesn't work for all K-meleon versions), what color would be best?, do I set a preference for this?, do I set preferences for this an for title display options user choice?, wasn't the tab titles an annoyance with the indicator?

We will go into an endless path.

Look how far we went just because we couldn't mimic the toolbar button change because of how tabbed browsing works in K-meleon. When the original thread started I thought it would be possible because I didn't thought of tabbed browsing annoyance. And also, look how tabbed browsing has became a problem, after all.

We can do everything, and, still, wouldn't be the same as the original Firefox Add-on.

That's the reason I wanted for opinions before start coding.

But this thread is open to ideas. Throw them here and I will implement or not. Or create a new version and I append to the first post. The extension is open for development to anyone, not only me smiling smiley

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.12)
Posted by: cpm1a_new
Date: August 25, 2019 08:19AM

i need WHITELIST and i can't get to it: Tools-->Privacy-->Permissions -->YesScript-->Blacklist/Whitelist--> it just won't open...



Edited 2 time(s). Last edit at 08/25/2019 04:22PM by cpm1a_new.

Options: ReplyQuote
Re: YesScript 2.1 (extension 1.12)
Posted by: JohnHell
Date: August 25, 2019 05:07PM

Quote
cpm1a_new
i need WHITELIST and i can't get to it: Tools-->Privacy-->Permissions -->YesScript-->Blacklist/Whitelist--> it just won't open...

Because it doesn't open anything Just checks whether the site must be blacklisted or whitelisted.

What do you think might be the "YesScript blacklist manager" menu entry for?

Options: ReplyQuote


K-Meleon forum is powered by Phorum.