MozillaZine

BugMeNot Improved

Talk about add-ons and extension development.
jacksmernov
 
Posts: 84
Joined: July 29th, 2004, 7:54 pm

Post Posted August 5th, 2004, 3:27 pm

well.. i ya know... i need a new site to upload files to. It's confusing to people to have to rename a zip file to an xpi file, espectialy when an xpi file works as a zip file. It's vary easy to just open it as a zip file and see all the files in it and showt. "Good God it's chickan monkey wombat weasle!!!"

Anyrate. let me know how it goes

AnonEmoose
 
Posts: 2031
Joined: February 6th, 2004, 11:59 am

Post Posted August 6th, 2004, 9:55 am

jacksmernov wrote:I found a bug that is on the scale of having the extension not work on new installs.

http://www.geocities.com/jacksmernov/bu ... index.html

For those of us who installed the ealier versions like myself and roachfiend, I preference called BugMeNot_LastLocation was saved and every time we opend up our browsers that preference would be avaliable to the BugMeNot Extension.
I wish I had seen your post earlier as i could have saved u all that trouble...
i got around the issue by adding a folder "default/preferences" containing a *.js with the default pref, to the xpi package (not in the jar)
...
Now when u install, the folder "default/preferences" with the pref file gets copied and u therefore u now have a default pref.... hence, no need to check if pref exists, only need to check it's value...

the added benefit to this, is that upon uninstall it will delete the pref too instead of leaving it behind....

.

bgm
 
Posts: 25
Joined: August 8th, 2004, 12:02 am

Post Posted August 8th, 2004, 12:09 am

As the operator of bugmenot let me just say you are all doing a wonderful job.

To help out with testing here are the top 25 requested sited on bugmenot:

http://www.nytimes.com
http://www.washingtonpost.com
http://www.latimes.com
http://www.ajc.com
http://www.chicagotribune.com
http://washingtonpost.com
http://nytimes.com
http://www.dallasnews.com
http://registration.realcities.com
http://latimes.com
http://ajc.com
http://www.iltalehti.fi
http://chicagotribune.com
http://WWW.CNN.COM
http://www.yahoo.com
http://www.jsonline.com
http://www.philly.com
http://www.mercurynews.com
http://www.fileplanet.com
http://www.ctnow.com
http://www.miami.com
http://www.timesonline.co.uk
http://www.experts-exchange.com
http://www.orlandosentinel.com
http://www.gamespot.com

I've also found two issues:

1. Go to the bugmenot home page and do a search for a site and the browser window will close. I assume this is the plugin misbehaving.

2. All the text in the popup window gets selected.

If there is anything I can do on the server-side then let me know. Keep in mind that I don't want to make account information too available as sites could disable them automatically then.

Regards,
bugmenot.com

wormeyman

User avatar
 
Posts: 344
Joined: October 17th, 2003, 11:17 pm
Location: Somewhere starting browser wars.

Post Posted August 8th, 2004, 12:30 am

hey it works with fileplanet.com :D Image

ieremiou

User avatar
 
Posts: 637
Joined: July 20th, 2004, 3:21 pm
Location: Brooklyn, NYC

Post Posted August 8th, 2004, 10:57 am

hey bgm, sweet to have you join us. :)
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a1) Gecko/20050922 Firefox/1.6a1 - Build ID: 2005092210

jacksmernov
 
Posts: 84
Joined: July 29th, 2004, 7:54 pm

Post Posted August 8th, 2004, 1:01 pm

get the latest version here atleast until roachfiend can update his site

http://www.geocities.com/jacksmernov/bu ... index.html

Fixed it so that when using bugmenot from http://bugmenot.com/index.php it no longer closes the window.

Regarding the page being selected. That's just the way I get the username info from the bugmenot window. I originaly was going to search through the page source to do it, but while trying to figure out how to do that I saw this

<!-- Dont bother: this changes often. Besides, shouldnt you be using your powers for the forces of good? -->

I also saw a bunch of junk tags around the username and password

<dt>Account #1</dt>
<dd>gstra<span class="cTCeHVLP6iOk2YK">u</span>b<br />ebanista</dd></dl>

Rather then try to ignore the tags and such, which would change from tiem to time. I just selected the page and got the text of the selection, giving me a clean copy of the page with no html tags.

However, i realized that it's a cosmetic bug to have it leave the page selected like that. So I added some code so that after geting the selected text, it sets the selection to nothing using

window._content.__proto__.getSelection.call(window._content).collapseToStart();

I also tweeked the code that auto fills the form. It had been messing up when a page uses frames but dosn't use frames, if you know what I mean (bunghole html authors). So now it works with cnn.com and the like

Lastly. I changed the names of the prefs so that they appere under bugmenot.VariableName instead of BugMeNotVariableName. It looks prittier when you view the variables in about:config.

rue
 
Posts: 673
Joined: June 10th, 2003, 2:20 pm

Post Posted August 8th, 2004, 1:13 pm

jacksmernov:
nsISelection is just a front-end to the <a href="http://www.w3.org/TR/DOM-Level-2-Traversal-Range/ranges.html">range-object</a>, which you can use directly without having to clean-up (selection-wise) afterwards.

jacksmernov
 
Posts: 84
Joined: July 29th, 2004, 7:54 pm

Post Posted August 8th, 2004, 1:14 pm

bgm. I played with each of the tops sites they pritty much all work. Well, one of them, http://www.jsonline.com/ did not have a login in the bugmenot database for the login page at https://secure.jsi-service.com/ecommver ... tentry.asp

So Chickan. this build is looking good.

http://www.geocities.com/jacksmernov/bu ... index.html

bgm
 
Posts: 25
Joined: August 8th, 2004, 12:02 am

Post Posted August 9th, 2004, 4:10 am

Working amazingly well; I'm impressed. People are going to love it I'm sure.

jacksmernov wrote:Regarding the page being selected. That's just the way I get the username info from the bugmenot window. I originaly was going to search through the page source to do it, but while trying to figure out how to do that I saw this

<!-- Dont bother: this changes often. Besides, shouldnt you be using your powers for the forces of good? -->

I also saw a bunch of junk tags around the username and password


This was due to paranoia about sites spidering bugmenot and auto-disabling the accounts. I'm now officially deciding not to obfuscate the HTML output- rather I'll be proactive with the logs and banning IPs. I've removed all this junk now.

Let me know if there is a better way of providing the accounts. XML or something?

Thanks everyone!

bgm
 
Posts: 25
Joined: August 8th, 2004, 12:02 am

Post Posted August 9th, 2004, 4:15 am

Hey, anyone see any prob with submitting the form too? Or am I pushing my luck here ;)

jacksmernov
 
Posts: 84
Joined: July 29th, 2004, 7:54 pm

Post Posted August 9th, 2004, 10:38 am

Well since we already have this thing working, i don't see any reason to change anything on your part. The obfuscation you had was so easy to defeit as to be almost pointless so that can go. I suppose if your planing on changing the apperence of the page often or whatever, it would be nice to add some xml to the page to make it more robust. But otherwize try to keep things the same so as not to break anything.

Auto submitting the form gets tricky. Some sites have more then one form on the page, and worce some sites more then one form one the page with username and password feilds (like nytimes). But i suppose these are sermountable issues.

What I hate is that when you try to auto submit a form you have to use the form name like

document.forms.myform.submit();

It would be so much easer for me if you could do

document.forms[2].submit();

and you should be able to. but it never works.

This really sucks for forms without the name or id attribute.

But i can get around this by doing this

document.forms[2].name = 'chickan';
document.forms.chickan.submit();

Does anyone know a better way to do this?

So I can probably do the autosubmit. But I'd want to be able to turn it on and off. I'd have to implement an options page and crap... I'd also want to propt the user the first time to turn autosubmit on or off.

So for lack of anything better to do today. I'll play with it. In the mean time, enjoy the bugmenot mouse gesture

<a href="mozgest://addmapping/window/U3131/custom/Bug%20Me%20Not/try%7Bdocument.getElementById('bugmenot').doCommand()%3B%7Dcatch(er)%7B%7D/">Bug Me Not (U3131)</a>

jacksmernov
 
Posts: 84
Joined: July 29th, 2004, 7:54 pm

Post Posted August 10th, 2004, 5:17 pm

http://www.geocities.com/jacksmernov/bu ... index.html

I added an options box to alow the user to enable/disable auto fill, auto close, and auto submit(not yet implemented)

---

Another important change was something roachfiend wanted to do to save real astate. Instead of the bugmenot menu item showing up in almost all contexts. It now only shows up if you right click on a text feild.

I also changed it so that bugmenot menu item comes after select all instead of showing up above undo (which was really ugly).

---

I also canged it so that bugmenot loads it's preferences with a file in the defaults/preferences folder. Like AnonEmoose mentioned, this is supose to make is so that the preferences get deleated if you uninstall bugmenot. However I noticed that it only gets rid of the preferences that have not been changed. Is this my fault AnonEmoose?

var bugmenotPrefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("bugmenot.");

bugmenotPrefs.setCharPref("LastLocation", BugMeNot_LastLocation);

Is how i go about sting preferneces. Is there something I'm doing wrong?

---

If you've been falowing along, unziping and looking inside, and rebuilding. You might have been using roachfiend's build.bat file. Since i added a directory to bugmenot I had to change his build.bat.

set x=%cd%
md build\chrome
cd chrome
7z a -tzip %x%.jar * -r -mx=0
move %x%.jar ..\build\chrome
cd ..
copy *.rdf build
copy *.js build
xcopy /S defaults build\defaults\
cd build
7z a -tzip %x%.xpi * -r -mx=9
move %x%.xpi ..\
cd ..
rd build /s/q

---

I'm playing with auto submiting forms. but it's a real b1tch what with all the different ways sites do form validation. I've got simple sites like nytimes working. but most sites don't work yet. However this build does not have any of the autosubmit code in it so don't expect it to work.

jacksmernov
 
Posts: 84
Joined: July 29th, 2004, 7:54 pm

Post Posted August 10th, 2004, 6:17 pm

jacksmernov wrote:Another important change was something roachfiend wanted to do to save real astate. Instead of the bugmenot menu item showing up in almost all contexts. It now only shows up if you right click on a text feild.

I also changed it so that bugmenot menu item comes after select all instead of showing up above undo (which was really ugly).


I just wanted to repeat it so you all are sure to see it.

polidobj

User avatar
 
Posts: 3147
Joined: March 31st, 2004, 9:10 am
Location: Maryland USA - im in ur tinderbox, crashtesting ur firefox

Post Posted August 11th, 2004, 7:13 am

Would it be possible to open the bugmenot entry in the sidebar insteaf of a popup window. It seems like it would make more sense. Sorry I haven't tried this new version yet. I'm still using 0.3 but am interested in trying this new version soon. The automatic pasting seems nice but it would nice if the bugmenot sidebar stayed open because more often on the washington post I have to try more than one bugmenot entry before I find one that works. They seem to be getting more aggressive killing bugmenot usernames.
Brian J Polidoro - Today's bugs brought to you by Raid. :P
Windows7 - Firefox user since ~Feb 2002

jacksmernov
 
Posts: 84
Joined: July 29th, 2004, 7:54 pm

Post Posted August 11th, 2004, 8:55 am

http://www.geocities.com/jacksmernov/bu ... index.html

Huzzah. Auto Submit is now working. I've tested it to work with pritty much all the major sites. If you hate this feature you can disable it. There are a few sites that I don't know if it will work at. I need to find a site that uses a submit button that is just an image in an ancor tab pointed to some javascript to submit the form.

---

I don't know if i can get it to open in a side bar without too much truble. I could get it to open in a new tab most likely without alot of effort.

The auto close feature only closes the bugmenot window on the first try. so if you do bugmenot again the window stays open... you can disable this featur in newer realieaces.

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 0 guests