René's URL Explorer Experiment


Title: Fix interceptLinks() browser behavior and createTemplate() validation by Copilot · Pull Request #30 · bQuery/bQuery · GitHub

Open Graph Title: Fix interceptLinks() browser behavior and createTemplate() validation by Copilot · Pull Request #30 · bQuery/bQuery

X Title: Fix interceptLinks() browser behavior and createTemplate() validation by Copilot · Pull Request #30 · bQuery/bQuery

Description: Addresses review feedback from PR #16 on browser behavior handling and template validation. Changes interceptLinks() browser behavior Guard left-click interception to respect modifier keys (Ctrl/Cmd/Shift/Alt for new tabs) Skip non-MouseEvent, already-prevented events, and non-left-clicks (button !== 0) Preserves middle-click and right-click native behavior createTemplate() validation Validate exactly one root element, rejecting templates with multiple roots Clear error message shows actual element count when validation fails insertContent() beforebegin reversal Reviewed suggestion to add beforebegin to reversal logic Current implementation is correct: insertAdjacentElement('beforebegin', el) naturally maintains order Only afterbegin and afterend require reversal (already implemented) Test Coverage Added comprehensive test coverage for all implemented features: interceptLinks() browser behavior tests (7 tests): Middle-click (button === 1) not intercepted Right-click (button === 2) not intercepted Ctrl+click not intercepted Cmd+click (metaKey) not intercepted Shift+click not intercepted Alt+click not intercepted Already prevented events skipped createTemplate() validation tests (2 tests): Multiple root elements rejected with clear error message Single root element with whitespace properly accepted // Before: intercepted all clicks, breaking Ctrl+click, middle-click interceptLinks(document.body); // After: respects browser conventions if (e.button !== 0) return; // Allow middle/right-click if (e.ctrlKey || e.metaKey) return; // Allow new tab // Before: silently accepted multiple root elements createTemplate(`

A
B
`); // After: validates and throws clear error // Error: Template must contain exactly one root element, found 2. Validation ✅ All 422 tests pass (9 new tests added) ✅ CodeQL security scan: 0 alerts ✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Open Graph Description: Addresses review feedback from PR #16 on browser behavior handling and template validation. Changes interceptLinks() browser behavior Guard left-click interception to respect modifier keys (Ctrl/C...

X Description: Addresses review feedback from PR #16 on browser behavior handling and template validation. Changes interceptLinks() browser behavior Guard left-click interception to respect modifier keys (Ctrl/C...

Opengraph URL: https://github.com/bQuery/bQuery/pull/30

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:2e0d458a-e423-4b7d-51f0-f55f768dcc34
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idD2BC:1528C6:E4AD96:14066F3:6A4E916C
html-safe-nonceca305176c1a15d119e0d5e96395e1afb11b1073d949c69fec953df0e61d7d087
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMkJDOjE1MjhDNjpFNEFEOTY6MTQwNjZGMzo2QTRFOTE2QyIsInZpc2l0b3JfaWQiOiIzNzA3ODExMjY4MzMxMTU1MDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac3fd4ca49f61512e309367ef930bb8b937fa8ad1d7301dd34feb7a4c7d0abe72a
hovercard-subject-tagpull_request:3211973952
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/bQuery/bQuery/pull/30/files
twitter:imagehttps://avatars.githubusercontent.com/in/1143301?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/in/1143301?s=400&v=4
og:image:altAddresses review feedback from PR #16 on browser behavior handling and template validation. Changes interceptLinks() browser behavior Guard left-click interception to respect modifier keys (Ctrl/C...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/bQuery/bQuery git https://github.com/bQuery/bQuery.git
octolytics-dimension-user_id256381806
octolytics-dimension-user_loginbQuery
octolytics-dimension-repository_id1139284244
octolytics-dimension-repository_nwobQuery/bQuery
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1139284244
octolytics-dimension-repository_network_root_nwobQuery/bQuery
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee6a744804e8e70f97b4d5a18a94dcc63db22f97a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/bQuery/bQuery/pull/30/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FbQuery%2FbQuery%2Fpull%2F30%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FbQuery%2FbQuery%2Fpull%2F30%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=bQuery%2FbQuery
Reloadhttps://github.com/bQuery/bQuery/pull/30/files
Reloadhttps://github.com/bQuery/bQuery/pull/30/files
Reloadhttps://github.com/bQuery/bQuery/pull/30/files
Please reload this pagehttps://github.com/bQuery/bQuery/pull/30/files
bQuery https://github.com/bQuery
bQueryhttps://github.com/bQuery/bQuery
Please reload this pagehttps://github.com/bQuery/bQuery/pull/30/files
Notifications https://github.com/login?return_to=%2FbQuery%2FbQuery
Fork 0 https://github.com/login?return_to=%2FbQuery%2FbQuery
Star 1 https://github.com/login?return_to=%2FbQuery%2FbQuery
Code https://github.com/bQuery/bQuery
Issues 0 https://github.com/bQuery/bQuery/issues
Pull requests 0 https://github.com/bQuery/bQuery/pulls
Actions https://github.com/bQuery/bQuery/actions
Security and quality 0 https://github.com/bQuery/bQuery/security
Insights https://github.com/bQuery/bQuery/pulse
Code https://github.com/bQuery/bQuery
Issues https://github.com/bQuery/bQuery/issues
Pull requests https://github.com/bQuery/bQuery/pulls
Actions https://github.com/bQuery/bQuery/actions
Security and quality https://github.com/bQuery/bQuery/security
Insights https://github.com/bQuery/bQuery/pulse
Sign up for GitHub https://github.com/signup?return_to=%2FbQuery%2FbQuery%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FbQuery%2FbQuery%2Fissues%2Fnew%2Fchoose
JosunLPhttps://github.com/JosunLP
developmenthttps://github.com/bQuery/bQuery/tree/development
copilot/sub-pr-16https://github.com/bQuery/bQuery/tree/copilot/sub-pr-16
Conversation 8 https://github.com/bQuery/bQuery/pull/30
Commits 7 https://github.com/bQuery/bQuery/pull/30/commits
Checks 5 https://github.com/bQuery/bQuery/pull/30/checks
Files changed https://github.com/bQuery/bQuery/pull/30/files
Please reload this pagehttps://github.com/bQuery/bQuery/pull/30/files
Fix interceptLinks() browser behavior and createTemplate() validation https://github.com/bQuery/bQuery/pull/30/files#top
Show all changes 7 commits https://github.com/bQuery/bQuery/pull/30/files
fcc21cd Initial plan Copilot Jan 26, 2026 https://github.com/bQuery/bQuery/pull/30/commits/fcc21cd8807bde9c5c5bcf2bbebd88aaf4c38cc9
a15d9c7 Fix interceptLinks() to respect browser behaviors and improve createT… Copilot Jan 26, 2026 https://github.com/bQuery/bQuery/pull/30/commits/a15d9c70c4d140a72a4eef7a739a56966c295595
dd31bcf Simplify createTemplate validation logic Copilot Jan 26, 2026 https://github.com/bQuery/bQuery/pull/30/commits/dd31bcfab804b4d33ac766fc02b4248abbc68a02
ec635b5 Improve comment clarity in createTemplate validation Copilot Jan 26, 2026 https://github.com/bQuery/bQuery/pull/30/commits/ec635b52829f1dcff385654e4ef9910baf4aa1d8
867c163 Improve comment accuracy in validation and event handling Copilot Jan 26, 2026 https://github.com/bQuery/bQuery/pull/30/commits/867c163d42ef4786737c46349be556502a97a22e
df8bf6a Simplify comment for better clarity Copilot Jan 26, 2026 https://github.com/bQuery/bQuery/pull/30/commits/df8bf6aafd3bd008b5866a5ed25a8024f6e2dd91
80a778c Add test coverage for browser behavior guards and template validation Copilot Jan 26, 2026 https://github.com/bQuery/bQuery/pull/30/commits/80a778c736f24aff3c58a3156a24f08b253e07e8
Clear filters https://github.com/bQuery/bQuery/pull/30/files
Please reload this pagehttps://github.com/bQuery/bQuery/pull/30/files
Please reload this pagehttps://github.com/bQuery/bQuery/pull/30/files
links.ts https://github.com/bQuery/bQuery/pull/30/files#diff-125d7e3398caadda51e6b31f74d0520acbb873d1309b6b0b485cbfcd20f38079
mount.ts https://github.com/bQuery/bQuery/pull/30/files#diff-5eea634f2c3b1634f5e9b312110b8106b201680afc3a0cff96f57c56c9ffc6dd
router.test.ts https://github.com/bQuery/bQuery/pull/30/files#diff-56c92063910ea376ca11a7f6c8f093e3a4a58b7635a6fdb53ec7912c5f5be269
view.test.ts https://github.com/bQuery/bQuery/pull/30/files#diff-40c904250da66efa1eb8d2b70c52887ab1577d021cfc85f8653b819922cfe763
src/router/links.tshttps://github.com/bQuery/bQuery/pull/30/files#diff-125d7e3398caadda51e6b31f74d0520acbb873d1309b6b0b485cbfcd20f38079
View file https://github.com/bQuery/bQuery/blob/80a778c736f24aff3c58a3156a24f08b253e07e8/src/router/links.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/30/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/30/files#diff-125d7e3398caadda51e6b31f74d0520acbb873d1309b6b0b485cbfcd20f38079
Please reload this pagehttps://github.com/bQuery/bQuery/pull/30/files
https://github.com/bQuery/bQuery/pull/30/files#diff-125d7e3398caadda51e6b31f74d0520acbb873d1309b6b0b485cbfcd20f38079
src/view/mount.tshttps://github.com/bQuery/bQuery/pull/30/files#diff-5eea634f2c3b1634f5e9b312110b8106b201680afc3a0cff96f57c56c9ffc6dd
View file https://github.com/bQuery/bQuery/blob/80a778c736f24aff3c58a3156a24f08b253e07e8/src/view/mount.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/30/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/30/files#diff-5eea634f2c3b1634f5e9b312110b8106b201680afc3a0cff96f57c56c9ffc6dd
Please reload this pagehttps://github.com/bQuery/bQuery/pull/30/files
https://github.com/bQuery/bQuery/pull/30/files#diff-5eea634f2c3b1634f5e9b312110b8106b201680afc3a0cff96f57c56c9ffc6dd
tests/router.test.tshttps://github.com/bQuery/bQuery/pull/30/files#diff-56c92063910ea376ca11a7f6c8f093e3a4a58b7635a6fdb53ec7912c5f5be269
View file https://github.com/bQuery/bQuery/blob/80a778c736f24aff3c58a3156a24f08b253e07e8/tests/router.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/30/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/30/files#diff-56c92063910ea376ca11a7f6c8f093e3a4a58b7635a6fdb53ec7912c5f5be269
https://github.com/bQuery/bQuery/pull/30/files#diff-56c92063910ea376ca11a7f6c8f093e3a4a58b7635a6fdb53ec7912c5f5be269
tests/view.test.tshttps://github.com/bQuery/bQuery/pull/30/files#diff-40c904250da66efa1eb8d2b70c52887ab1577d021cfc85f8653b819922cfe763
View file https://github.com/bQuery/bQuery/blob/80a778c736f24aff3c58a3156a24f08b253e07e8/tests/view.test.ts
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/bQuery/bQuery/pull/30/{{ revealButtonHref }}
https://github.com/bQuery/bQuery/pull/30/files#diff-40c904250da66efa1eb8d2b70c52887ab1577d021cfc85f8653b819922cfe763
https://github.com/bQuery/bQuery/pull/30/files#diff-40c904250da66efa1eb8d2b70c52887ab1577d021cfc85f8653b819922cfe763
Please reload this pagehttps://github.com/bQuery/bQuery/pull/30/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.