使用--disable-web-security创建Google Chrome快捷方式

时间:2014-06-18 15:59:25

标签: google-chrome

我试图通过jqueryMobile访问一些本地文件,它在forefox和IE中工作正常,但chrome提供了一个安全异常。我可以使用

打开chrome是禁用的安全模式来访问本地文件
C:\Program Files\Chrome\Chrome.exe --disable-web-security

或通过此

运行它
chrome.exe --disable-web-security

但是有什么方法可以在dsktop上创建一个快捷方式,它会在禁用安全模式下打开chrmoe ..?

13 个答案:

答案 0 :(得分:16)

只需克隆桌面上的chrome的快捷方式,然后在快捷方式属性中添加参数--disable-web-security(和--user-data-dir)在chrome可执行路径的末尾

例如

"C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir="C:\tmpChromeSession"

编辑#1:我更改了谷歌浏览器路径,旧的路径不正确。 我刚刚在安装了新Chrome的XP上尝试过,但是我收到一条错误消息,表明此标志不受支持。

编辑#2:http://peter.sh/experiments/chromium-command-line-switches/

答案 1 :(得分:7)

首先搜索Run,然后尝试:

chrome.exe --user-data-dir="C:/Chrome dev session" --disable-web-security 

答案 2 :(得分:5)

只需快速更新,现在您不仅需要--disable-web-security而且还需要--user-data-dir 把它们加起来: "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --disable-web-security --user-data-dir

答案 3 :(得分:2)

它正常工作您必须在一个空格后在目标位置添加该参数 - disable-web-security

答案 4 :(得分:2)

您必须使用以下标志

--disable-web-security 
--user-data-dir

但也将路径传递给您的Chrome用户个人资料

见:

https://productforums.google.com/forum/#!topic/chrome/9nHBcjNW384 https://bugs.chromium.org/p/chromium/issues/detail?id=575690

所以现在我已经通过了我的用户个人资料路径:

C:\Users\user\projects\project>"C:\Program Files (x86)\Google\Chrome\App
lication\chrome.exe" --disable-web-security --user-data-dir="C:\Users\user\A
ppData\Local\Google\Chrome\User Data\Default"

答案 5 :(得分:1)

现在是

-disable-web-security --user-data-dir =“ c:/ someFolderName”

答案 6 :(得分:0)

app.use(express.static(__dirname + '/scripts'));

Windows10

答案 7 :(得分:0)

为什么不尝试使用 Safari浏览器?很容易在那禁用网络安全。

只需单击

Develop > Disable Cross-Origin Restrictions

在菜单栏中。

为了获得“开发”菜单,请执行以下操作:

Preferences > Advanced > Show Develop menu in menu bar.

答案 8 :(得分:0)

chrome安全性命令 对于Windows,请打开run-> than粘贴此命令,并确保在运行此命令之前必须关闭所有窗口

“ chrome --disable-web-security --user-data-dir”

答案 9 :(得分:0)

对于Ubuntu,

import tkinter as tk
from tkinter import ttk
from tkinter import Toplevel
from assets import app_settings
from assets.db_functions import get_live_skus


class BulkExtract(Toplevel):
    def __init__(self):
        super().__init__()
        self.transient()
        self.protocol("WM_DELETE_WINDOW", self.__exit)
        self.title('PDS Bulk SKU Extract')
        self.result = []

        mainframe = tk.Frame(self)
        list_frame = tk.Frame(mainframe)

        # Create a Tkinter variable
        self.sku_list = []
        self.check_list = []

        # Loop to create the list of CBs
        try:
            choices = get_live_skus(app_settings.test_db_use)

            self.vsb = tk.Scrollbar(list_frame, orient="vertical")
            self.text = tk.Text(list_frame, width=40, height=20, yscrollcommand=self.vsb.set)
            self.vsb.config(command=self.text.yview)
            self.vsb.pack(side="right", fill="y")
            self.text.pack(side="left", fill="both", expand=True)

            for i in choices:
                v = tk.IntVar()
                cb = ttk.Checkbutton(list_frame, text=i, variable=v)
                cb.var = v
                cb.state(['!alternate'])
                cb.state(['disabled'])
                cb.state(['!disabled'])
                self.sku_list.append(i)
                self.check_list.append(cb)
                self.text.window_create("end", window=cb)
                self.text.insert("end", "\n")  # to force one checkbox per line

            tk.Label(mainframe, text="Select SKUs to extract").grid(row=0, column=0, pady=10)

            pds = tk.Button(mainframe, text='Create the PDS', command=self.get_result)
            pds.config(font=('Arial', 13))
            pds.grid(column=0, row=2)

            list_frame.grid_propagate(True)
            list_frame.grid(row=1, column=0, ipady=15, ipadx=15, pady=(20, 20))
            mainframe.grid_propagate(True)
            mainframe.grid(ipady=15, padx=30)

            # Position the frame
            self.update_idletasks()
            x = (self.winfo_screenwidth() // 2) - (self.winfo_reqwidth() // 2)
            y = (self.winfo_screenheight() // 2) - (self.winfo_reqheight() // 2)

            self.geometry('{}x{}+{}+{}'.format(self.winfo_width(), self.winfo_height(), x, y))

            self.grab_set()
            self.wait_window(self)

        except:
            pass

    def __exit(self):
        self.withdraw()
        self.update_idletasks()
        self.destroy()

    def get_result(self):
        b = 0
        for i in self.check_list:
            if 'selected' in i.state():
                self.result.append(self.sku_list[b])
            b += 1
        self.__exit()

答案 10 :(得分:0)

创建Google Chrome 的Ubuntu Windows10 chrome.exe --disable-web-security --user-data-dir = c:\ my-chrome-data \ data

答案 11 :(得分:0)

转到窗口搜索类型“运行”

然后在运行弹出窗口上

只需粘贴“ chrome.exe --user-data-dir="C:/Chrome dev session" --disable-web-security

好吧||为我工作:)

答案 12 :(得分:0)

对于 MAC (ios)

在终端中运行以下命令。

<块引用>

open -n -a /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --user-data-dir="/tmp/chrome_dev_test" --disable-web-security