In the text/plain case, is the page actually a HTML document, or a text
file? If its a text file, you'll need to construct a HTML document from
scratch, and insert the contents of the text file.
- Blair
On 1/02/2009 7:06 AM, icct wrote:
> Hi.
>
> I am trying to get content in text/plain mime, then do some ubiquity
> magic
> with it and finally spill out text/html content in the same window.
>
> Here is the code:
>
> CmdUtils.CreateCommand({
> name: "prettify",
> author: { name: "Yuri Pimenov", email: "[email protected]"},
> license: "GPL",
> description: "Uses prettify.js to do syntax highlighting",
> help: "trivially",
> execute: function(input) {
> var doc = Application.activeWindow.activeTab.document;
> jQuery('pre', doc).addClass('prettyprint');
> var node = jQuery('<link href="resource://ubiquity/scripts/
> prettify/prettify.css" type="text/css" rel="stylesheet" />');
> jQuery('head', doc).append(node);
>
> CmdUtils.injectJavascript('resource://ubiquity/scripts/prettify/
> prettify.js',
> Utils.safeWrapper( function() {
> var wnd = CmdUtils.getWindowInsecure();
> wnd.prettyPrint();
> })
> );
> }
> });
>
> If i try to do DOM manipulations with text/plain content everything
> seems
> working right, nodes get created, modified and appended. But in
> reality,
> FF doesn't process result as html.
>
> The same code works fine if content is text/html.
> So, the question is: how to inject new content in the same window with
> different type of mime?
>
> --
> Yuri Pimenov
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ubiquity-firefox" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ubiquity-firefox?hl=en
-~----------~----~----~----~------~----~------~--~---