Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
dart_pdf
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
David PHAM-VAN
2024-10-05 14:35:57 -0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ee6e4adf293e120f8631c06a2ef9a27332d7a53f
ee6e4adf
1 parent
b542e0c5
Improve Web Browser detection logic
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
printing/CHANGELOG.md
printing/lib/printing_web.dart
printing/pubspec.yaml
printing/CHANGELOG.md
View file @
ee6e4ad
# Changelog
## 5.13.4
-
Improve Web Browser detection logic
## 5.13.3
-
Update gfonts
[
Minh-Danh
]
...
...
printing/lib/printing_web.dart
View file @
ee6e4ad
...
...
@@ -191,12 +191,13 @@ class PrintingPlugin extends PrintingPlatform {
return
false
;
}
// UserAgent can contain both Chrome and Safari for Chrome browser.
// UserAgent contains only Safari for Safari browser.
final
userAgent
=
web
.
window
.
navigator
.
userAgent
;
final
isChrome
=
web
.
window
[
'chrome'
].
isUndefinedOrNull
;
final
isSafari
=
web
.
window
[
'safari'
].
isUndefinedOrNull
&&
!
userAgent
.
contains
(
RegExp
(
r'Version/14\.1\.'
));
final
isMobile
=
userAgent
.
contains
(
'Mobile'
);
final
isChrome
=
userAgent
.
contains
(
'Chrome'
);
final
isSafari
=
userAgent
.
contains
(
'Safari'
)
&&
!
isChrome
;
final
isFirefox
=
userAgent
.
contains
(
'Firefox'
);
final
isMobile
=
userAgent
.
contains
(
'Mobile'
);
// Chrome, Safari, and Firefox on a desktop computer
if
((
isChrome
||
isSafari
||
isFirefox
)
&&
!
isMobile
)
{
...
...
printing/pubspec.yaml
View file @
ee6e4ad
...
...
@@ -15,7 +15,7 @@ topics:
-
print
-
printing
-
report
version
:
5.13.
3
version
:
5.13.
4
environment
:
sdk
:
"
>=3.3.0
<4.0.0"
...
...
Please
register
or
login
to post a comment