is it possible to keep a packaged app running after `chrome.runtime.reload()` without additional windows? - google-chrome

I have a packaged app that calls chrome.runtime.reload(). On a desktop OS (Windows, OSX) this call will cause the application to close, but not restart unless there is an additional Chrome page open.
I assume this is because if it is the only Chrome app running, it closes the Chrome process entirely and there is nothing to restart it.
Adding the background permission looks like it should work, according to the documentation but it does not seem to actually start Chrome when the user logs in (and keep it running) as the documentation states.

A user can override this globally with a setting.
In Chrome's settings with "Show advanced settings":
System > Continue running background apps when Google Chrome is closed
Perhaps it is disabled on your development system.

Related

Chrome request not making it to server

I have a Windows 2016 Server with IIS 10.0.14393.0 installed that is maintained within an isolated VM environment. (The entire VM environment is isolated from the real-world.)
The web server is configured with three websites through IIS, and each website is assigned a dedicated IP. The contents in each of these websites is a single "hello world" html page that can be accessed via a browser from from my development workstation using Microsoft Edge, but I cannot access these pages using Chrome. The simple hello world html page was created only to assist in troubleshooting this issue.
The error received in Chrome is ERR_TIMED_OUT and based on the IIS logs, the request is never reaching the web server. IIS logs do indicate the request/reponse when accessing using Edge.
From my workstation, I can successfully ping the web server, traceroute output does not indicate any unexpected hops, etc. From all indications, the problem appears to be isolated to Chrome and only when accessing the sites on that server. I have other servers (W2016 and W2019) in the real-world with a similar configurations and real applications deployed there that work as expected with any browser.
I am using the latest Chrome Version 105.0.5195.102 (Official Build) (64-bit) and can access other web based content within this VM environment using Chrome, just not on that one server.
I am almost to the point of deleting that VM instance and starting over so any ideas/suggestions are appreciated.
The error received in Chrome is ERR_TIMED_OUT
This is a communication problem indication that there is a problem with the user's local network connection. It can appear when your internet is too slow or your connection is taking too long, or the page or website you are visiting may be too busy, or when the website in question is not set up correctly, or even if the website is trying to perform more than your server can manage.
I'm not sure if you've seen the following methods, but you can try.
Method 1: Browse in Incognito Mode and Remove Extensions.
You should first browse the website in incognito mode to check if you
can open the website normally, if so then the culprit of the
ERR_TIMED_OUT error may be your plugin or extension. Therefore, you
need to enable extensions one by one to check for errors, and if there
is an error enabling an extension, you need to remove it from your
browser.
Method 2: Delete the Default Chrome Folder
Press Win + R keys at the same time to open the Run
Type %LOCALAPPDATA%\Google\Chrome\User Data\ in the box and click OK.
Close your Chrome if it is opened.
A new window pops out, find the folder named Default. Backup the folder anywhere else, then right-click the folder to choose Delete.
After you have deleted the folder successfully, open your Chrome and
then visit the webpage again that you searched before to check if the
error still appears.
Method 3: Update Network Drivers
If your network driver is out of date, you may encounter ERR_TIMED_OUT
errors. Here's how to update network drivers.
Right-click the Start button to select Device Manager.
Scroll down to find Network Adapters and click on it to expand it.
Right-click on your network device and select Update Driver.
Select Search automatically for updated driver software option to start to search and update your network driver to a new version.
After that, restart your computer and open the sites again with Chrome
to see if you can open them.
Method 4: Disable Firewall & Antivirus Software
Sometimes, your firewall or antivirus software may cause trouble.
Therefore, you should try to disable them and check if the problem can
be solved. If you find it helpful to disable these programs, you can
check the firewall settings. Allow Chrome to connect to public or
private networks. If it doesn't work. Permanently delete these
programs, and then use other antivirus software or firewalls.
Method 5: Check Hosts File
When you meet the ERR_TIMED_OUT error accessing a specific website,
you can check the Hosts file to see if the website has been blocked.
Here is the way to do that:
Press Win + E keys at the same time to open File Explorer and then go to the Local Disk C: > Windows > System32 > Drivers > etc.
Open the host file with notepad. If you see the web address that you cannot visit, delete that entire line from the host file and save.
After that, open the Chrome and see if you can open the specific
website.
Method 6: Reinstall Chrome Browser
If none of the methods above fix the ERR_TIMED_OUT error, then you
should try reinstalling Chrome. Here is the tutorial:
Press Win + R keys at the same time to open the Run box, then type appwiz.cpl and click OK to open a new window.
Find Google Chrome in the list, and then right-click it to choose Uninstall.
After uninstalling Google Chrome successfully, you also need to delete its leftover files. Open the Run box again, then type %appdata%
and click OK to open a new window.
Find the Google folder and then right-click it to choose Delete.
Go to Google Chrome’s site to download the latest version of the browser, and then install it.
The above methods are from the web article. To avoid link being unavailable, I have also presented the details. I am not sure if the above methods can help you, but I hope you can solve the problem soon.

A custom extension is not listed in extensions page in some computers

I have developed a Google Extension for which I created a Windows installer package. That installer writes the corresponding registry entries as explained in https://developer.chrome.com/extensions/external_extensions#registry
All that works well in some computers. So, after I run the installer package and then run Google Chrome, a little popup appears telling me to enable the extension. I answer “Yes” to that question and from that time on, the extension works as expected.
However, in some computers, with the same version of Chrome (53.0.2785.116 m), the installer writes the corresponding entries to the registry but when I run Chrome, nothing happens and the extension is not listed in the chrome://extensions/ page.
In such cases, I can connect to web store to install the extension manually. However, this extension launches an application because it implements Native Messaging. When I install the extension manually it works (the native messaging host application is launched and works) but when I close and re-open Chrome, the host application is not run. To run it, I need to manually disable and then re-enable the extension.
Very strange what happening. Can you help me on this please?
Based from this thread, (which is somewhat related to your issue), when you close the Chrome, it will fire onDisconnect event that's why the application is not running.
Native messaging means only Chrome can start a host instance when it "connects". It's a misnomer, since connect() means "launch a new copy and talk to it".
There is no way to "attach" to an already-running process. If you close the host, stdio pipe is broken the Port object fires onDisconnect event. Then you need to re-launch the host from the extension to be able to talk to it.
You can check on this link. Just make sure that no antivirus or firewall programs on your computer are causing the problem. If you can open Google Chrome when the firewall is off, you may need to create an exception in your antivirus or firewall settings.
However, in some computers, with the same version of Chrome (53.0.2785.116 m), the installer writes the corresponding entries to the registry but when I run Chrome, nothing happens and the extension is not listed in the chrome://extensions/ page.
You may be encountering blacklisting if that extension was ever installed, then uninstalled.
What if the user uninstalls the extension?
If the user uninstalls the extension through the UI, it will no longer
be installed or updated on each startup. In other words, the external
extension is blacklisted.
How do I get off the blacklist?
If the user uninstalls your extension, you should respect that
decision. However, if you (the developer) accidentally uninstalled
your extension through the UI, you can remove the blacklist tag by
installing the extension normally through the UI, and then
uninstalling it.

Google Chrome refusing to open pages in Windows 10

I'm running Google Chrome on Windows 10, latest editions. Chrome refuses to open any pages, returning "Aw snap" error messages. To resolve this I've:
Removed all extensions.
Uninstalled and reinstalled Chrome.
Tried Chrome on a different user.
Ran Chrome Cleanup Tool.
Deleted my Google folder in Appdata.
Incognito pages don't work either.
None of these worked. Firefox at all times is working perfectly so its not an internet problem.
Anyone have any ideas on how to fix this?
Please follow below steps, to resolve "Aw snap" error messages with Chrome browser.
Steps To Resolve:
Go to Chrome shortcut in the Desktop (If not exists create one)
Right click -> Properties
In the target field, At the end add a space followed by the below -no-sandbox
Apply-Ok
Launch chrome using the shortcut
Follow the below steps
Go to windows task manager
go to details tab
kill all the chrome process
run the chrome it will open
It is likely that malware is trying (and failing) to modify the page that is loading. I've also seen this as a symptom of machines that had nasty redirect malware removed, as the redirects that the malware creates no longer have anywhere to resolve.
I highly recommend a fresh Windows 10 install, only way to be sure you're fully free of whatever may have infected your current Windows installation.

Ripple emulator chrome plugin is taking long time to execute

I was using Ripple Chrome extension for test running my phonegap apps, and I did all settings for Ripple, like making a Chrome shortcut with --allow-file-access-from-files and in Chrome extension list checking "allow local file access" for Ripple.
On running my HTML file which I made for phonegap build, Chrome is taking a good time to deliver a response. Everything is working, the only issue is the delay on response.
I tried on another desktop, and there it is quiet and fast. I re-installed the extension and restarted Chrome and OS a couple of times to no effect.
For your information, I had similar issues when using Chrome. Make sure Chrome isn't running in the background when you close it. Since a few versions of Chrome, this is enabled by default. Check your taskbar to see if this is the case.
If Chrome is indeed running in the background, right-click on the chrome-icon in the taskbar and disable "running in background". This worked for me and now Ripple fires superfast.
You probably need to confirm your system spec. development workstations are known to be resource demanding, particularly the RAM, and processors. if your app was faster on another system, you might want to check that system's spec also and compare with yours.

Chrome App using sockets api run without opening Chrome window

I want to build a Chrome App to listen notifications sent by my Lab, and I don't want to open a Chrome window(just let the app run in background silently, and pop a box when I have a new message). But sockets api is only for packaged app, and packaged app has no background permission, what should I do? Thx.
(Quick answer, will edit later with more info.)
Chrome Packaged Apps don't need that permission, they have a background page by default. Most (say, 99% of existing) chrome apps will open a window when they launch, but thats optional.
If your app has an open window, the runtime will keep your application running an not move into an idle state. However, if you are using certain APIs, such as having an open TCP server socket listening for incoming connections, its very unlikely that the runtime will shut your app down unless the system is under serious constraints.