Using Html DOM in firefox plug-in? - firefox-addon

Can you use Html DOM in firefox plug in to...
1) write/Auto fill in a form?
2) Read values in label? Textboxes? And use them in your program?

In Firefox, the current document is accessible in JavaScript by content.document and from there you can do anything you would do in JavaScript on the page itself.

Related

How to retrieve HTML representation of components?

I would like to output HTML codes of my vaadin's components at my console. I didn't find any methods for this . Can it be possible ?
It is not possible to retrieve component's generated HTML with Vaadin's server-side programming mode.
If you really need to do it, you could write your own extension what transfers component's generated HTML from browser to server after it's rendered. Writing your extension means the you need to it with GWT (GWT Web Toolkit, formerly Google Web Toolkit).

Extract background-image from an HTML element in ruby

I am trying to extract background-url from a div using Nokogiri but am not able parse background-url of it.
While Searching on StackOverflow I found this link
Parsing: Can I pick up the URL of embedded CSS Background in Nokogiri?
but the solution given there doesn't work.
Nokogiri is not a web browser. It stands on top of libxml2 to provide fast and excellent parsing of XML and HTML, and manipulation and extraction of data from this.
It only deals with the HTML in a web page. It does not run any JavaScript. It does not apply CSS to the DOM. There is no way to use Nokogiri to find a CSS style applied to an element unless it is directly on the style="..." attribute on that element. (And even then you would need to use something else, like regex, to parse the CSS therein.)
You will want to use something else, like a headless browser controlled by Ruby, e.g. Watir or Selenium, if you want to process a web page and treat it like a web browser does.

Jquery mobile page load does run javascript until after a page refresh

I included an external javascript file on a jquery mobile page. The javascript file modifies some html and css snippet generated at the server. I've tried putting the jquery code that modifies the markup in the following jquery mobile events -
pageinit, pagecreate, pageshow, pagebeforecreate
But the script doesn't modify the loaded markup on page load, but on page refresh, it works perfectly. So I'm trying to find a way to make the modification take place before the page renders.
Any suggested will be gratefully valued.
I've solved my problem. I included all the external javascript and css files on the index page, and it worked well.
This is because jquery mobile loads subsequent pages through ajax, after loading the first page.

view Html source in chrome with delphi

is there a way to extract the viewed html source from google chrome using delphi? or script to pass info on my apps?
Maybe, but why would you use a browser? Why don't you just download the page?

Open a frame in a jquery dialog

I am trying to load a frame-set in a dialog:
$("#dialog").load ("myFrame.html).dialog ({title:"Edit Info"}).dialog('open');
the dialog opens but empty, the frame is not loading. No error in firebug either.
If I try to open a simple page then it's loading OK (minus the css though).
Is there an inherit limitation of opening a frameset in a dialog?
I'm using jQuery 1.4.4 and jQueryUI 1.8.6
Thanks
Mike
Is there an inherit limitation of opening a frameset in a dialog?
Yes, there is, as explained in the jQuery docs:
jQuery uses the browser's .innerHTML property to parse the retrieved document and insert it into the current document. During this process, browsers often filter elements from the document such as <html>, <title>, or <head> elements. As a result, the elements retrieved by .load() may not be exactly the same as if the document were retrieved directly by the browser.
Browsers will discard many of the structural elements of a page and this includes framesets. The only way to display framesets inside another page is using an iframe.

Resources