Linking firefox extension to the webserver?
How do you link the firefox extension to the java webserver so that the extension will display the output of the java webserver? Is there certain javascript that needs to be added/modified? Thanks!
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
Create a customer community for your own organization
Plans starting at $19/month
-
Inappropriate?I have made some progress in this area so ill share what i've done.
To get my extension to connect to the webserver, I put a browser object into my sidebar with:
<browser>
(The flex attribute just makes it so the object streches to fill the sidebar rather then leaving a lot of empty space)
Then, where i previously checked for new loaded pages (in a javascript) and updated the sidebar, i put:
newurlcontent.loadURI("http://localhost:8888/page.html?parameter1=" + newpageurl);
where 'newurlcontent' is a refernce back to the browser object and 'newpageurl' is the page that was just loaded.
hope this will help.</browser> -
Inappropriate?I discovered a problem with the above method. If you click on any url links inside the sidebar, they will end up opening the page in the sidebar. I'm gonna see if theres a way around this.
-
Inappropriate?Thanks Patrick!
The keyword "target" might help with putting the content in the right place.
That was how it was done in HTML framesets and I bet there is an analogy in the firefox extension. The idea is that you set the "target to the name of a different document and whenever you click on stuff it loads in the other target.
We'll need someone to follow up here with how to make that happen in Firefox world. -
Inappropriate?Hi,
I solved this problem by using XmlHttpRequest in the onPageLoad() method when the browser loads, reading the results from the Web server, and creating links on the sidebar for each result returned. My web server outputs the results in plain text format, space-delineated, so I simply split the response text and add each result in a label.
My look like this:
<label class="text-link" value="[some label text]">
where gotoPage() is the Javascript function that Chris posted a few weeks back, which opened a given URL in the main document window.
http://www.w3schools.com/xml/xml_http...
If you do this, I found that the best way to do it is to use an anonymous function to assign the callback function. Instead of this line:
xmlhttp.onreadystatechange=state_Change;
I did this:
xmlhttp.onreadystatechange=function() {
....
}
This was because I was having problems with document references being in scope in the areas where state_Change() was actually a valid function due to the Javascript schema in the firefoxOverlay file being strange.
Edit: The sanitization routines that this discussion system follows strips out part of the label tag. Its "onclick" attribute should be "javascript:gotoPage(url)". -
Inappropriate?Another way to easily communicate information between the webserver and the firefox sidebar is to do the following:
When the page loads, you set the sidebar's location to the webserver like this:
var sidebar = document.getElementById("sidebar").contentDocument;
// This line performs the request, and applies the response to the sidebar
sidebar.location = 'http://localhost:8888/ + parameters you want to send'
Have the server perform the query then return a string of your results that is in HTML format. The sidebar displays this HTML like a normal webpage.
You don't need to mess with the sidebar elements or xul stuff. -
Inappropriate?What approach is everyone using to download the current page from the Java application? I thought about using the websphinx stuff, but it's pretty process intensive it seems...
Loading Profile...




EMPLOYEE


