[Release] Search Webpage Button (Similar to 'Ctrl' + 'F')

General questions about scripts and buttons should be asked here. Development scripts and buttons may also be posted for feedback.

Moderators: Support Staff², Support Staff, AvantGuard, Developer

Post Reply
Scrabble
Semi-Fan
Semi-Fan
Posts: 68
Joined: Sat Nov 18, 2006 10:36 pm
Windows Version: Windows
Avant Version:

[Release] Search Webpage Button (Similar to 'Ctrl' + 'F')

Post by Scrabble » Thu Mar 01, 2007 9:54 pm

Below is a script that will ask you what you want to search for and then it will search the current website for it. It acts very similar to 'Control' + 'F'. To add this script go to Tools...Avant Browser Options...Add-Ons...Add-Ons. Then click add, give it a name, make sure for "Type" that 'Script Button' is selected, then paste the text below into the 'Content' field:


var text_name = prompt("Enter the text you want to find:","");
if (text_name!=null){
var range = document.body.createTextRange();
var ans = true;
var i = 0;
while(ans){
range.moveStart("character",1);
var found = range.findText(text_name);
if (found==""){alert('Finished searching the document.'); self.focus(); break}
range.select()
range.scrollIntoView()
ans=window.confirm('Find Next?');
("Counter i = " + i);
i++;
}
}


If you don't have any icons available to assign to this script, I suggest downloading EasyPicture2Icon to create them. It's free.

:D

User avatar
hornakapopolis
AvantGuard
AvantGuard
Posts: 11321
Joined: Thu Jul 31, 2003 2:09 pm
Windows Version: Windows 10 Pro 64
Avant Version: 2015
Default engine: Chrome
IE Version: 11
Skin: Stickers
Location: Ohio, USA
Contact:

Post by hornakapopolis » Thu Mar 01, 2007 10:47 pm

When you say search the current website, you mean it searches the current page, right?

Not putting it down, but making sure I'm not missing something... This is the same functionality of having the Find button on the search bar, right?

bigC
AvantGuard
AvantGuard
Posts: 7244
Joined: Thu Jan 30, 2003 10:40 pm
Windows Version: 10
Avant Version: 2016 Build 1
Default engine: Firefox
IE Version: 11
Skin: Crystal
Location: New York

Post by bigC » Thu Mar 01, 2007 11:43 pm

Hey Scrabble, you know you can export your script button creations to an .aba file and upload them to our downloads area..

http://forum.avantbrowser.com/dload.php ... &cat_id=14

That way people won't have to bother with making an icon, etc.

Scrabble
Semi-Fan
Semi-Fan
Posts: 68
Joined: Sat Nov 18, 2006 10:36 pm
Windows Version: Windows
Avant Version:

Re: [Release] Search Webpage Button (Similar to 'Ctrl' +

Post by Scrabble » Fri Mar 02, 2007 2:09 am

hornakapopolis:

Yes, I mean you search the current page/tab you are on.
Yes, it is the same as having the 'Find' button on the search bar. I did not even know that was there since I don't use the search bar. I still won't use it because I don't want another bar taking up space. Also, the difference I can see is that you have to use the mouse to hit the 'Find' button to search for each new instance. With my script, you use the mouse button to bring up the prompt for what to search for. I personally think mine is easier/nicer. Of course, I could be biased. :wink:


bigC:

I am not sure how to create an .aba file. I definately would like to find out how, though. However, I don't think I will ever upload anything to the downloads area. Three reasons:

1) traffic there is EXTREMELY minimal in comparison to the Avant forum. I believe many more people find the posts in the forum than the downloads area. In this, I think the forum is poorly layed out. Personally, I think the Skins/Downloads should have their own heading in the forum under Add-Ons just like Scripts and Buttons Workshop. I think it is evident that people don't go there due to the small link at the top of the forum page. I did not even realize the link until someone else pointed it out to me. Also, a side comment, I do not like that the Scripts and Buttons Workshop is for releases and questions. When I am looking for something to add functionality to Avant, I hate weeding through questions to maybe find a script. It is not so much an issue now in the Scripts and Buttons Workshop, but obviously it will be in the future.

2) When I posted EasyPicture2Icon I had to 'submit it for approval' and had to go back and forth with I don't remember who as to how this was useful to Avant prior to posting. I want to post it and it be there and be done with it.

3) Some scripts you can either set to auto-execute or set to execute on button press and work either way like here for example. I don't believe an individual has that option when downloading an .aba file.
Last edited by Scrabble on Fri Mar 02, 2007 3:17 am, edited 2 times in total.

User avatar
hornakapopolis
AvantGuard
AvantGuard
Posts: 11321
Joined: Thu Jul 31, 2003 2:09 pm
Windows Version: Windows 10 Pro 64
Avant Version: 2015
Default engine: Chrome
IE Version: 11
Skin: Stickers
Location: Ohio, USA
Contact:

Post by hornakapopolis » Fri Mar 02, 2007 2:26 am

You're right about the toolbar space. (For anyone who does the search bar, you don't have to press the icon. Hitting F3 will activate the function, too.)

As for your reasons...

1) I'm curious where you got your traffic stats. I wasn't aware that we're releasing them. The downloads for the items there tend to jump pretty quickly. The top 5 downloads have over 18,000 downloads between them... and that's after having to reset some of the early ones.

You say you hate weeding through questions to get to a script... well, you have to do that because those scripts aren't where they're supposed to be. (That's sort of a "I do it like this because I don't like doing it like this" type of argument. :?)

2) That has absolutely nothing to do with uploading a script.

3) The exported .aba file (Created by going to Tools -> Avant Browser Options -> Add-ons ->Add-ons -> The add-on you want to export -> Export) will be saved however you had it setup on your computer... including the icon, as bigC mentioned. Once it's imported, people can change it if they like... just as they'd do when creating it in the first place... minus the cutting, pasting, and having to create an icon.

Scrabble
Semi-Fan
Semi-Fan
Posts: 68
Joined: Sat Nov 18, 2006 10:36 pm
Windows Version: Windows
Avant Version:

Re: [Release] Search Webpage Button (Similar to 'Ctrl' +

Post by Scrabble » Fri Mar 02, 2007 3:15 am

Okay, so I am an idiot. At least a partial one. I was only looking in the 'Helper Programs' section (where I placed my one post) and not looking elsewhere.

I am not sure what you mean when you say "I do it like this because I don't like doing it like this", but it seems I am putting scripts in the right place in accordance with the Rules for Scripts and Buttons Workshop Forum.

Thank you for showing me how to create an .aba file. Wow, I feel stupid.

I just got reminded of something...I just tried adding an .aba file to the Add-ons. When I got done entering everything and clicked 'Add File' I got the message 'Sorry, but no such user exists'. I still don't know why this is happening.

User avatar
hornakapopolis
AvantGuard
AvantGuard
Posts: 11321
Joined: Thu Jul 31, 2003 2:09 pm
Windows Version: Windows 10 Pro 64
Avant Version: 2015
Default engine: Chrome
IE Version: 11
Skin: Stickers
Location: Ohio, USA
Contact:

Post by hornakapopolis » Fri Mar 02, 2007 1:32 pm

For right now, don't worry about it.

If you only uploaded one (Tab & Title bar scroll), it's been approved.

Scrabble
Semi-Fan
Semi-Fan
Posts: 68
Joined: Sat Nov 18, 2006 10:36 pm
Windows Version: Windows
Avant Version:

Re: [Release] Search Webpage Button (Similar to 'Ctrl' +

Post by Scrabble » Fri Mar 02, 2007 4:32 pm

For right now, don't worry about it.
Actually, I believe I had the same issue with my other upload. Very disappointing after all this time that it still is not corrected.

If you only uploaded one (Tab & Title bar scroll), it's been approved.
Exactly what I was saying - anything put in the uploads needs approval. I may add others, but I will still put it in Scripts and Buttons Workshop.

User avatar
MysteryFCM
Administrator
Administrator
Posts: 7330
Joined: Tue Dec 09, 2003 2:34 am
Windows Version: 10, 8.0, 8.1, 7, Vista, XP
Avant Version: 13.00 Build 23
Default engine: Gecko
IE Version: 7.x, 8.x, 9.x, 10.x, 11.x
Skin: AthenX
Location: Newcastle Upon Tyne, UK
Contact:

Post by MysteryFCM » Fri Mar 02, 2007 4:39 pm

If you fire me a PM when you upload one, I'll ensure it's approved swiftly for you :) (out of a job again, so got ALOT more free time .....)

User avatar
hornakapopolis
AvantGuard
AvantGuard
Posts: 11321
Joined: Thu Jul 31, 2003 2:09 pm
Windows Version: Windows 10 Pro 64
Avant Version: 2015
Default engine: Chrome
IE Version: 11
Skin: Stickers
Location: Ohio, USA
Contact:

Post by hornakapopolis » Fri Mar 02, 2007 6:28 pm

What's the problem with it needing approval?

With non-approved forums, we end up with spam... which we can handle.

With non-approved uploads, you end up with programs that could infect users before we can get to them.

This is one of those cases where we need to make use of how things are setup so that things don't become disorganized in the future. If one group of people decides to put their stuff in one place and another group places theirs somewhere else... then it's just going to come down to us losing a little bit more of our easy going attitudes and having to institute more rules about what to do where.

Post Reply