문제

Is there a "Find and Replace" function in Chrome Web Inspector? If it exists, where can I find it? I'm using Chrome 26.0.1410.64, if it matters.

도움이 되었습니까?

해결책

Nothing built in natively. There is a Search and Replace plugin that might help if you want to change text in the input fields.

Alternatively if you want to search and replace in the HTML you could Right ClickEdit as HTML the <body> in the DevTools Elements Panel select all the text with Ctrl+a, paste into your favourite editor, make the change there and paste it back.

다른 팁

Taken from this page at labnol.org

While you are on the web page, press Ctrl+Shift+J on Windows or Cmd+Opt+J on Mac to open the Console window inside Chrome Developer tools. Now enter the following commands to replace all occurrences of the word ABC with XYZ.

document.body.innerHTML = document.body.innerHTML.replace(/ABC/g, "XYZ")
document.head.innerHTML = document.head.innerHTML.replace(/ABC/g, "XYZ")

How to show redactions explicitly

Requested by @Cfomodz this my answer builds on the answer of @davem:

While you are on the web page, press Ctrl+Shift+J on Windows or Cmd+Opt+J on Mac to open the Console window inside Chrome Developer tools.

With the help of RegEx you can leave the amount of original characters or even better reduce it to a uniform length (to give even less clues about the original content) with a visible redaction symbol like the unicode "full block" █ (U+2588). For example to redact all email addresses in the body of the HTML use:

document.body.innerHTML = document.body.innerHTML.replace(/[A-Za-z.-]+@[A-Za-z.-]+/g, "███@██████.███")

Check out my RegEx demo to see & try this live.

For search and replace in a file in Sources panel you can use shortcut Ctrl+f

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top