xgqfrms / blog

xgqfrms blogs
https://blog.xgqfrms.xyz/app
2 stars 1 forks source link

Chrome & CORS #1

Open xgqfrms-GitHub opened 6 years ago

xgqfrms-GitHub commented 6 years ago

Chrome & CORS

image

https://www.cnblogs.com/xgqfrms/

http://www.cnblogs.com/xgqfrms/p/8327473.html

http://www.cnblogs.com/linda586586/p/4351452.html

xgqfrms-GitHub commented 6 years ago

http://www.cnblogs.com/anonymous-ufo/p/5964781.html

xgqfrms-GitHub commented 6 years ago

CORS


    componentDidMount() {
        // 'Access-Control-Allow-Origin' header 
        // set the request's mode to 'no-cors' 
        // const url = `http://10.1.5.31:8081/http/manage/admin?{"Admin":"report","Action":"GetAllLoad","WriteType":"json"}`;
        const url = `http://localhost:7777/info/`;
        const init = {
            method: 'GET',
            headers: {
                'Accept': 'application/json',
                "Access-Control-Allow-Origin": "*",
                'Content-Type': 'application/json'
            },
            mode: 'no-cors'
        };
        const request_url = new Request(url, init);
        fetch(request_url)
        .then((response) => response.json())
        .then((json)=> {
            console.log(`json = ${json}`);
            console.log(`json.length = ${json.length}`);
            /* json = json.Info;
            console.log(`json.Info = ${json.Info}`);
            console.log(`json.Info.length = ${json.Info.length}`); */
            const datas = json.map(
                (data) => {
                    console.log(`data`, data)
                    return data;
                }
            );
            console.log(`datas = ${JSON.stringify(datas)}`);
            return datas;
        })
        .then((datas)=> {
            console.log(`datas new = ${JSON.stringify(datas)}`);
            return this.setState({
                datas: datas
            });
        });
    }

https://github.com/gildata/RAIO/issues/49

xgqfrms-GitHub commented 6 years ago

--disable-web-security

Chrome CORS

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

"C:\Program Files (x86)\Google\Chrome\Application"

xgqfrms-GitHub commented 6 years ago

chrome://chrome-urls/

https://www.cnblogs.com/laden666666/p/5544572.html

chrome://flags/

xgqfrms-GitHub commented 6 years ago

https://www.w3.org/TR/CSP3/

https://www.w3.org/TR/cors/

https://www.srihash.org/

https://www.w3.org/TR/SRI/

xgqfrms commented 3 years ago

--disable-web-security

Chrome CORS / Chrome 多开,应用分身

https://www.cnblogs.com/xgqfrms/p/9467482.html

image

xgqfrms commented 3 years ago

CORS All In One

https://www.cnblogs.com/xgqfrms/p/13706737.html