I have the code for my chrome extension on GitHub, which I want to publish on Chrome Store. Doing it manually once is fine, but I want to make an automated flow, where as soon as any commit comes to a release branch, chrome extension on the chrome store is also updated. Is there any documentation by any developer or Google which explains how to setup this for my chrome extension?
There are a few ways to do this:
by using npm module (article about that) (suits for you. You can setup script by using this module, then make a hook for a Travis CI)
by using Store APi // for additional reading
by using docker // for additional reading
I suggest using GitHub Actions to automate publishing. High-level steps are:
Building and packing your extension into zip file.
Obtaining (action) an access token for Google API (. using clientId, clientSecret, refreshToken (how get them? Docs, Article).
Upload zip as a new version to Web Store using API (action)
Once the uploaded version was reviewed, publish it (action).
However, there are some pitfalls in this process, such as undocumented responses from Google API, the need for repeating the uploading if it happened shortly after the previous one, refresh token expiration. If you want to build a convenient and robust workflow based on GitHub Actions to handle all these cases I can recommend reading this series of articles.
Related
I'm working on a project to make a chrome extension and the idea is to take notes and write to a Google Doc. So far, for getting started I've created a API key and am using a Client ID (web app option) to work locally using the template from Google's JavaScript quickstart HTML, see source:
https://developers.google.com/docs/api/quickstart/js#python-2.x
I've since been messing around and made some functions and a popup.html that would be used for the extension popup. Now, I'd like to test this within the extension / browser environment and herein lies the issue. I would think you can get access to these APIs within the extension and still test and develop without publishing to the chrome store.
It seems I need a key in the manifest along with an oauth2, client_id, and scope. The latter I have, but I don't get how I can get a key for this? From the developer documentation, it mentions that you can pack your extension and this gave me private key, is that the same thing? I should note too, that the process listed in the documentation doesn't work for me as in my local files the extension isn't in my system.
Moreover, I suspect I need to get the scripts to handle logins and authorize as well, but one step at a time here.
I am trying to implement a web application that connects to Microsoft Azure in order to upload files to their cloud storage. The documentation I have been following is Manage blobs with JavaScript v12 SDK in a browser. The tutorial for which is below:
https://learn.microsoft.com/en-us/azure/storage/blobs/quickstart-blobs-javascript-browser
The documentation explicitly states that to use Azure SDK libraries on a website, you must convert your code to work inside the browser using a bundler. The bundler suggested is parcel-bundler
I have built the project fine, and everything is working in the browser as per the tutorial outlines however I am running into an issue when it comes to obscuring the API Keys.
The alternative tutorial, which explains uploading Azure blobs using Node.js suggests the use of environment variables:
https://learn.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-nodejs
I have done this in my browser tutorial, however, when parcel bundles the project together the full API Keys can be accessed by looking in the source files suggesting they are revealed during the build process of the bundle.
It appears that I need to use a bundler as the functions used for browser use do not exist in the client-side JavaScript.
How do I get around this problem?
You should not be using the API Keys in your browser-based application as it is a major security concern (any user can take a look at the JavaScript files in the browser and extract the keys).
What you should do instead is have an API endpoint which your application can call and this API endpoint should return you a Shared Access Signature (SAS) token. You should then use this SAS token in your application to interact with Azure Storage.
We followed the steps mentioned in "Sideload an Office Add-in on Office online" to work custom function for desktop or online users but still custom functions not appearing for both. Manifest file able to upload without any error but function not displaying.
do you get a browser error? i.e. through the console? How are you hosting?
One common issue: you're using a self-signed certificate which is generated by the Office Yeoman generator, you'll need to trust the certifcate. Depending on your custom function project, if it doesn't show a taskpane, you can just navigate to the endpoint, i.e. https://localhost:3000/ and manually trust it. Then sideload the manifest again.
Given that it takes around 24 hours for Google Analytics data to update, this makes it hard to see how data rolls up and is displayed within Google Analytics.
Is there some sort of instant tester, or fast turn around application that allows me to quickly set up custom dimensions/metric within my app and see how they appear?
Options for real time analytics:
Google Realtime Analytics - Built into Google Analytics. To use Google Analytics Realtime, login to your google analytics account and select your web property. Then, on the left hand side click Real-Time->Overview.
GoAccess - If you have access to your web server log files this will give you a real-time view of traffic and does not require anything more than a console access. The really nice things about GoAccess is that it does not rely on any 3rd part services and has the ability to run in real-time or generate reports. To use GoAccess, first install it on your server using either the package manager or in a local directory using the official Git. Then, if you are running a standard Apache configuration just run the executable with:
# goaccess -f /var/log/apache2/your-website-access.log -a
If you are running a non-standard Apache log configuration (or another web server entirely), then you have to give GoAccess a description of your log file. This can be done in the ~/.goaccessrc file. Refer to the GoAccess documentation for specific descriptors in generating a string that describes your log file lines.
There are also a host of other SAS options like Clicky, GoSquared, or piwik (which is open source).
I built a CRM for a client of mine, and now they've requested an interesting feature:
For each customer record, they have a matching directory of files on their local computer. They want the ability to open that folder in Windows Explorer directly from within the web app (the app doesn't need access to the directory/files; it just has to launch Windows Explorer so that the user can interact with their files).
This is obviously not possible with regular JavaScript running in the browser (thankfully). I thought there might be some way to accomplish this by building a Chrome extension for this purpose, but it seems Chrome extensions/apps can only access a sandboxed filesystem, which doesn't serve my needs at all. Building an NPAPI plugin in out of the question since Chrome is discontinuing support for NPAPI.
File URIs don't solve this problem either. Their display is ugly, there's no drag-and-drop, no big icons/thumbnails, no sorting etc. They want the full capability of the Windows Explorer.
The only viable option I thought of is to create a local node.js server, make a localhost CORS request to that server, and then run an exec command from node.
Any better idea?
One possibility is to register a custom URI protocol handler with the user's operating system, and then your web page can contain links using your custom protocol, such as openfolder://c/path/to/folder This sort of customization is probably most commonly seen in practice with itunes:// links.
A quick Google search led me to this decent looking tutorial: https://support.shotgunsoftware.com/hc/en-us/articles/200213756-How-to-launch-external-applications-using-custom-protocols-rock-instead-of-http-
The downside is that the user will have to run a small installer of some sort in order to set the correct registry entries (or whatever the non-Windows equivalent is for other OSes) and to drop a small script on disk. That would be much lighter-weight than running a node.js server like you proposed, though.
The linked tutorial uses a Python script, but even that is probably overkill for your needs. A batch file would likely suffice.
EDIT: One additional note, please be aware of the security implications of implementing a custom handler like this. Any webpage in any browser can potentially take advantage of your custom protocol, and an attacker would be able to pass arbitrary data to your script. You should take steps to ensure that the script will not accidentally execute arbitrary commands that may be injected by a malicious web page, and that it will only open a folder and nothing else.
That would require each customer to run a node.js server, which seems unrealistic in your case.
You could use File URIs.
Browsers will refuse to open them by default. However, as suggested in this answer, you could ask your customers to install LocalLinks.