Extensions :  K-Meleon Web Browser Forum
All about K-Meleon extensions. 
Priv3Buttons: 3-state-toggle for privacy + bandwidth BUTTONS (v2)
Posted by: siria
Date: September 25, 2015 11:46PM



This allows triple-toggles on some privacy & bandwidth-buttons:
All blocked (red) / Site allowed (green-red) / All allowed (green)

By default this macro creates an own toolbar "Priv3", but you can edit the kmm-file with a Notepad to customize everything:
buttons in 3 sizes, or show less buttons, or more if you create them yourself (by copying another), or re-order them.

Currently the 7 buttons toggle those native Mozilla prefs:

"network.cookie.cookieBehavior"
"permissions.default.image"
"permissions.default.subdocument"
"permissions.default.stylesheet"
"permissions.default.script" + "javascript.enabled"
"permissions.default.object"
"permissions.default.media"

K-Meleon version: 1.6 or newer, probably 1.5 too

UPDATE VERSION-2: (2015-09-27)
- javascript: toggles now 2 prefs at once: for JS in general and for js-files
- Buttons in 3 sizes, for better readability on different screens
- added own menu with info links etc.: right-click on buttons
UPDATE VERSION-2.1: (2015-09-28)
- bugfix

Installation as usual:
Unzip the attached 7z into the K-Meleon program folder (drops the kmm-macro into macros folder, the images into K-Meleon/skins/default)



Edited 5 time(s). Last edit at 09/28/2015 05:46PM by siria.

Attachments: priv3buttons_screen.png (24.3 KB)   priv3buttons_v2.1_.7z (7.9 KB)  
Options: ReplyQuote
Re: priv3buttons: 3-state-toggle for privacy + bandwidth BUTTONS
Posted by: rodocop
Date: September 26, 2015 04:50AM

Just amazing thing!

Siria, you're Great Master of KM-stuff!

I'm going to try this today!

Options: ReplyQuote
Re: priv3buttons: 3-state-toggle for privacy + bandwidth BUTTONS
Posted by: siria
Date: September 26, 2015 01:52PM

Oops - the not-so great master had the skin pics in the wrong 7z-folder, in "skins" not "skins/default"! grinning smiley
Experienced users probably noticed, others please re-download.
Have exchanged it in first post.

Thank you rodocop! smiling smiley
(Although my skills rather match those of a kid in 2nd school year, knowing to read and write but only basic stuff, as every look at the native KM macros shows me :coolsmiling smiley

Options: ReplyQuote
Re: priv3buttons: 3-state-toggle for privacy + bandwidth BUTTONS
Posted by: rodocop
Date: September 27, 2015 11:29AM

I'm from kindergarten!

Options: ReplyQuote
Re: priv3buttons: 3-state-toggle for privacy + bandwidth BUTTONS
Posted by: siria
Date: September 27, 2015 01:20PM

Perhaps in macro-class. But instead you and others are in College class for this way more complicated ADDON stuff and system stuff and all that other computer science stuff, which is far beyond my own limited talents, being only able to handle this simplified macrolanguage grinning smiley Still find it too funny, but great we have such a diverse knowledge pool!

Regarding this macro, am already working on an update. Have tried to offer alternative text buttons for better readability, but found they are wasting too much precious space in current KM version. Will now add bigger "painted" buttons for high resolution monitors, and a little menu...

Options: ReplyQuote
Re: priv3buttons: 3-state-toggle for privacy + bandwidth BUTTONS
Posted by: siria
Date: September 27, 2015 11:54PM

New version v2, see first post smiling smiley

Options: ReplyQuote
Re: priv3buttons: 3-state-toggle for privacy + bandwidth BUTTONS
Posted by: fred from nl
Date: September 28, 2015 03:21PM

Hello Siria,

I copied the files over the version 1 but after that I don't see your privacy bar.
Your first version did work (after moving the images as described).
If I copy the version 1 Priv3Buttons.kmm back then that works but not version 2.
Version 2 Priv3Buttons.kmm had UTF-8+signature, saving it as UTF-8 did not change.
I don't see a Priv3Buttons Toolbar in menu View, Toolbars.
What do I wrong or what should I test?

Fred

Options: ReplyQuote
Re: priv3buttons: 3-state-toggle for privacy + bandwidth BUTTONS
Posted by: siria
Date: September 28, 2015 05:59PM

Oops... my fault, sorry!!

I do test my macros a lot before posting, but looks like after fiddling all the time and testing all the time had now forgotten to test the tiny last-minute change too! One little glitch in the kmm and the toolbar was broken.
==> Please download again, v2.1 is fixed.
PS the 3 pics from version-1 can be deleted, those without a size number after the name.

Thanks for telling, Fred smiling smiley
Just as tip to save your time, the error-console (in menu Tools, or button in Toolbar "javascript console") is extremely helpful, it detects most syntax errors in macros and tells which line. But KMM-errors must be switched on first, by default they are hidden (@Dorian: please enable KMM by default too?)



(sig) New unofficial K-Meleon 76.4 (KMG76.4) available, in own subforum.
Based on Goanna engine, called 'test' builds forever but more stable as 75.1 acc. forum members. It's 1-2 generations ahead of predecessor KM76RC-2016
K-Meleon FAQ (link missing in forum sidebar)
Tips&Tricks - Learning new stuff every day
New to K-Meleon? What do you like? What not?



Edited 1 time(s). Last edit at 09/28/2015 06:04PM by siria.

Options: ReplyQuote
Re: priv3buttons: 3-state-toggle for privacy + bandwidth BUTTONS
Posted by: fred from nl
Date: September 30, 2015 08:51AM

v2.1 works, thanks smiling smiley
A bit late, made the message yesterday but forgot to post it :mad:
I know a little about programming but it always takes more time to look into others work :cool:
The one of the images was easy to find but I have never looked into the macro language and I was sure you could find it faster then I would grinning smiley
Never played with error-console before but who knows, might be a way to write something myself.
In the past I have helped others testing/debugging software smiling smiley

Options: ReplyQuote
Re: priv3buttons: 3-state-toggle for privacy + bandwidth BUTTONS
Posted by: siria
Date: September 30, 2015 09:51AM

Thanks for confirmation, was starting to wonder smiling smiley
Yes I still remember you made KM variations in the past, and certainly know a lot about it.

The Error Console really is a life-saver, to coders and to clueless newbies alike, it can give precious infos WHAT may cause a bug (or what not). Would be completely lost without it.
The one problem with it is its misleading name!!
In my first years with KM, when I saw that function named "JAVASCRIPT console" in the default skin toolbars.cfg, had immediately dismissed it as "no use for me, that's for JS developers only, just hide it"! Then never looked back and completely forgot this precious button, even when years later posting my elaborated classiria skin. Of course had re-discovered the "error-console" after a while, but the BUTTON - still forgotten it ever existed. Until just recently, incredible. Too bad, really could have used it all those years.



(sig) New unofficial K-Meleon 76.4 (KMG76.4) available, in own subforum.
Based on Goanna engine, called 'test' builds forever but more stable as 75.1 acc. forum members. It's 1-2 generations ahead of predecessor KM76RC-2016
K-Meleon FAQ (link missing in forum sidebar)
Tips&Tricks - Learning new stuff every day
New to K-Meleon? What do you like? What not?

Options: ReplyQuote
Re: priv3buttons: 3-state-toggle for privacy + bandwidth BUTTONS
Posted by: siria
Date: August 02, 2018 06:58AM

https://dxr.mozilla.org/mozilla-beta/source/extensions/cookie/nsPermissionManager.cpp

Quote

// NOTE: These permissions are the different nsContentBlocker permissions for
// allowing or denying certain content types from being loaded. Every
// permission listed in the `kTypeString` array in nsContentBlocker.cpp should
// appear in this list.
"other",
"script",
"image",
"stylesheet",
"object",
"document",
"subdocument",
"refresh",
"xbl",
"ping",
"xmlhttprequest",
"objectsubrequest",
"dtd",
"font",
"media",
"websocket",
"csp_report",
"xslt",
"beacon",
"fetch",
"image",
"manifest",
"speculative",

Quite a list, in modern Firefox meanwhile 23 blockable types!
Am wondering if those only work for site exceptions (in permissions.sqlite), or perhaps as global default prefs too, like that?
permissions.default.xxx (INT) 1,2,3
Or perhaps some do, and others only understand true/false?

No idea, but if anyone feels like testing, those prefs can simply be added manually in about:config too.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.