Firefox add-on to display iFrame - firefox

I'm trying to create firefox addon which will add an icon near the address bar, and when the user will click it, it will show an iframe which I'll set.
Something similiar to chrome extension, as like this:
http://code.google.com/chrome/extensions/images/hello-world.png
Thanks

Here is an overlaying method.
Article : Creating toolbar button # MDC
XUL of popup box can refer to notification-popup and identity-popup(suggested) at chrome://browser/content/browser.xul
And iframe is avaiable in XUL.
<panel id="sth-popup" type="arrow" hidden="true" noautofocus="true" onpopupshown="(initial action)" level="top">
<iframe id="sth-body" src="chrome://(extenstion name)/(sth html)" flex="1"/>
</panel>
For the listeners (onclick, onkeypress) of toolbar button , please refers to gIdentityHandler . handleIdentityButtonEventat chrome://browser/content/browser.js
If your addon is a bootstrapped extension, please refers to Playing with windows in restartless (bootstrapped) extensions at Oxymoronical.
Javascript DOM control technique is required.
Refers to the XUL example and create the elements simply by document.createElement method or even bydocument.createElementNS(XULNS, "(tag name)") method, whereconst XULNS = 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'; had been written.
Feel free to ask more and to be one of our registered users. :-)

Your problem is with the creation of the iframe? or with creating the iframe content? (for instance u can't set a src attribute to a file which is not the domain of the page where u want to display the iframe)

Related

Monitor click events on bookmarks (Google Apps Script)

Is there a way to monitor click events on bookmarks in google documents with google apps script? I want to get bookmark id when someone selects a bookmark and than run some more code which needs that bookmark id to get processed.
With Brian Bennett's help I managed to solve this issue with Web Apps. There is a little bit more code to write but it works.
Write a doGet function:
doGet function is called when a user visits your Web App. With doGet function I opened a document with ID given through get parameters and displayed it as html. To get a html of the document I used this function.
Find and display bookmarks:
You can find bookmarks in the html of the document as html tag with id of the bookmark. I changed the css of all this tags so I could see them (change background, height, width or something like that).
listen to click events on bookmarks with jquery or just javascript:
Listen to click events on those tags (bookmakrs) with jquery or javascript. If you use jquery, you need to import a jquery library. When click event happens get the id of the bookmark from the id attribute of the tag.
Use that bookmark id as you wish...

firefox addon iframe type

I'm new to firefox and I used JPM to make a firefox addon and submitted it to Mozilla. One reason they gave for rejecting it was the use of iframe elements without a type attribute.
Here are the two situations that an iframe will be loaded.
Whenever a page is loaded a content script will be injected to that page and that content script will insert an iframe that acts as the extension's menu. I set the type attribute using jquery append.
$("body").append("<iframe type='content'></iframe>")
Whenever a user clicks a button appended to a youtube video it will load the video through an iframe and display that video on the page with some additional viewing features. The type attribute is being set using vanilla javascript myIframe.type = 'content'
Is there something I am completely missing or is how I am setting the type attribute correct?

Joomla Ajax Menu- refreshless content

I am trying to convert a flash site into a non-flash site. The site is already powered by Joomla CMS but it outputs XML into flash. You can see the site here www.alexandraandthesunflowers.com.
As you can see (and hear) there is a music player that persists across all pages in the site (i.e. the page does not refresh when you go to different sections)
To achieve this without flash I think what I need to do is frame the home page with the main Joomla menu and a media playing component. Then what I need is for the main menu to load Joomla content into the content area using ajax and use some equivalent of SwfAddress to enable the back and forwards buttons to work and for the pages to be directly linkable.
Things like edcwid seem to work like this (ie www.carpaholixx.com/estore) but I cannot find any information anywhere on how to go about getting Joomla to work this way...
Has anyone got any ideas?
D
I agree that the frame solution could be interesting.
I suggest making a frameset like this:
<frameset>
<frame id="mediaplayer" src="mediaplayer.htm" />
<frame id="main" src="{Joomla main page}" />
</frameset>
And then use css to hide the #mediaplayer, and custom javascript inserted on the joomlapage to send commands to the #mediaplayer frame where you run any kind of mediaplayer with a JS interface.
So keep the transport controls on your Joomla page and keep the mediaplayer over several changes of the #main frame.
Hope this makes sense :)
You could also consider using a javascript API to take care of the AJAX fetching of a page, to insert it in a content container on the page. This however require that you disable the header/footer of any Joomla page you request via this method. I however don't know if this is possible using Joomla.

Browser inside of a browser

I am not trying to track clicks or anything like other people - I just want to put a browser within a browser that can go back, forward, refresh, accept user-entered URLs, and store bookmarks. Can flash/silverlight/ajax/whatever do this? If so, how?
How about:
Solution 1:
Create or use an existing ActiveX Web Browser control.
And let your web/page host that ActiveX, or host multiple controls.
Solution 2:
Put an iframe inside a UserControl, a textbox and a go button.
Get the user provided url from textbox.
Change the src of the iframe when user clicks the go button.
_
<iframe id="iFrame" name="myFrame" src="http://bing.com"
width="100%" height="300" frameborder="0">
<p>Does your browser support iframes?</p>
</iframe>
--EDIT--
This is in response to your comment; you posed 3 questions:
For 1, thats correct, ActiveX works for IE, more specifically for Windows; there are ways you can install ActiveX for different browsers, but it(the ActiveX) would require windows OS. See this.
For 2, try handling that using JavaScript; something like following within iframe block.
<p>Back</p>
Checkout these examples.
For the third one, if I understand you correctly then you can always parse the url when user clicks onto the Go button; and respond accordingly before rendering the page.
flash can do basic html (AFAIK) not sure about silverlight.
you will struggle to do it with javascript/iframes. Especially back/forward/refresh buttons. If you are on the same domain you have some control over the iframe, but once it leaves your domain, you lose control
Would using an iframe or an object with type="text/html" be useful to you in terms of being able to embed a page within a page? Either method effectively permits loading a separate page within a page with little side-effect.

How to get back button to work with anchors (#) and iframes

I am working on a site where the main part of it is driven by an ajax style navigation system using anchors in the url to define the application state.
On top of this I now need to support IFrames that are loaded on top of this application. The problem I'm having is that the back button breaks if I make use of fragments.
I've created a very simple sample, that isn't using any of the ajax libraries. All it has is a link that adds an anchor to the url and an iframe, with some normal links in it.
If I click then anchor link first, then I click the link in the iframe, I would expect the first back click to take back to the original iframe page and the second click to remove the anchor from the url.
I'm aware of all the various solutions out there (YUI, reallysimplehistory, jquery plugin) and they all work great, but they don't cater for iframes.
I'm also aware that I could add some JS to the framed pages and possibly route all navigation through the parent page, but I'm hoping that isn't necessary.
So the question is, can anyone explain what is going on inside the history object in this sample? Secondly is there anything I can do from the parent iframe to coax the history object to pick up these navigation entries?
Note: I'm only enquiring about FF/Safari/Chrome in this sample. IE needs to looked at separately.
Refer to
JavaScript .hashchange performance. Can it bring any slowdown?
and
How does Gmail handle back/forward in rich JavaScript?

Resources