Ctrl+KB | toggle side bar |
Ctrl+Shift+P | command prompt |
Ctrl+` | python console |
Ctrl+N | new file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OK, Chrome (and all browsers apart from Firefox) don't support Request.formData(). So, we have to polyfill it | |
if (!Request.formData) { | |
Request.prototype.formData = function() { | |
return this.text().then(text => { | |
const fd = new FormData(), | |
contentType = this.headers.get('content-type'); | |
// The text here may be a URIEncoded string, rather than multipart form | |
// Two different decoding strategies are needed | |
if (contentType.startsWith('multipart/form-data;')) { | |
// multipart/form-data encoding strategy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IndexedDB properties | |
var idbDatabase; | |
const IDB_VERSION = 1, | |
STOP_RETRYING_AFTER = (1000 * 60 * 60 * 24), // One day, in milliseconds. | |
STORE_NAME = 'urls', | |
IDB_NAME = 'offline-analytics'; | |
// These URLs should always be fetched from the server, or page views don't count! | |
const analyticsDomains = [ | |
{ host: 'omniture.adobe.com', pathStart: '/b/ss'}, // Omniture |