From: Cheng Zhao Date: Sun, 1 Feb 2015 02:50:26 +0000 (-0800) Subject: Cleanup usaages of asar: protocol X-Git-Tag: v0.21.1~5^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=23b5c1f782a71ae1164470b874543032ccdfee40;p=electron.git Cleanup usaages of asar: protocol --- diff --git a/atom/renderer/lib/init.coffee b/atom/renderer/lib/init.coffee index b9067746..1d900ad3 100644 --- a/atom/renderer/lib/init.coffee +++ b/atom/renderer/lib/init.coffee @@ -60,8 +60,8 @@ if nodeIntegration in ['true', 'all', 'except-iframe', 'manual-enable-iframe'] global.require = require global.module = module - # Set the __filename to the path of html file if it's file: or asar: protocol. - if window.location.protocol in ['file:', 'asar:'] + # Set the __filename to the path of html file if it is file: protocol. + if window.location.protocol is 'file:' pathname = if process.platform is 'win32' and window.location.pathname[0] is '/' window.location.pathname.substr 1 diff --git a/atom/renderer/lib/web-view/web-view-attributes.coffee b/atom/renderer/lib/web-view/web-view-attributes.coffee index 00d076cd..e4b5dcb4 100644 --- a/atom/renderer/lib/web-view/web-view-attributes.coffee +++ b/atom/renderer/lib/web-view/web-view-attributes.coffee @@ -179,7 +179,7 @@ class PreloadAttribute extends WebViewAttribute return '' unless @webViewImpl.webviewNode.hasAttribute @name preload = resolveUrl @webViewImpl.webviewNode.getAttribute(@name) protocol = preload.substr 0, 5 - unless protocol in ['file:', 'asar:'] + unless protocol is 'file:' console.error webViewConstants.ERROR_MSG_INVALID_PRELOAD_ATTRIBUTE preload = '' preload diff --git a/atom/renderer/lib/web-view/web-view-constants.coffee b/atom/renderer/lib/web-view/web-view-constants.coffee index dd808f68..cda71542 100644 --- a/atom/renderer/lib/web-view/web-view-constants.coffee +++ b/atom/renderer/lib/web-view/web-view-constants.coffee @@ -23,4 +23,4 @@ module.exports = ERROR_MSG_CANNOT_INJECT_SCRIPT: ': ' + 'Script cannot be injected into content until the page has loaded.' ERROR_MSG_INVALID_PARTITION_ATTRIBUTE: 'Invalid partition attribute.' - ERROR_MSG_INVALID_PRELOAD_ATTRIBUTE: 'Only "file:" or "asar:" protocol is supported in "preload" attribute.' + ERROR_MSG_INVALID_PRELOAD_ATTRIBUTE: 'Only "file:" protocol is supported in "preload" attribute.'