I'm trying to make that if you press a button in the popup window in my chrome extension, it will reload the extension. Is that possible?
Just found this method, which does exactly what I want:
chrome.runtime.reload();
Related
I am developing a chrome extension and I want to know that is there a function/way that allows me to type and also select text and the extension should stay open? Normally when I Use the extension popup and I Click outside the extension close. Is there a way to avoid this? Thanks in advance
I have created a webpage that works best with Chrome. If the user opens this page from Safari, I want to put a button that says "Click here to open this page in Chrome". Upon clicking this button, Chrome should fireup and load the specified URL.
Is there a way to do that? Or even just to launch Chrome from Safari?
There actually is a way, if you want to do this, make the button, and set the href to the link, but at the beginning, delete ‘https://‘ and replace it with ‘googlechromes://’, for example ‘googlechromes://YouTube.com’ if you go to that link in safari, it will ask, “do you want to open this page in chrome?” And if you click yes it will open chrome over safari
There is no way to this within the browser, but here a few work-arounds. You could ...
Make a button to copy your URL to their clipboard so they can paste it in Chrome
Send the user to a download link if they don't have chrome (just ask them if they have chrome or not)
Close the tab in the browser after the URL is copied
You could use window.close() or just close(), as pointed out in this answer.
These are just some thoughts. It's the best anyone could do for a problem like this. I hope this helps.
I'm developing an extension for Firefox for Android and I need to programatically open a new tab with no navigation bar. I know I can do it with JS with window.open("http://www.google.com", "mywindow", "location=0,toolbar=0"); but this time I need to disable it another way, because the tab is being opened via loadURI. So, the thing is, how can I change the toolbar visibility once loadURI was executed?
Thanks in advance!
You have to make browser go to full screen mode to achieve that.
For mobile FF you have to create manifest and at there:
"fullscreen": "true"
https://developer.mozilla.org/en-US/Apps/Build/Manifest#fullscreen
I tryed a lot of things I fount over Internet but no success because there is no XUL in FF for Android. So I just solved it by calling fullscreen mode:
window.BrowserApp.selectedBrowser.contentWindow.fullScreen = true;
Where window is the chrome window, not the object window
When I start Chrome, the new window appears as unfocused & behind the other windows. So I decided to create a workaround; I'll change my homepage url with a file from my disk which one contains javascript to steal focus and then redirect to real homepage.
What is the best method to steal focus, using javascript?
UPDATE: Here is what I attempted...
<html>
<head></head>
<body></body>
</html>
<script type="text/javascript">
myWindow=window.open("http://google.com", "_blank",
"resizable=yes, scrollbars=yes, titlebar=yes" );
myWindow.focus();
self.close();
</script>
However new window looks like popup window, Chrome doesn't display toolbars & adress bar is not editable :(
More info about the bug:
http://productforums.google.com/forum/#!topic/chrome/zyLC4Ip96pU
As far as I'm aware, this has only started on the latest update. If Chrome is already open, when I open a new window of Chrome from a shortcut in the quick launch area of my Windows toolbar, the new window does not take focus, the focus remains on the previous Chrome window. If the focus was not on the previous Chrome window when I launch the shortcut it works fine
I just published a small Chrome Extension which aims at solving this bug! So far it worked great for me (on Window 7 64-bit).
You can find it here: https://chrome.google.com/webstore/detail/chrome-new-window-focus/opmhcfhkhiodgapmnaolhmekmfihmecp
Let me know if you encounter any issues!
Cheers,
Yuvi
http://www.w3schools.com/jsref/met_win_focus.asp
How to hide Chrome extension notification balloons with JavaScript?
window.close() (assuming you are running it inside notification html)
notification.cancel();
I used it in my Chrome extension.