Easy way to open URL and change its DOM
Ubiquity should provide a convenience function which opens a URL in a new window/tab and returns a pointer to the new document. That way, a verb can change the new document's DOM to its heart's content, removing nodes, adding others, filling in text fields etc. It seems that verbs often want to do something like this, but right now it is really hard to do.
In fact, right now without this convenience function, how would you get a pointer to the new document? Maybe some method of Application? I can't find any documentation for it though.
In fact, right now without this convenience function, how would you get a pointer to the new document? Maybe some method of Application? I can't find any documentation for it though.
3
people like this idea
I like this idea!
Tell me when this idea gets some attention.
The more people who like this idea, the more it gets noticed.
The more people who like this idea, the more it gets noticed.
-
Inappropriate?You can access hidden document CmdUtils.getHiddenWindow().document, set it up with jQuery.get and modify it as you please. Then display the result in a new tab.
-
Inappropriate?I think that the Utils.openUrlInBrowser function should return a pointer to the window or tab used to display the url. (choose one or the other)
First, if the function returned a tab, it would be easy enough for the caller to get the document from the tab. (tab.document, the_window.activeTab.document) Second, the functions used inside openUrlInBrowser already return a pointer to a window or a tab. The return values simply aren't being used.
There would need to be only a couple changes made to the Utils.openUrlInBrowser function. The functions used internally would have to have their return values examined.
I'm not an expert, but I imagine something like this:
return_tab = browser.loadOneTab(...);
browserWindow.loadURI(...); return_tab = browserWindow.activeTab;
var newWindow = window.openDialog(...); return_tab = newWindow.activeTab;
return return_tab;
1 person thinks
this is one of the best points
Loading Profile...





