Chrome extension that extracts a plaintext crash from the Crashlytics tab in Twitter Fabric.
- Install the extension from the Chrome Web Store.
- Navigate to a specific crash within Crashlytics on Twitter Fabric.
Click More details... next to Viewing latest crash to reach a specific crash instance. - Click the blue Crashlytics icon in your status bar.
- Copy the plaintext crash to your clipboard.
If you experience any issues, fret not: the Crashlytics website has probably changed in a minor way and has broken this extension. Please file an issue and I'll take care of it.
Ensure ./node_modules/.bin
is in your path, then run:
npm install
make watch
Follow these instructions
to install an 'unpacked extension' in Chrome. You'll need to point it at the
chrome
subdirectory within the repository.
Bump the version in package.json
and manifest.json
, then run:
npm run prepublish
Upload chrome.zip
to the Chrome Developer Dashboard.
The Chrome Extension development model is a bit wonky, so this was my best attempt to abide by the Principle of Least Privilege and minimize the number of moving parts.
The extension is implemented as a page action. Prior to Chrome 38, these would appear inside the address bar as a contextual aid for the current site. Now, page actions are largely indistinguishable from always-present browser actions, making the choice of page action strictly a matter of legacy.
The extension performs messaging between the following modules:
- When Chrome starts up, it loads the extension and runs
background.js
, which executes in a headless window and observes navigation across all tabs. - When a tab navigates to an eligible URL,
background.js
enables the page action icon. - When the user clicks the page action icon, Chrome loads
popup.html
andpopup.js
. The latter immediately executesinject.js
in the active tab as a content script. - Content scripts do not have direct access to the tab's
window
object but they do have access to the tab's DOM, soinject.js
immediately crafts a simple, stringified script block which it injects into the Crashlytics DOM via ascript
element. - The literal script executes, performs an AJAX request using the current
user's session, and then sends a
unravel:success
orunravel:error
payload toinject.js
viawindow.postMessage
. inject.js
usesstringify.js
to create a plaintext representation of the AJAX payload, which it sends topopup.js
via Chrome Extension messaging.popup.js
manipulates the contents ofpopup.html
to display the plaintext payload.
N.B.: I made an attempt to build a headless extension which copied the payload directly to the system clipboard; however, there appears to be an arbitrary limit on the amount of text which can be programmatically copied. Most crashes exceed this limit, resulting in a silent failure and no text copied.