Question 1:
My Chrome extension of the Chrome store says that my plug-ins can run in offline mode but it will download and update data from json which they can not do without the internet. So how can I remove as it is not in Chrome store.
Can be run offline
If I understand you correctly, you should delete this line from your manifest file:
"offline_enabled": true
Read about it at code.google.com
Extensions running in offline mode means that your extension will still work if the there is not internet connection and any changes will be queued up to sync online once a connection is established again. Since all Chrome extensions on the Web Store require a working connection to install you can safely assume that all users of your extension will be able to download initial data sets needed by your extension.
Related
I'm using DDEV with Visual Studio Code and I tried to configure Live Server Extension to automatically auto reload page that I'm working on in Chrome when I hit save in VSC, but it doesn't seem to work with PHP.
Is there a way to configure this to work with DDEV?
I can't seam to find any info on this issue.
Thanks
I've managed to do it another way, with guard and guard-liveguard on linux.
The workflow was:
guard installation
guard-livereload installation
Installation was not quite straightforward, but you can follow the instructions in Terminal and install what's missing if it tells you so.
Guard placed Guardfile inside of /home/user directory so I edited it to contain only this, regarding livereload pard:
guard 'livereload' do
watch(%r{.+\.(css|scss|html|php|js)$})
end
Then I installed Liveguard Google Chrome Browser Extension from here:
http://livereload.com/extensions/
Under settings I had to enable "Allow access to file URLs".
Also, you have to press liveguard extension icon in Chrome in order for it to track changes.
That's about it, now when I edit any of the file types entered in Guardfile (you can edit and add what you need, of course) it automatically reloads my Chrome window whit the edited page opened.
I have a Google Chrome Extension which uses a native host. This is used only on a windows box and the extension's registry settings are added along with the installation of the native host exe. Currently the the port (chrome.runtime.connectNative) or native host is started when the extensions background script is loaded. This currently means that the native host runs whenever Google Chrome is running.
The extension is used for only 1 website "www.example.com" and so content scripts only run when a tab with this website is loaded. This means that the native host would only be needed when a tab with this website is loaded and not all the time.
I now want to also create an Edge Chromium extension and give users the option to use either Edge or Chrome. As I indicated above both extensions would be "installed" meaning the registry keys added on installation of the native host. This means the extensions would be there for both browsers.
My main question is thus when and how should the native host be started.
From this main question I have a whole host of thoughts or questions;
When the user chooses to use Edge or Chromium should I at that point be making the changes to the registry? Problem here is users can of course independently of my app install the extension.
Is there a problem just leaving things as they are. In other words if Edge and Chromium are running then there are 2 different native hosts running and my app simply chooses which native host to communicate with based on the users choice. Problem here is you can see the native host process running in task manager and it would therefore be running for a browser that the user has not chosen which might not be OK for some users.
I thought about the extension having a flag to know if it should start the native host. Problem here is how could I turn this flag on. Without the native host I am unaware of a way to interact with the extension.
There are possibly more options so happy to hear them as well.
changes to the registry
Add chrome-extension://id/ with the id of your second extension to allowed_origins in the host's manifest as shown in the documentation.
there are 2 different native hosts running
Each host is started by its respective extension and it can communicate only to that parent extension, there's no confusion.
a flag to know if it should start the native host. Problem here is how could I turn this flag on. Without the native host I am unaware of a way to interact with the extension.
It depends on what the host and the extension do. Maybe you don't need to run the host all the time or maybe you can start it only when a tab with the matching URL is loaded. Maybe you can use the new experimental onConnectNative mechanism.
Looks like starting from the Google Chrome 63 loading self-signed crx file fails with a message: "This extension may have been corrupted".
From the browser logs I see that Chrome is trying to check the verified contents from the store, and, of course, failing.
content_hash_fetcher.cc(252)] Missing verified contents for cfbklnofppkbgcfhppceodfodekoecoa, fetching...
job failed for cfbklnofppkbgcfhppceodfodekoecoa reason:1
VerifyFailed cfbklnofppkbgcfhppceodfodekoecoa reason:1
That's happening for all extensions I can check.
Self-signed crx were disabled on reloading Chrome for a while now, but that was mostly OK for basic testing. Now it seems to be not possible at all.
Is there a way to install extensions for testing on Chrome 63?
Installing unpacked extensions works (for now), but that's not the same as installing crx. We had some issues which were not happening with unpacked extensions, mostly with init and storages.
UPD: the issue is tracked here https://bugs.chromium.org/p/chromium/issues/detail?id=794219
Not sure exactly why this is happening, but the "fix" for us was to put a dummy update_url key in the manifest.json for the extension:
"update_url": "https://www.google.com"
Any old URL will do.
Warning: You will need to remove this before deploying to the Chrome Web Store as it might break your users' upgrade process.
Chrome bug this is the chrome bug tracking this issue. Please star it so that it gets some attention https://bugs.chromium.org/p/chromium/issues/detail?id=794219
Also not sure if this will continue to work in the future.
I'm building a launcher for internal use with a Chrome packaged app which includes links to internal resources (databases, web links, etc.).
The problem is with local files. I want them to launch using whatever program is the default handler for them. For example, access databases open in Access, etc.
I've tried:
Creating a file link file:///. Nothing happens in this scenario on click and the link is not followed.
I found an extension (locallinks) here: https://code.google.com/p/locallinks/, which will open local file links. I've tried borrowing from that extension and passing the file link to the background script in my packaged app which would then open a new window with that url. Unfortunately, that results in a file not found, even for simple types such as text files. So obviously the local filesystem is sandboxed. Not surprising.
I thought maybe it would work to pass the link to an extension to open, but in that case, the file would be opened in Chrome and if Chrome does not support it, it would attempt to download the file locally.
The reason I'm using Chrome Packaged Apps is:
1. This will be updated often and the Chrome Web Store update feature would make it easy to keep clients updated without having to build our own update mechanism.
2. We can restrict installation of the app through CWS to internal users.
3. The app would be used in a Windows, Linux and Mac environment. Obviously the file paths here would be different but since they would point to a samba share, and mount points and network share drive's are known this is an easy problem to overcome.
4. There is additional functionality we will be building into the Chrome app in the future other than the launcher which fits very well with how Chrome Apps are designed.
My thoughts are:
Native Client? I have read a bit about these, but I think I would end up with the same limitations where the native client app would be sandboxed and may not actually have any better way of launching a local file.
Sockets? Maybe a simple Qt app listening on a socket to launch apps? Since the Qt app would be run with user permissions, and the socket would only accept connections from localhost, I guess the socket could in theory be used by a non-privileged app to launch something with user-level permissions. Is there a way for me to limit connections through the socket to only be accessible from my extension?
The sockets solution isn't ideal but may work since the app would not be updated often (if ever) since functionality is so simple.
Am I missing an obvious way of doing this that wouldn't require another component (a Qt app?)
Relating to your thought #2, not sure what local installation footprint you are willing to tolerate, but you may consider:
Hosting a miniscule local web server, or Qt app as you mention, which can also launch local programs (any of those lightweight web server frameworks). Have your packaged app, or your own chrome extension rewrite links such that they point at your web server along with the url of the original link, which can easily launch whatever program. Downsides: this may cause bypassing some browser security screening of the original links in some forms of implementation.
You may also look at this stackoverflow question if it helps.
You can limit access by confirming the requests originate from the local machine, or by embedding a key or hash inside your chrome extension. You may generate the key upon installation so that it's unique per machine. None of this will pass very proper security scrutiny so it depends on your risk profile. You will have a hard time justifying how each part is secure and clean of exploitation attack potential.
It seems you will need both a chrome extension and a local miniscule web server to make this work. Maybe it's easier to let users just download the files and click them...
Sorry if this isn't help enough, but basically you are trying to do something that is by design not made possible in Chrome, so at this state of affairs there would likely not be a simple solution.
I want to bundle an extension with my executable, and I want it to automatically add it to the users browser if they have chrome or firefox. Is there a directory where I can drop the .crx file containing the extension for chrome, and chrome will automatically use it? And what should I do for firefox?
If you want to simplify things you can use Crossrider and get an installer which will install your extension on IE, Firefox and Chrome.
This installer can also run in silent mode, so you run it from your executable without interrupting the normal flow.
To do all that, you will first have to open a new user and copy your extension code to Crossrider (which is probably a good idea anyway since then you will have one code for your app which will support all browsers).
For Chrome:
You can put it in the registry or drop it in the external-extensions.json file (%localappdata%/Google/Chrome/Application/chrome_xx.xxx.xxx.xxx/Extensions/).
I never did it myself actually but it's all documented on the official channel:
http://code.google.com/chrome/extensions/external_extensions.html
There's also a way to install it via Group-Policy, but none of all these three methods is cross-platform AFAIK.
For Firefox:
I have no idea.
My recommendation would be:
DO go through the browser itself,
DO NOT try to sneak around and force it onto the user
Reasons for this are:
the browser is meant to ask for the user's permission, clearly and explicitly.
that's the only cross-platform way I know (and it already requires forking out, so that's not even that totally cross-platform).
I'd simply recommend forking out a browser and passing as argument the extension's file or download URL, so that it will automatically request the user's permission and start the installation process.
For instance, just calling this (on linux, if google-chrome is on your PATH):
google-chrome PATH_TO_FOLDER_OR_URL_PREFIX/myextension.xpi
Or:
google-chrome PATH_TO_FOLDER_OR_URL_PREFIX/myextension.crx
Or for Firefox:
firefox PATH_TO_FOLDER_OR_URL_PREFIX/myextension.xpi