Is it possible to do the following?

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
sheh
Newbie
Newbie
Posts: 26
Joined: Sun Jan 08, 2006 3:56 am
Avant Version:

Is it possible to do the following?

Post by sheh » Tue Feb 20, 2007 4:59 pm

There are a few things I'd like to be able to do with custom scripts. If it's possible, I'd like to know how. If not, perhaps they could be added in a future version.

Is there a reference to these custom scripts, BTW? I didn't see it mentioned in the help.

* Toggle buttons. Only executed when on. Script is also called on transition from on to off (easiest would be setting some global variable that the script would check to see if it should do the ON action or OFF transition one).

* Dropdown menu button or button+arrow type. The contents of the dropdown (label+value) could be defined in a list besides the script, or, use JS to control all this thru Avant-specific DOM extensions?

* Auto-execute that only runs based on some filters, like site URL. It can be done currently thru JS, but perhaps this adds more overhead.

* Allow to select if script runs before page is displayed, before page onload scripts are run, or after (which I think it the current behavior). If it's not possible to access page DOM before it is displayed due to limitations of IE intergration, perhaps allowing access to the raw text of the page as some Avant specific variable.

* Define whether a toggle button is global or tab/window specific, and define its default state. In fact, this may be useful for internal buttons too, like popup blocking or disabling ActiveX on a per-tab basis.

I think there were a few other things but I can't recall right now.

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

Re: Is it possible to do the following?

Post by Scrabble » Tue Feb 20, 2007 11:00 pm

* Auto-execute that only runs based on some filters, like site URL. It can be done currently thru JS, but perhaps this adds more overhead.

Here is an example of a script that only runs a portion of the script, and only if certain conditions are met. Unfortunately, it only runs after the page is loaded.

var currently=(location.href);
var notallowed=("http://metacrawler.com/");

if (currently==notallowed){
alert (location.href)
window.close()}

else if (currently=="http://www.msn.com/"){
alert ("Microsoft Net")
window.close()}

else if (currently=="http://www.yahoo.com/"){
alert ("Redirecting...")
window.location=("http://avantbrowser.com/")}



I, too, VERY MUCH want to see the things you mentioned able to be done. Especially:

[/quote]* Toggle buttons. Only executed when on. Script is also called on transition from on to off (easiest would be setting some global variable that the script would check to see if it should do the ON action or OFF transition one).

* Allow to select if script runs before page is displayed, before page onload scripts are run, or after (which I think it the current behavior). If it's not possible to access page DOM before it is displayed due to limitations of IE intergration, perhaps allowing access to the raw text of the page as some Avant specific variable.

* Define whether a toggle button is global or tab/window specific, and define its default state. In fact, this may be useful for internal buttons too, like popup blocking or disabling ActiveX on a per-tab basis.

Post Reply