From 23b5c1f782a71ae1164470b874543032ccdfee40 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sat, 31 Jan 2015 18:50:26 -0800 Subject: [PATCH] Cleanup usaages of asar: protocol --- atom/renderer/lib/init.coffee | 4 ++-- atom/renderer/lib/web-view/web-view-attributes.coffee | 2 +- atom/renderer/lib/web-view/web-view-constants.coffee | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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.' -- 2.43.0