A few notes for beginners:
- When you save an update of your contentscript file(s), you need to refresh the plugin in your browsers extension directory: chrome://extensions/
- To debug the browser action, you need to right click on it and choose Inspect Popup. This will open a separate Developer Tools window for it.
I did run into a couple of minor issues along the way:
- I started getting warnings in my developer tools console about a jQuery map file missing. I ended up having to download the file it was looking for and include it alongside the jQuery file in my resources.
- I also got some cryptic error when attempting to run the query SELECT Id, Name FROM Case that I posted to the Salesforce StackExchange site. While I thought it had something to do with a CORS issue, it turns out I was querying for the non-existent Name attribute on the Case object…
Overall, the learning experience of putting together a quick proof of concept on Chrome Extensions was enlightening. Getting something to work is pretty basic, and since it is all JavaScript there isn’t much of a ramp up (and Google’s documentation seems pretty good).
The POC itself obviously has a lot of features lacking (and bugs), but it gave me some good ideas on better ways to bring this functionality to users. I’ve actually realized that adding another tab to the Developer Tools would be a much better place to run queries (similar to how the AngularJS Batarang extension is implemented).
If you want to take a look at the source code, I put it on GitHub.
You May Also Enjoy
Identifying conflicts with package folders during a Salesforce DX migration.
Debugging a Lightning Component error when using Integers as server-side parameters.
Easy to remember query to identify duplicate data in a field.
Recapping my Dreamforce 16 session and providing resources.