electron/lib/renderer/chrome-api.js

14 lines
291 B
JavaScript
Raw Normal View History

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