You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated Chrome documentation gh-codeblock references to point to the current Java, C#, and Ruby examples.
Applied the reference corrections consistently across the English, Japanese, Portuguese, and Simplified Chinese Chrome documentation pages.
Fixed the Chrome DevTools links in the Japanese and Portuguese documentation.
Motivation and Context
Several gh-codeblock line references had drifted from their source examples, causing documentation to display unrelated setup or cleanup code instead of the intended browser configuration and feature examples. This change restores accurate, runnable code snippets.
Types of changes
Change to the site (I have double-checked the Netlify deployment, and my changes look good)
Code example added (and I also added the example to all translated languages)
Improved translation
Added new translation (and I also added a notice to each document missing translation)
Fix Chrome docs gh-codeblock references across translations
📝 Documentation🕐 10-20 Minutes
AI Description
• Correct gh-codeblock line ranges to show intended Chrome option examples.
• Apply the same reference fixes across EN/JA/PT-BR/ZH-CN Chrome docs.
• Fix broken Chrome DevTools links in Japanese and Portuguese pages.
The following are alternative approaches to this PR:
1. Use snippet markers instead of line numbers
➕ Prevents drift when example files change
➕ Makes intent clearer (snippet name conveys purpose)
➕ Reduces maintenance across translations
➖ Requires updating example sources to add markers/comments
➖ May need shortcode support if not already available
2. Extract dedicated snippet files per doc section
➕ Docs references become stable file paths without fragile ranges
➕ Snippets can be kept minimal and purpose-built
➖ Introduces duplication risk between snippets and full examples
➖ More files to manage and keep in sync
3. Add CI validation for gh-codeblock ranges/targets
➕ Catches broken/misaligned references before merge
➕ Scales well as examples evolve
➖ Requires building a validator and maintaining it
➖ May add CI runtime and occasional false positives
Recommendation: The PR’s direct line-range corrections are the right short-term fix and restore accurate snippets immediately. For long-term stability, prefer marker-based snippet inclusion (and optionally a lightweight CI check) to avoid repeated drift across all translated pages whenever example files are edited.
Files changed (4) +128 / -128
Documentation (4) +128 / -128
chrome.en.mdRealign gh-codeblock line ranges for Chrome examples (EN)+30/-30
Realign gh-codeblock line ranges for Chrome examples (EN)
• Updates multiple gh-codeblock references to point at the correct Java, C#, and Ruby lines so rendered snippets match the described Chrome options/features. This fixes snippet drift that previously surfaced unrelated setup/teardown code.
chrome.ja.mdSync Chrome snippet references and fix DevTools link (JA)+33/-33
Sync Chrome snippet references and fix DevTools link (JA)
• Mirrors the EN gh-codeblock reference corrections for Java/C#/Ruby snippets in the Japanese Chrome docs. Also replaces the DevTools mention with a working internal ref link to the CDP/DevTools documentation.
chrome.pt-br.mdSync Chrome snippet references and fix DevTools link (PT-BR)+33/-33
Sync Chrome snippet references and fix DevTools link (PT-BR)
• Applies the same gh-codeblock line-range corrections so PT-BR pages render the intended Chrome examples. Fixes the DevTools section link to reference the CDP/DevTools documentation via Hugo ref.
chrome.zh-cn.mdSync Chrome snippet references across examples (ZH-CN)+32/-32
Sync Chrome snippet references across examples (ZH-CN)
• Updates gh-codeblock references to the current Java/C#/Ruby snippet line ranges in the Simplified Chinese Chrome docs, ensuring the embedded examples match the surrounding guidance.
The “Add extensions” Java gh-codeblock now embeds ChromeTest.java#L72-L76, which references
driver without including the earlier driver/options setup (e.g., `driver = new
ChromeDriver(options);`). This renders an incomplete/misleading excerpt for the “Add an extension to
options” section across English, Japanese, Portuguese, and Simplified Chinese pages.
The docs now reference only #L72-L76 for the Java extension example, but in the referenced source
file driver is created at line 70 and then used at line 73; therefore the embedded excerpt omits
required setup and will render an incomplete snippet.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
### Issue description
The Java code excerpt used in the “Add extensions” section is not self-contained: it shows only the WebExtension install lines but omits the prior options setup and driver creation, while still referencing `driver`.
### Issue Context
`ChromeTest.java#L72-L76` starts after `driver = new ChromeDriver(options);` and therefore the rendered snippet depends on context that readers cannot see.
### Fix Focus Areas
- website_and_docs/content/documentation/webdriver/browsers/chrome.en.md[111-116]
- website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md[110-115]
- website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md[110-115]
- website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md[110-115]
### Suggested fix
Update the Java `gh-codeblock` range to include the missing setup lines (for example, change `#L72-L76` to `#L66-L76`, which includes `ChromeOptions` setup and `driver = new ChromeDriver(options);` before the extension installation). Apply the same range update consistently across all four language pages.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
The “Add extensions” Java gh-codeblock now embeds ChromeTest.java#L72-L76, which references
driver without including the earlier driver/options setup (e.g., `driver = new
ChromeDriver(options);`). This renders an incomplete/misleading excerpt for the “Add an extension to
options” section across English, Japanese, Portuguese, and Simplified Chinese pages.
The docs now reference only #L72-L76 for the Java extension example, but in the referenced source
file driver is created at line 70 and then used at line 73; therefore the embedded excerpt omits
required setup and will render an incomplete snippet.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
### Issue description
The Java code excerpt used in the “Add extensions” section is not self-contained: it shows only the WebExtension install lines but omits the prior options setup and driver creation, while still referencing `driver`.
### Issue Context
`ChromeTest.java#L72-L76` starts after `driver = new ChromeDriver(options);` and therefore the rendered snippet depends on context that readers cannot see.
### Fix Focus Areas
- website_and_docs/content/documentation/webdriver/browsers/chrome.en.md[111-116]
- website_and_docs/content/documentation/webdriver/browsers/chrome.ja.md[110-115]
- website_and_docs/content/documentation/webdriver/browsers/chrome.pt-br.md[110-115]
- website_and_docs/content/documentation/webdriver/browsers/chrome.zh-cn.md[110-115]
### Suggested fix
Update the Java `gh-codeblock` range to include the missing setup lines (for example, change `#L72-L76` to `#L66-L76`, which includes `ChromeOptions` setup and `driver = new ChromeDriver(options);` before the extension installation). Apply the same range update consistently across all four language pages.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
gh-codeblockreferences to point to the current Java, C#, and Ruby examples.Motivation and Context
Several
gh-codeblockline references had drifted from their source examples, causing documentation to display unrelated setup or cleanup code instead of the intended browser configuration and feature examples. This change restores accurate, runnable code snippets.Types of changes
Checklist