This repository was archived by the owner on Jan 25, 2023. It is now read-only.
File tree 4 files changed +32
-0
lines changed
tests/BrowserDetector/Tests/_files 4 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 1
1
# CHANGELOG
2
2
3
+ ## 6.1.2 (released 2016-12-13)
4
+
5
+ - Added wkhtmltopdf detection
6
+
3
7
## 6.1.1 (released 2016-12-13)
4
8
5
9
- Added Samsung Browser detection
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ class Browser
25
25
const MOZILLA = 'Mozilla ' ;
26
26
const AMAYA = 'Amaya ' ;
27
27
const LYNX = 'Lynx ' ;
28
+ const WKHTMLTOPDF = 'wkhtmltopdf ' ;
28
29
const SAFARI = 'Safari ' ;
29
30
const SAMSUNG_BROWSER = 'SamsungBrowser ' ;
30
31
const CHROME = 'Chrome ' ;
Original file line number Diff line number Diff line change @@ -53,6 +53,8 @@ class BrowserDetector implements DetectorInterface
53
53
'Gsa ' ,
54
54
// common bots
55
55
'Robot ' ,
56
+ // wkhtmltopdf before Safari
57
+ 'Wkhtmltopdf ' ,
56
58
// WebKit base check (post mobile and others)
57
59
'Safari ' ,
58
60
// everyone else
@@ -899,6 +901,20 @@ public static function checkBrowserAmaya()
899
901
return false ;
900
902
}
901
903
904
+ /**
905
+ * Determine if the browser is Safari.
906
+ *
907
+ * @return bool
908
+ */
909
+ public static function checkBrowserWkhtmltopdf ()
910
+ {
911
+ if (stripos (self ::$ userAgentString , 'wkhtmltopdf ' ) !== false ) {
912
+ self ::$ browser ->setName (Browser::WKHTMLTOPDF );
913
+ return true ;
914
+ }
915
+
916
+ return false ;
917
+ }
902
918
/**
903
919
* Determine if the browser is Safari.
904
920
*
Original file line number Diff line number Diff line change 263
263
Mozilla/5.0 (Linux; Android 5.1.1; SAMSUNG SM-G360T1 Build/LMY47X) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/3.3 Chrome/38.0.2125.102 Mobile Safari/537.36
264
264
</field >
265
265
</string >
266
+ <string >
267
+ <field name =" browser" >wkhtmltopdf</field >
268
+ <field name =" version" >unknown</field >
269
+ <field name =" os" >Linux</field >
270
+ <field name =" os_version" >unknown</field >
271
+ <field name =" device" >unknown</field >
272
+ <field name =" device_version" >unknown</field >
273
+ <field name =" string" >
274
+ Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko) wkhtmltopdf-amd64 Safari/534.34
275
+ </field >
276
+ </string >
266
277
</strings >
267
278
</document >
You can’t perform that action at this time.
0 commit comments