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?
Related
I am using ruby gems (nokogiri & mechanize) to make a crawler for a website but this website contains bootstrap modals (popup windows) that's generated dynamically on button click.
this content (of modal) shows up on button click that uses a "get" method on some URL.
I am getting the response by crawling the URL associated with the button
but I am just getting the same page source.
how could I get the content of that dynamic content using "ruby" ?
That modal you're describing, with high probability is rendered with a Js. So what you're looking for is not possible, because mentioned libs do not execute Js.
In order to parse pages whose content is Js dependent, you should use other tools, e.g. puppeteer
I have a bookmarklet that opens a dialog (in reality an iframe) and extracts some information. When the dialog is dismissed I want to put that information into edit text fields on the original page in the browser (like the way LastPass will automatically fill-in login forms on a page).
Is this possible? I'm thinking that same-origin-policy will prevent this, but maybe there is a way (without installing extensions such as greasemonkey, etc).
Edit: to be more precise: the bookmarklet appends a DIV to the original page; that DIV contains an IFRAME that loads my page; this page fetches some information; once this information is fetched within the IFRAME I want to remove the DIV and (somehow) put that information into the original page.
The issue I face is communicating the information in the IFRAME back to the original page.
What you are looking for are the functions addEventListener and postMessage.
Relevant links:
http://caniuse.com/#feat=x-doc-messaging
How do you use window.postMessage across domains?
I need to launch IE from my WP7 app and load the HTML to create the page dynamically. The HTML is read from a web service and can change at any time, so I'm not able to just store the HTML in a file. Is there a way to do this -- much like you do with WebBrowser.NavigateToString(strHtml)?
-Thanks!
If you are attempting to open your HTML content in an embedded WebBrowser control you can use the "NavigateToString" function and pass it the HTML content you would like to load.
If you are trying to open it in the native IE browser on the device then I would recommend putting state information in the URL and opening the page directly with any parameters required to replicate the view in the browser via the WebBrowserTask. This way you wouldn't technically be opening the HTML code from your app but you would be able to ensure that the HTML content loaded from your service is correct based on your query parameters.
Are you looking for WebBrowserTask?
I have a JSP page, where some parts of the pages are loaded from the backend using AJAX. For example, when I first open the page, the URL is http://www.made-up-domain-name-because-of-stack-overflow-restrictions.com/listUsers.do. The page contains an "add user" button, which loads HTML content (containing a form etc.) from the backend to the div-element with id "addArea". The URL stays the same the whole time (naturally), as the request is done in the background.
The problem I have is that the content loaded using AJAX is not completely viewable with any means.
Using Firefox I can see the new HTML with the Firebug add-on and "Inspect element", but the content within the script-tags is not visible that way (also not in the "Script" tab in Firebug - only the originally loaded scripts appear there). If I use "View page source" in FF a page reload is executed and I don't see the newly generated content (I only see the content of page http://www.made-up-domain-name-because-of-stack-overflow-restrictions.com/listUsers.do as it was when first loaded).
With Chrome I have the same problem as with Firefox.
Using IE I see only the original source.
Of course I can work around this by adding debugging mechanisms to the JS code and working half-blind, or moving parts of the JS code to external files etc., but if by any means possible, I would prefer to just view the code loaded using AJAX. Any suggestions, perhaps using some add-on?
Update: There is a better way: see the accepted answer for this question: How to debug dynamically loaded javascript(with jquery) in the browser's debugger itself?
You can use the JavaScript Deobfuscator extension for that. It can show you what scripts are compiled/executed on a webpage - including the ones that were loaded dynamically.
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)