소스 검색

Hide the file entry from the list of allowed origins
when access to file urls is disabled

simov 7 년 전
부모
커밋
bade36420a
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 4
      content/options.js

+ 6 - 4
content/options.js

@@ -232,11 +232,13 @@ m.mount(document.querySelector('main'), {
 
         m('ul.mdc-elevation--z2 m-list',
           Object.keys(state.origins).sort().map((origin) =>
-            // ff: access to file:// URLs is not allowed
             (
-              !/Firefox/.test(navigator.userAgent) ||
-              (/Firefox/.test(navigator.userAgent) && origin !== 'file://') ||
-              null
+              (
+                state.file && origin === 'file://' &&
+                // ff: access to file:// URLs is not allowed
+                !/Firefox/.test(navigator.userAgent)
+              )
+              || origin !== 'file://' || null
             ) &&
             m('li',
               m('span', origin.replace(/^(\*|file|http(s)?).*/, '$1')),