I embedded an iframe in my popup.html of my extension. Inside this iframe the use has to submit by clicking on a button. This opens a new tab which causes my popup.html to be closed.
How can I force the popup.html to remain active?
This is necessary as the iframe processes with more information.
My popup.html: http://pastebin.com/QftvfQ8c
You can not force a popup to remain open.
Related
My web page has a login section. I want the extension to open when the user clicks on the login button. Is it possible? I want to open the extension after logging in directly on my web page without clicking the extension button in the browser.
I have a very simple webextension that, when new tab is clicked, it's overriden by an html that displays a site inside an iframe.
Relevant aprt of the manifest.json:
"chrome_url_overrides": {
"newtab": "background.html"
},
"permissions": ["tabs"]
and background.html is as simple as:
<html>
<iframe src="https://app.everydaycheck.com">
everydayCheck
</iframe>
</html>
This extension works smoothly for Chrome, you click newtab and while the new tab is displaying/loading the site you can immediately start typing in the omnibox for whichever google search you want. However, that's not the case in Firefox.
While in Firefox 56, the omnibox was populated by the local url of the web extension, Firefox 57 doesn't show it anymore, but it doesn't autofocus the omnibox either.
Looking at https://github.com/cadeyrn/newtaboverride/blob/70d2186b0eb7f8f5ddaaefb4f51b5332127f4ba2/src/js/core/newtab.js#L94 it does seem it should work though.
One thing I have noticed is, if I have focused the omnibox before I click new tab, then the resulting new tab has the omnibox focused. However, if I have been browsing through a website and click new tab, it doesn't.
I don't think the application is "stealing focus" from the omnibox because before the site has loaded, the omnibox has already lost focus.
Does anyone have any idea of how to go about this rather simple and obvious webextension?
By the way, you can try if it works for you:
https://addons.mozilla.org/en-US/firefox/addon/everydaycheck-do-it-every-day/
Thank you.
I have a new extension I'm making, the button makes a drop down popup and in that I have the HTML code
<html>
Google
</html>
This code should direct to google, shouldn't it? I know that its working because Google comes up on the popup but when I click it it does nothing.
Use anchor tag with : target="_blank"
I have a chrome extension where the popup.html simply has an iframe that loads a page.
I want to allow users to select their language, and as I'm helping a charity do this each language page is very different as they need very different content based on the country!
Therefore, I can't just replace some of the fields like the google developer page example does; I need to change the page that is loaded in the iframe.
e.g. In my directory where the pages are stored I have english.html, german.html, spanish.html all of which are completely different pages.
By default the english.html page loads in the iframe, but the user should be able to go into the options file and select german so when they click on the extension the german.html loads by default every time.
Here is the jsfiddle showing what I currently have in the popup.html, and the popup.js:
http://jsfiddle.net/hemang2/EDV82/
You'll see the flickr API being called, but that's only there because I wasn't sure how to get rid of it!
So essentially my question is how to link the options file to change the default url loaded in the iframe.
Use the setPopup method: http://developer.chrome.com/extensions/browserAction.html#method-setPopup
It allows you to set any html file as your popup.
I use content_scripts in chrome extension to catch the event of opening new site. But when i click on this site a link that redirects me to subsite the event is not fired.
It's not usual site that uses reload to handle link clicks. After clicking link i'm redirected to something like (AJAX?):
http://somesite.com/page#something
So i suppose it's dynamically loaded. How to handle all events of reloading of this page?
How to catch every event of loading page not only by entering into URL field but also by clicking links?
You are going to have to hook the mousedown event. With JQuery it looks like this:
$('a').mousedown(function(){
alert($(this).attr('href'));
});
You'll have to examine the value of the href for $(this) and then do whatever you need to do.
Sounds like the page you are working with has frames so you need "all_frames": true in your manifest under the content_scripts section.