David PHAM-VAN

Add compatibility with web 1.1.0

... ... @@ -33,7 +33,7 @@ jobs:
- name: Run readme tests
run: make test-readme
- name: Verify that nothing changed
run: test -z "$(git status --porcelain)"
run: test -z "$(git status --porcelain | tee /dev/stderr)"
- name: Push to codecov
run: bash <(curl -s https://codecov.io/bash)
- name: Prepare build
... ... @@ -104,7 +104,7 @@ jobs:
- name: Run readme tests
run: make test-readme
- name: Verify that nothing changed
run: test -z "$(git status --porcelain)"
run: test -z "$(git status --porcelain | tee /dev/stderr)"
- name: Push to codecov
run: bash <(curl -s https://codecov.io/bash)
- name: Prepare build
... ...
... ... @@ -27,7 +27,9 @@ import 'format/stream.dart';
import 'format/string.dart';
import 'format/xref.dart';
import 'graphic_state.dart';
import 'io/vm.dart' if (dart.library.js) 'io/js.dart';
import 'io/na.dart'
if (dart.library.io) 'io/vm.dart'
if (dart.library.js_interop) 'io/js.dart';
import 'obj/catalog.dart';
import 'obj/encryption.dart';
import 'obj/font.dart';
... ...
/*
* Copyright (C) 2017, David PHAM-VAN <dev.nfet.net@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import '../format/object_base.dart';
/// Zip compression function
DeflateCallback defaultDeflate = (List<int> a) => a;
/// Computation function
Future<R> pdfCompute<R>(Future<R> Function() computation) async {
await null;
return computation();
}
... ...
... ... @@ -3,6 +3,7 @@
## 5.13.3
- Update gfonts [Minh-Danh]
- Add compatibility with web 1.1.0
## 5.13.2
... ...
... ... @@ -129,10 +129,10 @@ class PrintingPlugin extends PrintingPlatform {
// Restore module and exports
if (module != null) {
web.window['module'] = module;
web.window.module = module;
}
if (exports != null) {
web.window['exports'] = exports;
web.window.exports = exports;
}
}
... ... @@ -192,8 +192,8 @@ class PrintingPlugin extends PrintingPlatform {
}
final userAgent = web.window.navigator.userAgent;
final isChrome = web.window['chrome'] != null;
final isSafari = web.window['safari'] != null &&
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 isFirefox = userAgent.contains('Firefox');
... ... @@ -439,3 +439,8 @@ class _WebPdfRaster extends PdfRaster {
return png;
}
}
extension _WindowModule on web.Window {
external set module(js.JSObject? value);
external set exports(js.JSObject? value);
}
... ...
... ... @@ -15,7 +15,7 @@
*/
import 'dart:async';
import 'dart:io';
import 'dart:io' show Platform;
import 'dart:typed_data';
import 'callback.dart';
... ...