簡體   English   中英

使用量角器在Firefox中打開文件網址

[英]Using protractor to open file url with Firefox

目前,我正在嘗試(強制)使用量角器作為網站訪問文件(html文件)。 當我嘗試這樣做時,量角器顯示一個錯誤:

    Failed: Access to 'file:///C:/filelocation/index.html' from script denied
    Build info: version: '2.48.2', revision: '41bccdd', time: '2015-10-09 19:59:12'
    System info: host: 'BAHCND4397GQF', ip: '10.138.1.189', os.name: 'Windows 7', os.arch: 'amd64',os.version: '6.1', java.version: '1.8.0_72'
    Driver info: driver.version: unknown

在互聯網上尋找解決方案后,我發現問題是Firefox,其中的簡單說明如下:

    user_pref("capability.policy.policynames", "localfilelinks");
    user_pref("capability.policy.localfilelinks.sites", "C:/MendisSoftwareList/Software%20List/cwmdt-applications-parent/common-parent/index.html");
    user_pref("capability.policy.localfilelinks.checkloaduri.enabled", "allAccess");

到“ user.js”文件。 經過更多研究后,我發現此文件必須在Firefox配置文件中,我正在嘗試使用該文件放置在以下位置:

    C:\Users\userName\AppData\Roaming\Mozilla\Firefox\Profiles\Profile

無濟於事。 坦率地說,我沒有主意。 任何幫助,將不勝感激。 這是我的資源列表:

https://groups.google.com/forum/#!msg/selenium-users/Guh9x4HEWls/pbEjrsq5pXUJ
http://kb.mozillazine.org/User.js_file
https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/6373

提前致謝。

我在這里找到了該問題的部分答案: 用量角器打開文件

滿足我的需求並實現我的目標。

但是,我想聽一聽更深層的答案,以達到我個人和社區的目的,因此,任何其他問題和評論都請隨時提出其他答案或只留在評論中。

謝謝

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM