General :  K-Meleon Web Browser Forum
General discussion about K-Meleon 
about Firefox add-ons
Posted by: Deb
Date: September 14, 2014 02:00PM

Good evening.

I have a specific question: is there a way to make the Yahoo Mail Hide Ad Panel add-on for Firefox work on K-Meleon? If so, how? If not, sorry! Thank you for your attention.

Options: ReplyQuote
Re: about Firefox add-ons
Posted by: guenter
Date: September 14, 2014 07:41PM

Quote
Deb
Good evening.

I have a specific question: is there a way to make the Yahoo Mail Hide Ad Panel add-on for Firefox work on K-Meleon? If so, how? If not, sorry! Thank you for your attention.

مساء الخير

No Idea whether it works and I cannot test on the fly because I use BluHell a light weight addblocher that filters most Yahoo Mail Addvertisements.

How 2 test

Get the addon's xpi. You may have to extract / I tried with extracted version.

It installed in that way.

Create folder ./K-Meleon/browser/extensions

Extract xpi to folder: {c37bac34-849a-4d28-be41-549b2c76c64e}

Copy it to ./K-Meleon/browser/extensions/{c37bac34-849a-4d28-be41-549b2c76c64e}

Maybe You can also copy the xpi as it is to the mentioned location.
I merely checked if it does install because some addons do not.

Restart K-Meleon.

Greetings from Germany





p.s. I took some time to check. Guess I should create a dedicated install for for testing addons without my default settings.

The ADDON does not work I have adverts on the right hand bar as soon as I go there without BluHell. sad smiley



Edited 1 time(s). Last edit at 09/14/2014 08:01PM by guenter.

Options: ReplyQuote
Re: about Firefox add-ons
Posted by: siria
Date: September 14, 2014 08:55PM

Have unzipped it, and sounds like the main part for the modern yahoo version is 'just' some css code (hard work of course to first create that code).

I've been wondering for some time if macros are still working in KM74, and lately reading they may "partly" work currently, and the future unsure.
@Guenter, would you mind testing Soni's code with my Styleon or Stylescriptia macro on yahoo??

Save this code as a css file:

#mbAds, #tgtTL1, #theAd, #sb_rel_tgtTL1, #masSearchAd, .sky-ad, #mbRecAds, .adchoices, .adlink, .mb-list-ad, .mb-rec-ad, #slot_TL1, #slot_mbrec, #slot_MB, #mobilizer {
display:none !important;
width:0px !important;
position: absolute !important;
left: -999px !important;
top: -999px !important;
padding: 0px !important;
z-index: -999 !important;
}
#shellcontent {right: 0px !important;}
#main {max-width:none !important;}
#shellnavigation {bottom: inherit !important; }
.attribution-bar {height: 10px !important;}

(Add-on by P.Soni addons.mozilla.org/en-US/firefox/addon/yahoomailhideadpanel/)



Edited 1 time(s). Last edit at 09/14/2014 09:12PM by siria.

Options: ReplyQuote
Re: about Firefox add-ons
Posted by: naruman
Date: September 14, 2014 09:10PM

Quote
Deb
Good evening.

I have a specific question: is there a way to make the Yahoo Mail Hide Ad Panel add-on for Firefox work on K-Meleon? If so, how? If not, sorry! Thank you for your attention.


I haven't Yahoo Mail , so i not sure if this will work or not .

The addon you need contain two main files :
1-Big "bootstrap" file .
2-"userscript" file .

The userscript file have some CSS styles which used to hide the ads .
So you could try the css blocking , and see if it will do the job for you or not .
Adding "the CSS styles" to "Ad-Blocking StyleSheet" & then open the mail .

If the ads disappear , then add the styles to macro for the yahoo mail domain , or use siria user styles .


Look like siria Faster writer than me try what she said.



Edited 1 time(s). Last edit at 09/14/2014 09:15PM by naruman.

Options: ReplyQuote
Re: about Firefox add-ons
Posted by: siria
Date: September 14, 2014 09:19PM

Ah - of course!! Good old KM-Adblock, am using it all the time, but completely forgot about it now, unbelievable...
Okay, am still curious if the macros are working, but apart from that in this specific case adblock.css would suffice completely smiling smiley
Just a line more to add to restrict it to yahoo domain.

Options: ReplyQuote
Re: about Firefox add-ons
Posted by: naruman
Date: September 14, 2014 09:47PM

Quote
siria
Ah - of course!! Good old KM-Adblock, am using it all the time, but completely forgot about it now, unbelievable...
Okay, am still curious if the macros are working, but apart from that in this specific case adblock.css would suffice completely smiling smiley
Just a line more to add to restrict it to yahoo domain.

it's look like it will need more than The good old 'KM-Adblock".
It'll have to inject js code in the pages for the old 'Basic' Yahoo Mail .
this js code (yaoo domain):

var oldYahooMailAds = document.body.getElementsByClassName('with-ads');
if(oldYahooMailAds)
{
var NElement1, hbody;
	hbody = document.body;
	NElement1 = document.createElement('style');
	NElement1.innerHTML = '.mb > .tbl{ display:none !important; width:0px !important; position: absolute !important; left: -999px !important; top: -999px !important; padding: 0px !important; z-index: -999 !important; }';
	hbody.appendChild(NElement1);
	for(i = 0; i < oldYahooMailAds.length; i++)
		oldYahooMailAds.className = oldYahooMailAds.className.replace("with-ads","");
}



Edited 2 time(s). Last edit at 09/14/2014 09:53PM by naruman.

Options: ReplyQuote
Re: about Firefox add-ons
Posted by: siria
Date: September 14, 2014 10:44PM

___________
quote:

for(; i < oldYahooMailAds.length; ++i)
oldYahooMailAds[i].className = oldYahooMailAds[i].className.replace("with-ads","");
}
___________

old tricks don't seem to work anymore, none, grmpf. Okay, brute force with checkmark, but looks like quotes, colors etc. don't work anymore either sad smiley

Options: ReplyQuote
Re: about Firefox add-ons
Posted by: naruman
Date: September 14, 2014 11:33PM

Quote
siria
___________
quote:
for(; i < oldYahooMailAds.length; ++i)
oldYahooMailAds.className = oldYahooMailAds.className.replace("with-ads","");
}
___________
old tricks don't seem to work anymore, none, grmpf. Okay, brute force with checkmark, but looks like quotes, colors etc. don't work anymore either
sad smiley

I'm not fully understand ( no mail to test ) , but what i get that's something went wrong .

Did you use the code above (not the one in the userscript file ) ?

&& [ for(; i < oldYahooMailAds.length; ++i) ] should be
[for(var i=0; i < oldYahooMailAds.length; i++) ].

Options: ReplyQuote
Re: about Firefox add-ons
Posted by: naruman
Date: September 15, 2014 11:00AM

Alright I created a new yahoo mail to see how ads work .
Then i did add simple css code to "Ad-Blocking StyleSheet" , and it seems to be working will .
The ads in both sides has gone , for old & new yahoo mail.

So Deb :

1-Open "Ad-Blocking StyleSheet" [Edit\configuration\Ad-Blocking StyleSheet] .
2-Search for the line :

{
display: none !important;
}

And replace it by :

,iframe[id="tgtSKY"],
iframe[src*="/darla/"],
div[class="darla"],
div[id="fc_align"],
div[id="mb-rec-ad"],
div[id="sb_rel_rightrailad-SKY"],
div[class="left_mb"],
*[class="note adchoices"],
*[class="headline adlink"],
*[class="headline adlink mbtitle"],
img[src*="/ads/"],
img[class="mb-beacon"]
{
display: none !important;width:0px !important;
}

3-Restart Km .
4-Activating it [ Tools\privacy\Block advertisement ] .
5-open yahoo mail & it's better if you clear your cache .



Edited 1 time(s). Last edit at 09/15/2014 11:01AM by naruman.

Options: ReplyQuote
Re: about Firefox add-ons
Posted by: Deb
Date: September 15, 2014 03:06PM

Perfect! Thank you very much,naruman!

Options: ReplyQuote
Re: about Firefox add-ons
Posted by: guenter
Date: September 15, 2014 04:05PM

Quote
naruman
Alright I created a new yahoo mail to see how ads work .
Then i did add simple css code to "Ad-Blocking StyleSheet" , and it seems to be working will .
The ads in both sides has gone , for old & new yahoo mail.

So Deb :

1-Open "Ad-Blocking StyleSheet" [Edit\configuration\Ad-Blocking StyleSheet] .
2-Search for the line :

{
display: none !important;
}

And replace it by :

,iframe[id="tgtSKY"],
iframe[src*="/darla/"],
div[class="darla"],
div[id="fc_align"],
div[id="mb-rec-ad"],
div[id="sb_rel_rightrailad-SKY"],
div[class="left_mb"],
*[class="note adchoices"],
*[class="headline adlink"],
*[class="headline adlink mbtitle"],
img[src*="/ads/"],
img[class="mb-beacon"]
{
display: none !important;width:0px !important;
}

3-Restart Km .
4-Activating it [ Tools\privacy\Block advertisement ] .
5-open yahoo mail & it's better if you clear your cache .

Sorry You three. I was away from keys for the day.

naruman, great and so few lines of code!

Maybe also submit to Dorian @ Annoucements or mail?
Maybe have this inside "Block advertisement"CSS as default?

Thank all for posting and for reading my posts.

السلام عليكم

Options: ReplyQuote
Re: about Firefox add-ons
Posted by: naruman
Date: September 15, 2014 06:07PM

Quote
guenter
Maybe also submit to Dorian @ Annoucements or mail?
Maybe have this inside "Block advertisement"CSS as default?

The CSS blocking for any site is not the big thing , i had used it for some of my local sites for years .

However how much it will stay , depend on the site update rate (changing elements or paths .... ) .

So set it as default , will not stand so long (for yahoo) , but it could be used till the next update in yahoo .

Options: ReplyQuote
Re: about Firefox add-ons
Posted by: guenter
Date: September 15, 2014 07:33PM

Quote
naruman
Quote
guenter
Maybe also submit to Dorian @ Annoucements or mail?
Maybe have this inside "Block advertisement"CSS as default?

The CSS blocking for any site is not the big thing , i had used it for some of my local sites for years .

However how much it will stay , depend on the site update rate (changing elements or paths .... ) .

So set it as default , will not stand so long (for yahoo) , but it could be used till the next update in yahoo .

مساء الخير


For some sites and users it is a big thing.

And Yahoo Mail Page is somthing special - for the past 10 or 11 years it was a FAQ in most years. Bugs ranged from: Your browser is not compatible, outdated to sending K-Meleon users to an IE page with a faulty brower switch. And last not least bugging us all these years to switch to another browser if we wanted to get service. sad smiley

I created my Yahoo mail account for exactly the same reason as You.

To give end-user support.

p.s. If it stands so long that the next K-Meleon update is out - it prevents a FAQ.



Edited 1 time(s). Last edit at 09/15/2014 07:41PM by guenter.

Options: ReplyQuote
Re: about Firefox add-ons
Posted by: siria
Date: September 15, 2014 08:39PM

But the FAQ-probs usually were not about ad-blocking, but not getting access. That's a whole different thing and won't help those probs. But the newer gecko engine will help a LOT :-)

But since we're talking now about our (still!! smiling smiley) good-old-KM-adblock, I'd like to take the opportunity to advertise ;-) a general trick, that's probably not yet widely known among users. Because it is sometimes necessary to restrict such a block to a certain website, in case the ad-names are too general. Of course, something like "adlink" is pretty much safe to use on all sites, but something like "left_mb" might also be used by another site for important page content.

And in other cases I just abuse the adblock.css as a nomal user-stylesheet, because only adblock could be toggled during a session. That may have meanwhile changed, but anyway - this is just handy very often and I love it!
And of course this trick can be used in all css-stylesheets, not only adblock.

This is not necessary in THIS case, but anyway just as example how a rule can be restricted to a domain (or to a url-prefix(xy) ), and how one can add some comments etc.:

Quote

/* =========== YAHOO MAIL Sep-2014 ========
example text... aosigadsopg .... write what you want between the * *
from: addons.mozilla.org/en-US/firefox/addon/yahoomailhideadpanel/
*/

@-moz-document domain(yahoo.com) {
#mbAds, #tgtTL1, #theAd, #sb_rel_tgtTL1, #masSearchAd, .sky-ad, #mbRecAds, .adchoices, .adlink, .mb-list-ad, .mb-rec-ad, #slot_TL1, #slot_mbrec, #slot_MB, #mobilizer,
.mb > .tbl {
display:none !important;
width:0px !important;
position: absolute !important;
left: -999px !important;
top: -999px !important;
padding: 0px !important;
z-index: -999 !important;
}
#shellcontent {right: 0px !important;}
#main {max-width:none !important;}
#shellnavigation {bottom: inherit !important; }
.attribution-bar {
height: 10px !important;
}
}



Edited 2 time(s). Last edit at 09/15/2014 08:44PM by siria.

Options: ReplyQuote
Re: about Firefox add-ons
Posted by: naruman
Date: September 15, 2014 09:57PM

Quote
siria

This is not necessary in THIS case, but anyway just as example how a rule can be restricted to a domain (or to a url-prefix(xy) ), and how one can add some comments etc.:

@-moz-document domain(yahoo.com) {
}


Good catch siria , (@-moz-document ) is powerful css rule .

Also it look like it can get any url .

Ex :

@document url(http://www.yahoo.com/ad/adpage.html),
url-prefix(http://www.mail.),
domain(yahoo.com),
regexp("^(?!http://www\\.mail\\.com).*"){

CSS code

}

As :

URL: full URL you want to affect, including protocol.

url-prefix:contain the start of URLs you want, including protocol.

domain:domain name, without protocol.

regexp:regular expression which will be tested against the entire URL.

So i think the css block for Basic & modern yahoo mail will be :

@-moz-document domain(yimg.com) {
div[id="fc_align"]
{
display: none !important;width:0px !important;
}
}

@-moz-document domain(yahoo.com) {
,iframe[id="tgtSKY"],
iframe[src*="/darla/"],
div[class="darla"],
div[id="fc_align"],
div[id="mb-rec-ad"],
div[id="sb_rel_rightrailad-SKY"],
div[class="left_mb"],
*[class="note adchoices"],
*[class="headline adlink"],
*[class="headline adlink mbtitle"],
img[src*="/ads/"],
img[class="mb-beacon"]
{
display: none !important;width:0px !important;
}
}


just Copy/Paste it in Empty place in the end of "Ad-Blocking StyleSheet".



Edited 2 time(s). Last edit at 09/15/2014 10:17PM by naruman.

Options: ReplyQuote
Re: about Firefox add-ons
Posted by: siria
Date: September 22, 2014 09:31PM

I've been looking for something with wildcards, without success, but your regexp sounds promising. The prob is that regexps have always been marsian to me, and still are, shudder.

What string would be needed to check for e.g. xxx.*.examplesite.com/forum/... ?

Options: ReplyQuote
Re: about Firefox add-ons
Posted by: fred from nl
Date: September 23, 2014 03:12PM

I think in general this should work:
replace . by \.
replace ? by .
replace * by .*

to match a real dot you have to escape it like in \.
. matches any character like dos ?
* matches zero or more of the preceding character so use .* like dos *

So xxx.*.examplesite.com/forum should be like: xxx\..*\.examplesite.com/forum

You can try it here:
http://regexpal.com/
http://regex101.com/

Options: ReplyQuote
Re: about Firefox add-ons
Posted by: naruman
Date: September 23, 2014 04:34PM

Quote
siria
I've been looking for something with wildcards, without success, but your regexp sounds promising. The prob is that regexps have always been marsian to me, and still are, shudder.

What string would be needed to check for e.g. xxx.*.examplesite.com/forum/... ?

If you need to check some links :
http://www.examplesite.com/forum/....
simple css regexp:
@-moz-document regexp('http://www\\.examplesite\\.com/forum/.*') {
/*
that work on URLs :
http://www.examplesite.com/forum/
http://www.examplesite.com/forum/........
*/
}
Also some thing like that can be useful:

@-moz-document regexp('^(http|https)://www\\.examplesite\\.(com|org)/forum/.*') {
/*
work on URLs :
http://www.examplesite.com/forum/....
https://www.examplesite.com/forum/....
http://www.examplesite.org/forum/....
https://www.examplesite.org/forum/....
*/
}
Anyway check this links for more about RegExp :
w3schools
Developer mozilla


Edte: You should notes there some different between js &css regexps Like js (\.) & css(\\. ) .



Edited 3 time(s). Last edit at 09/23/2014 04:48PM by naruman.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.