forked from cadence/breezewiki
		
	Extension now available on Chrome
This commit is contained in:
		
							parent
							
								
									4cbe6fe289
								
							
						
					
					
						commit
						c8401c972c
					
				
					 1 changed files with 17 additions and 10 deletions
				
			
		|  | @ -200,14 +200,21 @@ | ||||||
|      (body (@ (class ,(head-data^-body-class head-data))) |      (body (@ (class ,(head-data^-body-class head-data))) | ||||||
|            ,(if (config-true? 'instance_is_official) |            ,(if (config-true? 'instance_is_official) | ||||||
|                 (let ([balloon '(img (@ (src "/static/three-balloons.png") (class "bw-balloon") (title "Image Source: pngimg.com/image/4955 | License: CC BY-NC 4.0 | Modifications: Resized") (width "52") (height "56")))] |                 (let ([balloon '(img (@ (src "/static/three-balloons.png") (class "bw-balloon") (title "Image Source: pngimg.com/image/4955 | License: CC BY-NC 4.0 | Modifications: Resized") (width "52") (height "56")))] | ||||||
|                       [extension-eligible? (and req (assq 'user-agent (request-headers req)) (string-contains? (string-downcase (cdr (assq 'user-agent (request-headers req)))) "firefox/"))]) |                       [extension-eligible? | ||||||
|  |                        (and req (let* ([ua-pair (assq 'user-agent (request-headers req))] | ||||||
|  |                                        [ua (string-downcase (cdr ua-pair))]) | ||||||
|  |                                   ;; everyone pretends to be chrome, so we do it in reverse | ||||||
|  |                                   ;; this excludes common browsers that don't support the extension | ||||||
|  |                                   (and (not (string-contains? ua "edge/")) | ||||||
|  |                                        (not (string-contains? ua "edg/")) | ||||||
|  |                                        (not (string-contains? ua "mobile")))))]) | ||||||
|                   `(div (@ (class "bw-top-banner")) |                   `(div (@ (class "bw-top-banner")) | ||||||
|                         ,balloon |                         ,balloon | ||||||
|                         (div |                         (div | ||||||
|                          "BreezeWiki is back! Most major wikis are available.\n" |                          "BreezeWiki is back! Most major wikis are available.\n" | ||||||
|                          ,(if extension-eligible? |                          ,(if extension-eligible? | ||||||
|                               '(div (@ (class "bw-top-banner-rainbow")) |                               '(div (@ (class "bw-top-banner-rainbow")) | ||||||
|                                      "Try " (a (@ (href "https://getindie.wiki/")) "our affiliated browser extension") " - redirect to BreezeWiki automatically!\n") |                                     "Try " (a (@ (href "https://getindie.wiki/") (target "_blank")) "our affiliated browser extension") " - redirect to BreezeWiki automatically!\n") | ||||||
|                               "") |                               "") | ||||||
|                          "As always, " (a (@ (href "https://docs.breezewiki.com/Reporting_Bugs.html")) "please go here") " to report problems, suggest features, or talk about the project.") |                          "As always, " (a (@ (href "https://docs.breezewiki.com/Reporting_Bugs.html")) "please go here") " to report problems, suggest features, or talk about the project.") | ||||||
|                         ,balloon)) |                         ,balloon)) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue