electron/lib/renderer/chrome-api.js

14 lines
291 B
JavaScript
Raw Normal View History

2016-03-25 12:57:17 -07:00
const url = require('url')
const chrome = window.chrome = window.chrome || {}
2016-01-11 18:40:23 -08:00
chrome.extension = {
2016-03-25 12:57:17 -07:00
getURL: function (path) {
2016-01-11 18:40:23 -08:00
return url.format({
protocol: window.location.protocol,
2016-01-11 18:40:23 -08:00
slashes: true,
hostname: window.location.hostname,
2016-01-11 18:40:23 -08:00
pathname: path
2016-03-25 12:57:17 -07:00
})
2016-01-11 18:40:23 -08:00
}
2016-03-25 12:57:17 -07:00
}