Pixel Pirate #DevToolTips

Chrome for Developers · Beginner ·🔍 RAG & Vector Search ·11mo ago

Key Takeaways

The video demonstrates how to use DevTools to emulate focus styles, test forms with autofill, and resolve backend errors with network overrides, while also leveraging AI assistance to understand and debug JavaScript code.

Full Transcript

Have you ever been on a treasure hunt, sailed a pirate ship, or cracked a secret code? If you haven't achieved those yet, or if you just fancy an adventure, join me for this interactive demo and learn how to emulate focus styles, quickly test forms with autofill, add network overrides, and use AI assistance for sources to crack codes. You can either sit back and enjoy the trip or join me by going to this link. Ready? Then let's set sail. [Music] This is our demo site with four sections in total as part of our adventure. First, we are going to select a ship, file for a permit, then finally exit the harbor, and after a long journey at sea, lift the treasure. UI elements that appear on focus and disappear on losing the same are a pretty widely used UI pattern these days. Just look at those few examples like a filter menu in Gmail, the search results on our documentation site or this popover on Google Maps. As soon as I click anywhere else outside those UI elements, they disappear which makes them difficult to debug. Our demo site also uses ephemeral UI. Let's look into it. To start our journey, we need a proper sea vehicle. So, our demo site prompts us to pick one. In this dropdown, I can choose from a lifesaver, a floating rubber island, a simple rowing boat, luxurious yak, but of course, I go for the majestic console conqueror. Selecting a vessel reveals this new input. Apparently, I need to input the registration number from the left dropdown into this input. Oh, uh, the dropdown closes as soon as I focus the input, but the number is hard to remember. Let's use focus emulation to keep the drop down open. This just makes it show nothing to see here. Clever. It seems like in this application the options are actually only rendered if the full document is focused. Fortunately, I can force document focus too using dev tools. But first, let me verify this is how it actually works. In the console panel by clicking on the I button in the top bar, I can type any valid JavaScript expression which is then live updated as I interact with the page. I want to see the page focus live evaluated. So I type document.h has focus. Now if I switch back and forth between dev tools and the page, I see the value alternating between true and false. This validates my thesis. So I go back to the elements panel to the hover menu and then enable emulate a focused page which makes the options render despite me interacting with dev tools. Now I can copy the registration number into the input and it's confirmed valid. To learn more about focus simulation for the next time you need to debug ephemeral UI elements like this, check this link. Next up, form debugging. We all try to have the customer in mind when building things, but I acknowledge that's difficult. Think about your product. Would I have any difficulties creating an account for your business? Would my German phone number be accepted? Could I enter a German billing address? If yes, awesome. Thank you. But how do you test this to make sure? As an example, take a look at some of Google's office addresses across Germany, India, and the USA. There obviously is quite a difference between the three of them. Would your system support all three equally? DevTools has tools to make testing for this easier without sourcing your own test data or disclosing your own. to continue our journey. The demo site asks me to insert contact information for someone in Mexico. I can't pull that from the top of my head. Usually, I would just now go in and type gibberish, but with so many required fields, that is quite annoying. So, DevTools autofill panel to the rescue. To open the autofill panel, I go to the three dot menu in the top right of DevTools to more tools and then select autofill. This opens the autofill panel in the bottom drawer. In the autofill panel, I can toggle show test addresses. When enabled and now focusing on any of the input fields, the familiar Chrome autofill UI is amended with an additional option, developer tools. This option allows me to fill any form I need to test with privacy safe test data for various regions. And fortunately, there also is a test data set for Mexico. How convenient, right? When selecting Mexico from the drop-down, you see both our permit form and the autofill panel populated. By hovering over various parts of the demo data, the relevant fields get highlighted for me to understand which data goes where. This makes form debugging a breeze and filing for my harbor permit too. Now I'm ready to submit the form. To learn more about the yfill panel, check out this link. And if you get a chance to try it out, let us know what you think. I have bad news. We filled the form and I submitted it. But apparently there is a missing header. That's quite a common problem especially in teams where there is a strict separation between front end and backend teams during development. They might have their own reporting chains, projects and timelines. Sometimes either team works quicker or slower which causes gaps. If you're a front-end engineer waiting on an infrastructure or backend fix, DevTools can help you out. Let's take a look back at our demo site to learn how. After submitting our autofilled form, there is a warning saying the response is missing the signature of the harbor chief. So, the back end hasn't added it. We can use a network override to fix this. Go to the network panel and look for the API request that handles the form submission. API/file permit. Once found, right click on the request and select override headers. In the right hand panel, add the required Harbor Chief signature by copying the key value pair from the warning and pasting it. After the override is added, resubmit the form to finally get your permit granted. To learn more about network overrides and when they are useful in your everyday adventures, check our docs. We have our permit. Now we just need to exit the harbor to finally get to see. Let's see how that goes. In the next section, we see a big heavy door guarding the harbor. Naively, we try clicking the start opening sequence button to open it. Uh-oh, another warning. Apparently, the door is secured by other means. The warning mentions a file called gate.mmin.js. Let's go look at set file to learn more about it. I want to find it in the sources panel. To quickly jump to the file, I open the command pallet using command P. In the pallet, I type gate.mmin.js as spelled out in the warning. Yep, there it is. I press enter to jump to the file in the sources panel. The sources panel shows every file that makes up the pages I'm currently looking at it. For example, since it's a NexJS project, you see the familiar next directory, some images, the main document, and gate.mmin.js. But looking at gate.mmin.js, there are just a bunch of nonsense methods in here that have no use, like a very silly function that does almost nothing or a cosmic ray detector simulator. With AI assistance for sources, we can quickly learn what's actually going on in this file. By either right-clicking on any file in the sources panel and then selecting Ask AI from the context menu, or by pressing the little floating button, we can start a chat with AI assistance. In the AI assistance panel, we can either choose any of the pre-selected prompts or type our own. What does this script do? Sounds like a good start, though. So click the suggested prompt and then hit enter to start a chat. AI assistance explains the door mechanism hides in this file too. By following up in the chat we get a readymade code snippet for pasting in the console. And tada after pasting the door slides open. To learn more about AI assistance for sources and other topics you can chat about in dev tools. Learn more in our docs. Great. Now we can finally embark on our journey at set sail for Treasure Island. Before we get there, let's briefly recap. First, to select our ship, we use focus simulation in the elements panel to inspect a UI that kept disappearing. Then, to file our permit, we use the autofill panel to instantly populate a form with test data and fix a backend error by creating a network override for a missing header. And to open the harbor gate, we used AI assistance to explain an unknown minified script and extract what we needed. You've used some powerful features to get this far. So, the final riddle should be a piece of cake for you. If you want to know what the treasure is, you would now need to get active. Here's the link to the adventure again. Here's a hint. Record a trace in the performance panel if you're stuck. and let us know what the treasure is in the comments below. Thanks for sailing with me and let's see where our next adventure takes us. See you next time. [Music]

Original Description

Set sail with DevTools and become a debugging pirate! Discover techniques for emulating focus styles, testing forms with autofill, and resolving backend errors with network overrides. Plus, learn to leverage Al assistance to crack even the most difficult JavaScript. Resources: Read more about AI assistance → https://goo.gle/4kGvfg4 Learn What’s new in DevTools, Chrome 138 → https://goo.gle/3TujlL5 Watch more DevTools Tips → https://goo.gle/DevToolsTips Subscribe to Chrome for Developers → https://goo.gle/ChromeDevs #ChromeForDevelopers #Chrome Speaker: Matthias Rohmer Products Mentioned: Chrome, Chrome DevTools
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Chrome for Developers · Chrome for Developers · 0 of 60

← Previous Next →
1 Polymer Performance Patterns (The Polymer Summit 2015)
Polymer Performance Patterns (The Polymer Summit 2015)
Chrome for Developers
2 Polymer Power Tools (The Polymer Summit 2015)
Polymer Power Tools (The Polymer Summit 2015)
Chrome for Developers
3 Chrome Dev Summit 2014 – Chrome Case Studies
Chrome Dev Summit 2014 – Chrome Case Studies
Chrome for Developers
4 Web Directions Code 2015 round up
Web Directions Code 2015 round up
Chrome for Developers
5 Maintainable Code - HTTP203
Maintainable Code - HTTP203
Chrome for Developers
6 iron-ajax… wat?! -- Polycasts #26
iron-ajax… wat?! -- Polycasts #26
Chrome for Developers
7 The Guardian - Supercharged
The Guardian - Supercharged
Chrome for Developers
8 ES2015 (next version of JavaScript), Totally Tooling Tips (S2 Ep1)
ES2015 (next version of JavaScript), Totally Tooling Tips (S2 Ep1)
Chrome for Developers
9 #AskPolymer: Rob answers all the questions ever -- Polycasts #27
#AskPolymer: Rob answers all the questions ever -- Polycasts #27
Chrome for Developers
10 The Future of JavaScript - HTTP203
The Future of JavaScript - HTTP203
Chrome for Developers
11 Data Binding 101 -- Polycasts #28
Data Binding 101 -- Polycasts #28
Chrome for Developers
12 The Guardian part 2 - Supercharged
The Guardian part 2 - Supercharged
Chrome for Developers
13 The Future of Web Audio: with Chris Wilson and Chris Lowis
The Future of Web Audio: with Chris Wilson and Chris Lowis
Chrome for Developers
14 Chrome 46: New motion-path animations, client hints and service worker improvements
Chrome 46: New motion-path animations, client hints and service worker improvements
Chrome for Developers
15 Sublime Snippets, Totally Tooling Tips (S2 Ep2)
Sublime Snippets, Totally Tooling Tips (S2 Ep2)
Chrome for Developers
16 #AskPolymer: How do you make the show? -- Polycasts #29
#AskPolymer: How do you make the show? -- Polycasts #29
Chrome for Developers
17 Critical Path CSS, Totally Tooling Tips (S2 Mini Tip #1)
Critical Path CSS, Totally Tooling Tips (S2 Mini Tip #1)
Chrome for Developers
18 Binding to Objects -- Polycasts #30
Binding to Objects -- Polycasts #30
Chrome for Developers
19 Player FM - Supercharged
Player FM - Supercharged
Chrome for Developers
20 Where’s the Designer? #AskPolymer -- Polycasts #31
Where’s the Designer? #AskPolymer -- Polycasts #31
Chrome for Developers
21 Jake Beats Wikipedia - HTTP203
Jake Beats Wikipedia - HTTP203
Chrome for Developers
22 Supercharged Observers! -- Polycasts #32
Supercharged Observers! -- Polycasts #32
Chrome for Developers
23 Jai's Web blog - Supercharged
Jai's Web blog - Supercharged
Chrome for Developers
24 Windows Command-line Tooling, Totally Tooling Tips (S2, Ep4)
Windows Command-line Tooling, Totally Tooling Tips (S2, Ep4)
Chrome for Developers
25 What about internationalization? #AskPolymer -- Polycasts #33
What about internationalization? #AskPolymer -- Polycasts #33
Chrome for Developers
26 Developing for Billions (Chrome Dev Summit 2015)
Developing for Billions (Chrome Dev Summit 2015)
Chrome for Developers
27 Google+ Performance Improvement Comparison
Google+ Performance Improvement Comparison
Chrome for Developers
28 Deploying HTTPS: The Green Lock and Beyond (Chrome Dev Summit 2015)
Deploying HTTPS: The Green Lock and Beyond (Chrome Dev Summit 2015)
Chrome for Developers
29 Progressive Web Apps (Chrome Dev Summit 2015)
Progressive Web Apps (Chrome Dev Summit 2015)
Chrome for Developers
30 Instant Loading with Service Workers (Chrome Dev Summit 2015)
Instant Loading with Service Workers (Chrome Dev Summit 2015)
Chrome for Developers
31 Increase Engagement with Web Push Notifications (Chrome Dev Summit 2015)
Increase Engagement with Web Push Notifications (Chrome Dev Summit 2015)
Chrome for Developers
32 Engaging with the Real World: Web Bluetooth and Physical Web (Chrome Dev Summit 2015)
Engaging with the Real World: Web Bluetooth and Physical Web (Chrome Dev Summit 2015)
Chrome for Developers
33 Asking for Permission: respectful, opinionated UI (Chrome Dev Summit 2015)
Asking for Permission: respectful, opinionated UI (Chrome Dev Summit 2015)
Chrome for Developers
34 Polymer - State of the Union (Chrome Dev Summit 2015)
Polymer - State of the Union (Chrome Dev Summit 2015)
Chrome for Developers
35 Building Progressive Web Apps with Polymer (Chrome Dev Summit 2015)
Building Progressive Web Apps with Polymer (Chrome Dev Summit 2015)
Chrome for Developers
36 Introduction to RAIL (Chrome Dev Summit 2015)
Introduction to RAIL (Chrome Dev Summit 2015)
Chrome for Developers
37 DevTools in 2015: Authoring to the max (Chrome Dev Summit 2015)
DevTools in 2015: Authoring to the max (Chrome Dev Summit 2015)
Chrome for Developers
38 RAIL in the real world (Chrome Dev Summit 2015)
RAIL in the real world (Chrome Dev Summit 2015)
Chrome for Developers
39 #ChromeDevSummit talks are up - W00T! -- Polycast #34
#ChromeDevSummit talks are up - W00T! -- Polycast #34
Chrome for Developers
40 V8 Performance from the Driver's Seat (Chrome Dev Summit 2015)
V8 Performance from the Driver's Seat (Chrome Dev Summit 2015)
Chrome for Developers
41 Quantify and improve real-world RAIL (Chrome Dev Summit 2015)
Quantify and improve real-world RAIL (Chrome Dev Summit 2015)
Chrome for Developers
42 Owning your performance: RAIL (Chrome Dev Summit 2015)
Owning your performance: RAIL (Chrome Dev Summit 2015)
Chrome for Developers
43 HTTP/2 101 (Chrome Dev Summit 2015)
HTTP/2 101 (Chrome Dev Summit 2015)
Chrome for Developers
44 Leadership Panel (Chrome Dev Summit 2015)
Leadership Panel (Chrome Dev Summit 2015)
Chrome for Developers
45 Build Processes, Totally Tooling Tips (S2, Ep 5)
Build Processes, Totally Tooling Tips (S2, Ep 5)
Chrome for Developers
46 Accessibility (Chrome Dev Summit 2015)
Accessibility (Chrome Dev Summit 2015)
Chrome for Developers
47 Binding to Arrays -- Polycasts #35
Binding to Arrays -- Polycasts #35
Chrome for Developers
48 HTTP2 - HTTP203
HTTP2 - HTTP203
Chrome for Developers
49 Chrome 47: Splash Screens, requestIdleCallback and better desktop notifications (New in Chrome)
Chrome 47: Splash Screens, requestIdleCallback and better desktop notifications (New in Chrome)
Chrome for Developers
50 Call For Submissions - Supercharged
Call For Submissions - Supercharged
Chrome for Developers
51 Cross Device Testing, Totally Tooling Tips (S2 Ep6)
Cross Device Testing, Totally Tooling Tips (S2 Ep6)
Chrome for Developers
52 Testing AJAX with Web Component Tester -- Polycasts #37
Testing AJAX with Web Component Tester -- Polycasts #37
Chrome for Developers
53 Slack: Extended Xmas Special - Supercharged
Slack: Extended Xmas Special - Supercharged
Chrome for Developers
54 Browser testing with Travis & Sauce Labs -- Polycasts #38
Browser testing with Travis & Sauce Labs -- Polycasts #38
Chrome for Developers
55 Optimize for production with Vulcanize -- Polycasts #39
Optimize for production with Vulcanize -- Polycasts #39
Chrome for Developers
56 Highlights from Chrome Dev Summit 2015
Highlights from Chrome Dev Summit 2015
Chrome for Developers
57 Chrome 48: Custom buttons in notifications, DevTools Security panel, and Presentation mode
Chrome 48: Custom buttons in notifications, DevTools Security panel, and Presentation mode
Chrome for Developers
58 Crisper: Protecting your Polymer app with CSP -- Polycasts #40
Crisper: Protecting your Polymer app with CSP -- Polycasts #40
Chrome for Developers
59 How do I use Sass with Polymer? #AskPolymer -- Polycasts #41
How do I use Sass with Polymer? #AskPolymer -- Polycasts #41
Chrome for Developers
60 Colors – DevTools Tonight #0 (Pilot)
Colors – DevTools Tonight #0 (Pilot)
Chrome for Developers

This video teaches how to use DevTools and AI assistance to debug and test web applications, covering topics such as focus simulation, form debugging, and network overrides. By following the steps outlined in the video, viewers can improve their debugging skills and learn how to leverage AI assistance to understand and fix complex issues.

Key Takeaways
  1. Emulate a focused page using DevTools
  2. Use autofill panel to test forms
  3. Enable show test addresses in autofill panel
  4. Force document focus using DevTools
  5. Open the autofill panel in DevTools
  6. Toggle show test addresses in the autofill panel
  7. Select a region from the drop-down to populate the form with test data
  8. Hover over various parts of the demo data to understand which data goes where
  9. Submit the form to test it
  10. Click suggested prompt and hit enter to start chat
💡 The video highlights the importance of using DevTools and AI assistance in conjunction to debug and test web applications, and demonstrates how to use these tools to resolve complex issues such as backend errors and minified script explanations.

Related AI Lessons

Understanding the Limits of Linear RAG — and Why Agentic Workflows Are Catching On
Learn the limitations of linear RAG pipelines and how agentic workflows are becoming a popular alternative for more efficient and effective AI workflows
Medium · AI
Understanding the Limits of Linear RAG — and Why Agentic Workflows Are Catching On
Learn why linear RAG pipelines have limitations and how Agentic workflows are becoming a preferred alternative in the industry
Medium · Machine Learning
Why you shouldn’t search your documents directly with AI
Learn why directly searching documents with AI can be inefficient and how retrieval-augmented systems can improve the process
Medium · Programming
Your AI Keeps Making Things Up. RAG Is How You Make It Use Real Facts Instead.
Learn how to use RAG to make your AI provide accurate answers based on real facts instead of making things up
Medium · RAG
Up next
RRF vs DBSF with Qdrant: Hybrid Retrieval Fusion for RAG in Python
Professor Py: AI Engineering
Watch →