File tree Expand file tree Collapse file tree 4 files changed +43
-34
lines changed
foundation/Analytics/tests Expand file tree Collapse file tree 4 files changed +43
-34
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @shopify/hydrogen ' : patch
3+ ---
4+
5+ Update bot detection list and add support for oxygen-do-not-stream-response header
Original file line number Diff line number Diff line change @@ -323,7 +323,10 @@ async function processRequest(
323323 } ) ;
324324 }
325325
326- if ( isBotUA ( url , request . headers . get ( 'user-agent' ) ) ) {
326+ if (
327+ request . headers . get ( 'oxygen-do-not-stream-response' ) === 'true' ||
328+ isBotUA ( url , request . headers . get ( 'user-agent' ) )
329+ ) {
327330 response . doNotStream ( ) ;
328331 }
329332
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import {ClientAnalytics} from '../ClientAnalytics.js';
99// window.location more than once
1010describe ( 'Analytics.client utm' , ( ) => {
1111 it ( 'should process utm search parameters' , async ( done ) => {
12- global . window = Object . create ( window ) ;
12+ // global.window = Object.create(window);
1313 Object . defineProperty ( window , 'location' , {
1414 value : {
1515 search :
Original file line number Diff line number Diff line change 44 * https://github.com/GoogleChrome/rendertron/blob/6f681688737846b28754fbfdf5db173846a826df/middleware/src/middleware.ts#L24-L41
55 */
66const botUserAgents = [
7- 'AdsBot-Google' ,
8- 'AdsBot-Google-Mobile' ,
7+ '360spider' ,
8+ 'adsbot-google' ,
9+ 'adsbot-google-mobile' ,
910 'applebot' ,
10- 'Baiduspider' ,
1111 'baiduspider' ,
12- 'Bytespider' ,
13- '360Spider' ,
14- 'PetalBot' ,
15- 'Yisouspider' ,
12+ 'baiduspider' ,
13+ 'bingbot' ,
1614 'bingbot' ,
17- 'Bingbot' ,
18- 'BingPreview' ,
15+ 'bingpreview' ,
1916 'bitlybot' ,
20- 'Discordbot' ,
21- 'DuckDuckBot' ,
22- 'Embedly' ,
17+ 'bytespider' ,
18+ 'discordbot' ,
19+ 'duckduckbot' ,
20+ 'embedly' ,
2321 'facebookcatalog' ,
2422 'facebookexternalhit' ,
25- 'Google-PageRenderer' ,
26- 'Googlebot' ,
27- 'Googlebot-Image' ,
28- 'Googlebot-News' ,
29- 'Googlebot-Video' ,
23+ 'google-inspectiontool' ,
24+ 'google-pagerenderer' ,
25+ 'googlebot' ,
26+ 'googlebot-image' ,
27+ 'googlebot-news' ,
28+ 'googlebot-video' ,
29+ 'googleother' ,
3030 'googleweblight' ,
3131 'ia_archive' ,
32- 'LinkedInBot' ,
33- 'Mediapartners-Google' ,
32+ 'ia_archiver' ,
33+ 'linkedinbot' ,
34+ 'mediapartners-google' ,
3435 'outbrain' ,
36+ 'petalbot' ,
3537 'pinterest' ,
3638 'quora link preview' ,
3739 'redditbot' ,
3840 'rogerbot' ,
41+ 'seoradar' ,
3942 'showyoubot' ,
40- 'SkypeUriPreview ' ,
41- 'Slackbot ' ,
42- 'Slurp ' ,
43+ 'skypeuripreview ' ,
44+ 'slackbot ' ,
45+ 'slurp ' ,
4346 'sogou' ,
44- 'Storebot-Google ' ,
45- 'TelegramBot ' ,
47+ 'storebot-google ' ,
48+ 'telegrambot ' ,
4649 'tumblr' ,
47- 'Twitterbot' ,
48- 'vkShare' ,
49- 'W3C_Validator' ,
50- 'WhatsApp' ,
50+ 'twitterbot' ,
51+ 'vkshare' ,
52+ 'w3c html2txt' ,
53+ 'w3c_validator' ,
54+ 'whatsapp' ,
5155 'yandex' ,
52-
53- // SEO Tools
54- 'Seoradar' ,
55- 'W3C html2txt' ,
56+ 'yisouspider' ,
5657] ;
5758
5859/**
You can’t perform that action at this time.
0 commit comments