View Full Version : Safari Extensions quick and simple question

Aug 29, 2010, 01:22 PM
I'm making a small Safari Extension using my limited Javascript knowledge, and have hit a snag.
I'd like to use the "Pop Up Button" in the settings bar, and get some information from it. I'm suing Javascript to change the URL, and would like for te user to be able to change it. I've got the code to change the URL, and I'm using:
event.target.browserWindow.activeTab.url = currentURL.replace(*part to replace*, "*part to replace with*");
*Part to replace* = Test1
*Part to replace with* = Test2
This would change "www.macrumours.com/?test1" to "www.macrumours.com/?test2"
I'd like the user to be able to change the part that will be replaced from the drop down list.
I hope this is clear.
Joseph Duffy