This question already has answers here:
Obtaining Chrome Extension ID for development
(3 answers)
Closed 7 years ago.
I am trying to test my chrome extension on different machines, and I saw that the extension id changes every time since I am loading it as an unpacked extension.
But, I really need to maintain the same extension id. My extension goes through OAuth 2.0 with an external non-Google provider. When I registered my extension with the external provider, I had provided the redirect URI in the form of
chrome-extension://<extension-id>/callback.html If I load the unpacked extension again, the id changes and my app no longer works as the redirect URI changes. It's practically unfeasible to keep changing the redirect URI. How do I maintain the same id?
You need to set the key in the manifest file, based on your generated pem file.
There's instruction on getting the pem here: https://developer.chrome.com/extensions/packaging
And there's more detail on the key field here: https://developer.chrome.com/extensions/manifest/key
Make sure you save your pem file once you generate it! It can never be generated again, and you'll have to republish your app to get a new one.
Related
I've developed a web app that uses google drive as hosting platform as explained here:
https://support.google.com/drive/answer/2881970?hl=en
The application has been working OK when users accessed:
https://googledrive.com/host/0B0YWdwxH6K5XdVpaNjhWUl9vZkE/?scriptid=AKfycbx66sZMaqLK8byhV7wY_DoQ8ouqF1acWRcc0JIHyDu5CVWZupAK&id=people
But yesterday it started redirecting that address to:
b216bdb4cf56e8d9d85cf1123921ca125a010325.googledrive.com/host/0B0YWdwxH6K5XdVpaNjhWUl9vZkE/
any idea why? is this a permanent change? does the subdomain key follow any logic?
Browser: occurs on chrome & IE
Operating System: windows8
Drive on the Web / Drive for desktop: when accessing googledrive.com/host
I found the right thread at google.com to answer this. Here it is: https://productforums.google.com/forum/#!category-topic/drive/mTyJXruRhBg
In short, the redirect and prefix is here to stay. It's for some security thing. All files within the same googledrive folder will be prefixed with the same guid-looking string. That is, provided we use this googledrive url form: googledrive.com/host/{folderID}/FriendlyFilename. Then, any support files you want to access or link from that folder, just access them as FriendlyFilename with relative url form.
My problem was, I was using the obscure form googledrive.com/host/{userID+fileID}. (no FolderID or FriendlyFilename). That now gets a different domain prefix for every file within the same folder.
Here's a different variation of that test file I showed above (which was getting Security exception for webworker). It works now by using the {FolderID}/FriendlyFilename form. Tada. https://googledrive.com/host/0B8BLd2qPPV7XME1rNU9iWnYtbTg/ded-worker-F12throw.html
I'm developing packaged app for chrome store using one-time chrome wallet payments. For my app I need to check during the runtime if user bought the app or not to decide should it be demo functionality or full functionality.
According to the chrome identity API documentation :
to keep application ID constant, You need to copy the key in the
installed manifest.json to your source manifest.
I have 2 questions about this procedure:
1) under what condition the id of my application may change? I've tried to re-install the app and made updates but the apps id remains the same.. If there is no way to change apps id than why do I need this procedure for?
2) how can I upload my zip archive with manifest.json (which contains "key" field) to chrome dashboard? The problem is that uploader throw an error at me:
An error occurred: Failed to process your item.
key field is not allowed in manifest.
Once uploaded to the Chrome Web Store, your extension ID is fixed and cannot be changed any more.
The ID is derived from the .pem file that was created the first time you (or the Chrome Web Store) packed the extension in a .crx file. When you load an extension in "unpacked mode", an ID is automatically generated in an unpredictable way. The only way to control the extension ID during development is by setting the "key" field in the manifest file, as the documentation suggests.
When you have already published the extension in the Chrome Web Store, then you can easily get the value of this "key" field using the Chrome Extension Source Viewer. After installing the extension, go to your Chrome web store details page and click on the CRX button to view the source. When the Chrome Extension Source viewer has loaded the extension, it will display the key in the console, which can directly be copy-pasted to your manifest.json:
If you have not published your extension, or you do not want to use the Chrome Web Store, then you need to generate a private key first.
Go to chrome://extensions/ and enable Developer mode.
Click on "Pack extension...", select your app/extension's directory and confirm.
Now you've got a .crx file and a .pem file. Back up the private key (.pem file)!
The extension mentioned can be used to get the same information. Alternatively, visit the online demo at https://robwu.nl/crxviewer/ and select the crx file you've just created (again: just open the console to see the "key" and extension ID).
When you're ready to submit your app/extension to the Chrome Web Store, follow the following steps:
Create a zip file containing your extension (important: manifest.json must be at the root, i.e. "directory/manifest.json" is bad, "manifest.json" is good).
Add the .pem file as key.pem!
(this is necessary to preserve the extension ID)
Upload the extension to the Chrome Web Store (without the "key" field in manifest.json, the CWS will reject any upload that contains a "key" field).
For subsequent updates, "key.pem" should not be added to the zip file, because the Chrome Web Store does not need it any more.
Hopefully somebody can give a better answer than me. An app's id is generated by google when you first upload it to the web store. However, it's not the same id that you have when developing locally. Your chrome browser generated some other id using some other mechanism.
When you are developing locally from your source code directory as an unpacked extension, and you want to use the id that the chrome web store assigned to your app, you put the "key" in your manifest and reload your app. This helps you because many APIs expect chrome.runtime.id (the id of your app) to be the same value as the app in the store. You can leave the "key" in your manifest and it will be ignored.
For anyone having problem loading the unpacked extension with the key field in the manifest.json file.
Remove your published extension if you have it in your extension list but disabled. Since otherwise your local dev extension won't load and no error will be shown. The reason being that chrome detects duplicate keys for the extension and ignores it silently.
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Google Chrome - Alphanumeric hashes to identify extensions
I have written one chrome extension and I am packaging it using --pack-extension switch , it is giving me one .crx file and one .pem file. Now I wanted to install this extension on my deployment machine using windows registry, for that I wanted to know how do I get the extension id(which we get if drag and drop .crx file to chrome://extensions tab).
Extension Info of chrome.management API() fetches extension id. However onInstalled() event returns all Extension Info of extension installed.
Ex:
If extension id after packaging turns out to be kpddfdhkifopcepoldlgidejfnbhdbdn, it will be same where ever it is hosted.
Let me know if you need more information.
I currently self-host my Chrome extension - but with the recent changes making it more complicated for less technical users to sideload Chrome extensions, I'm considering moving it to the web store.
Problem is: I don't see a clear transition plan for how to get my ~500,000+ users to download the next updated version from the web store once I get it on there.
Is it as simple as uploading my new version, and changing my update_url in the manifest.json to point to that download link? Can the update_url be something that points to a different domain name than the original extension was hosted on?
The main issue is that the version in the Chrome Web Store needs to have the same ID as your self-hosted version - meaning that it has to be signed with the same certificate. To achieve that you need to upload your signing certificate to Web Store as well. Add your certificate as key.pem to the ZIP file the first time you are uploading your extension, the Web Store will then automatically use it for signing (it will be removed from the extension package, don't worry).
Once you have your extension in the Web Store under the same ID you can add a new version under your self-hosted location. Use http://clients2.google.com/service/update2/crx as your update_url. Once the Web Store has an extension version that is higher than the newest version on the self-hosted location everybody should be updated automatically.
This answer is based on a Google groups discussion.
This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
HTML 5 Geo Location Prompt in Chrome
I've been looking at geolocation in Html 5. I'm using Chrome (12) and am accessing the html file using a path like this: file:///C:/_Development/Examples/Html5/boilerplate.html
I'm getting the little geolocation icon in the search bar that says that the location has been blocked from tracking your location.
Note that I don't have any exceptions setup at all...
Can this be done or do I need to host the file on a web server? If it can't be done, why can't it be done?
Thanks
This is a duplicate of this question:
HTML 5 Geo Location Prompt in Chrome
It seems that chrome has security restrictions on accessing geolocation data locally. You need to host the file to use the data. A workaround with python is available in the previous question.