uniquejava / blog

My notes regarding the vibrating frontend :boom and the plain old java :rofl.
Creative Commons Zero v1.0 Universal
11 stars 5 forks source link

chrome developer tool #17

Open uniquejava opened 8 years ago

uniquejava commented 8 years ago

解决CORS问题

方法1: 安装chrome插件

安装: https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi

然后在插件中设置需要拦截的URL, 比如: https://gateway.watsonplatform.net/*

方法2: 给chrome加上启动参数(不是很好用)

给chrome browser加上启动参数--args --disable-web-security --user-data-dir解决CORS问题,如下:

#!/bin/bash
set -e

echo starting elasticsearch
elasticsearch -d

echo done.
#todo, kill any existing canary processes.

open http://localhost:8888/xxxx -a "/path/to/Chromium.app" --args --disable-web-security  --user-data-dir
open http://localhost:8100/ -a "/opt/homebrew-cask/Caskroom/google-chrome-canary/latest/Google Chrome Canary.app" --args --disable-web-security --user-data-dir

pbcopy < <(echo yinsb@xxxx.com)

exit 0
uniquejava commented 8 years ago

remote debug android devices

环境: Android 4.4, Chrome 51, MacOS 10.11.5

  1. Connect your android phone to your PC/Macbook. (确保USB调试模式是打开的)
  2. 在chrome浏览器中cmd + shift + j打开chrome developer tools面板
  3. 右上角 ... > more tools > inspect devices ...
  4. 在setting下勾选 Discover USB devices
  5. 左边会列出你的android设备名, 比如: Nexus 5 (connected), 在左侧选中它.
  6. 在android中打开使用了webview的app或者从手机中的浏览器中打开任意网页都会在这个界面中列出来.
  7. 点击insepect按钮, 在弹出的新窗口调试你的设备(地址栏会显示为file:///android_asset/www/index.html).

详见: https://developers.google.com/web/tools/chrome-devtools/debug/remote-debugging/remote-debugging

settings

nexus5

cdt

uniquejava commented 7 years ago

优雅且高效的使用Chrome Developer Tools

上集: http://lin-chao.github.io/2014/10/10/%E4%BC%98%E9%9B%85%E4%B8%94%E9%AB%98%E6%95%88%E7%9A%84%E4%BD%BF%E7%94%A8Chrome-Developer-Tools%E4%B8%8A/

下集: http://lin-chao.github.io/2014/10/15/%E4%BC%98%E9%9B%85%E4%B8%94%E9%AB%98%E6%95%88%E7%9A%84%E4%BD%BF%E7%94%A8Chrome-Developer-Tools%E4%B8%8B/

uniquejava commented 7 years ago

清cache

在打开CDT的情况下, 按住chrome的刷新按钮不放, 会多出个弹出菜单 image

How can I make Chrome stop caching redirects?