how do auto refresh URL in google chrome in the console
function _refresh(){
this.document.location = "http://stackoverflow.com/"
}
setInterval(_refresh(), 10000);
I have tried but after refreshing my function is despair an idea to do this
Thank you
Related
I am facing one issue since my chrome browser is updated to version 77.
Initially window.print() is working fine, but once I open a page where it includes embedded PDF using <embed> tag, window.print() stopped working. Using Ctrl+P shortcut it opens the print popup but when I execute window.print() in javascript it doesn't work.
I have executed window.print() command in console, it directly returns undefined.
There might be a some changes in Chrome 77 release as per this thread https://support.google.com/chrome/thread/14107571?hl=en
Does any one have face this issue ?
Please help.
Looks like this is related to Chrome settings issues, because turning off chrome://flags/#mime-handler-view-in-cross-process-frame fixing that issue.
For someone that did not know how to turn off that, please do this:
Open new tab on chrome, and type chrome://flags/
You will have Experiments page opened.
Then type: Mime on the search bar on that page.
That will show you: MimeHandlerView in cross-process frame
Change that value from: Default to: Disabled, then it will ask you to relaunch the chrome.
After the chrome restarted, the printing function will work fine.
I am facing some what similar issue - once the pdf file is rendered, by the chrome pdf viewer, the window.print() starts returning undefined.
More detailed description - A pdf file is rendered into the tab, user hits back and then print() stops working. It is important that all is executed in the same tab.
$(document).ready(function () {
var URL;
$('#Print').click(function () {
$('#embed').remove();
URL= 'url';
setTimeout(cPrint, 100);
});
function cPrint() {
window.print();
$('#div').append('<embed id="embed" src="' + URL + '" />');
}
});
I'm going to open google hangouts site in webview of my chrome packaged app as user signed in chrome.
I can get auth token that way:
chrome.identity.getAuthToken({ 'interactive': true }, function(token) {
console.log(token);
});
but in webview I can see sign in page instead of hangouts site. It seems that webview doesn't have access to auth token.
Here is code displaying webview:
<webview id="id1" partition="persist:googlepluswidgets" src="http://g.co/hangout" style="width:100%;height:100%;"></webview>
Any ideas to share auth token with webview and open site directly, without log in?
Is it at all possible to do it using auth token? If not, is there another method to authorize user while opening that site in webview?
I have a standalone frame-less Chrome app. I'm sending messages from another Chrome extension to it (Chrome app) which works. But I would like to be able (if it's possible) to launch the app using the extension. Because now I have to launch the app manually.
I've seen Google music "mini player" that you can launch from music.google.com. So I'm wondering if the same can be done using chrome extension.
I wouldn't need the Chrome extension if the Chrome app could read opened tabs or just URLs but since this is not possible one must use extension and message to app to achieve this.
just send msg to your app from extension when you want to open it (In my case, I'm opening app when injected element on page is clicked)
extension script:
var appID = "qwertzuiopasdghghjkhgjghj";
element.onclick = function () {
chrome.runtime.sendMessage(appID, {message: 'fireup'}, function(response){});
});
app background script:
chrome.runtime.onMessageExternal.addListener(function(request, sender, sendResponse) {
if (request.message == 'fireup') {
chrome.app.window.create("page.html",
{
//whatever
});
}
});
You can use chrome.management.launchApp method: https://developer.chrome.com/extensions/management#method-launchApp
To use it you need to add "management" permission to your extension manifest file
We are not able to open a page as new tab in Google chrome. We are able to successfully open page as new tab in Internet Explorer, Mozilla and Safari.
Just for your information we have added "_blank" in "window.open" which have successfully opened page as new tab in all 3 browsers (Internet Explorer, Mozilla and Safari) except in Google Chrome.
Can any one please let us know what changes we should do to open a page as new tab in Google Chrome?
Regards
Tarunjit Singh
If you did it with javascript, this script may be useful:
function RedirectToPage(status) {
var url = 'ObjectEditor.aspx?Status=' + status;
window.open(url , '_blank');
}
I want to create chrome web app that will open in own window like Google Keep extension for chrome.
I made chrome web store package, but how to open it in self window instead of chrome browser ??
Create a packaged app by
Using a manifest with { 'app': { 'background': '...' } ....
Add a chrome.app.runtime.onLaunched listener that calls chrome.app.window.create
See the hello-world sample.