Jump to content

Recommended Posts

Posted

I'm looking to create a custom toolbar (for IE initially) that when clicked gets the address of the currently viewed page and sends it to a PHP page.

 

Does anybody have any ideas how I might achieve this/links to tutorials that cover this.

 

Thanks,

  • 2 weeks later...
Posted

I don't think this is possible to do. Why would you want to do this?

Sounds like proxy by passing to me. Firefox would be my best bet but as for IE... I doubt it.

Posted
Why would you want to do this? Sounds like proxy by passing to me.

 

Hmmm, I work in a school - why would I want to create some kind of proxy bypassing script when a major part of my job is stopping the kids from doing the very same? :D

 

It's actually for a whitelist filter I've been working on. It currently allows staff to open up websites so that students can use them - works pretty well too.

 

I'm just looking to move it up a level, so that when a teacher is browsing the net all they have to do is click a button when they see a site that students may need access to.

Posted

Is it me or is edugeek being funny today? I've done a similar thing, I've made a program that runs in the background and monitors the site a pupil goes onto then blocks it on a set of white/black list and also in different catagories.

 

http://www.edugeek.net/forums/group-project/29587-web-monitor.html

 

Would this be of any use?

 

Currently testing it in a few rooms at this school. Few bugs to fix (nothing major). But working well.

Posted
Is it me or is edugeek being funny today? I've done a similar thing, I've made a program that runs in the background and monitors the site a pupil goes onto then blocks it on a set of white/black list and also in different catagories.

 

http://www.edugeek.net/forums/group-project/29587-web-monitor.html

 

Would this be of any use?

 

Currently testing it in a few rooms at this school. Few bugs to fix (nothing major). But working well.

 

By the sounds of things your app is completely different to what mine is. Mine runs a Squid server on a *nix box, and has a front end that allows easy editing of the whitelist by staff members.

Posted
Maybe an alternative would be to look at using bookmarklets or whatever they're called in IE? I use the toread.cc archive service to send myself interesting stuff to read at home when people link it here and they provide a bookmarklet to drag to any toolbar in IE/FF. Would have thought you could tweak the JS they use to submit to your server instead, or even just set up an email address at school for pages submitted via toread.cc to arrive with you for whitelisting.
Posted
Maybe an alternative would be to look at using bookmarklets or whatever they're called in IE?

 

That is a really good idea, I remember that evernote uses something simmilar. It is just a chunk of javascript in a bookmark that will looks like it works in lots of browsers including IE, Firefox, Safari and Chrome. Here is the code which should be pretty easy to mod to point to your server. You could even deploy it via AD GPOs

 

Here is the evernote code:

 

javascript:(function(){EN_CLIP_HOST='http://www.evernote.com';try{var x=document.createElement('SCRIPT');x.type='text/javascript';x.src=EN_CLIP_HOST+'/public/bookmarkClipper.js?'+(new Date().getTime()/100000);document.getElementsByTagName('head')[0].appendChild(x);}catch(e){location.href=EN_CLIP_HOST+'/clip.action?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title);}})();

Posted

So I'm trying this bookmarklets and it seems to do what I want. This is my javascript:

 

javascript:location.href='http://localhost/twf/index.php?re=1&ad=add&txtTitle='+document.title+'&txtAddress='+location.href

 

As you can see it loads a page sending 4 variables - this works perfectly except for I need to force the new page in a new window.

 

I'm not very good with javascript so can somebody help me so it loads in a new window and still sends the 4 variables (two of which get info about the current page).

Posted

I'm not very good with javascript so can somebody help me so it loads in a new window and still sends the 4 variables (two of which get info about the current page).

 

This seems to work:

 

javascript:window.open('http://localhost/twf/index.php?re=1&ad=add&txtTitle='+document.title+'&txtAddress='+location.href,'Report Window',
'left=20,top=20,width=500,height=500,toolbar=1,resizable=0');

 

Heres the breakdown of the function fo if you want to tweak it:

Code Beach - Opening a New Browser Window in JavaScript

Posted

Seems to work in opera but you could try this which will refresh the current window and then open the new one, what browser are you using?

 

javascript:location.href=location.href; window.open('http://localhost/twf/index.php?re=1&ad=add&txtTitle='+document.title+'&txtAddress='+location.href,'Report Window','left=20,top=20,width=500,height=500,toolbar=1,resizable=1');

  • Thanks 1
Posted

I don't "speak" javascript, but here's the one I have for toread -

 

javascript:(function(){var%20s=document.createElement(%22scr%22+%22ipt%22);s.charset=%22UTF-8%22;s.language=%22javascr%22+%22ipt%22;s.type=%22text/javascr%22+%22ipt%22;var%20d=new%20Date;s.src=%22http://toread.cc/bjs.php?hl=en&s=b3d9aca02060&d=%22+d.getMilliseconds();document.body.appendChild(s)})();

 

This submits it to toread whilst reloading the original page - not sure if this would be any help to avoid the [object Window] issue?

  • Thanks 1
Posted
Seems to work in opera but you could try this which will refresh the current window and then open the new one, what browser are you using?

 

javascript:location.href=location.href; window.open('http://localhost/twf/index.php?re=1&ad=add&txtTitle='+document.title+'&txtAddress='+location.href,'Report Window','left=20,top=20,width=500,height=500,toolbar=1,resizable=1');

 

Thanks Synack,

 

That works a treat! Thanks Outtolunch too, just beaten to the buzzer ;)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...