user1354399
user1354399

Reputation: 81

Dart lang: How do you browser feature test for file uploading & file reading APIs?

How do you feature test for browser support using Dart? Things that are common to test for in Javascript. It is unfortunately still a necessary evil.

For instance, how do you write a test if the browser supports 'XMLHttpRequestUpload' so that you can fallback to supported features?

Also, how do you test for 'FileReader', 'Worker', 'ArrayBuffer', 'DataView', 'Uint8Array', 'Float32Array', ... ?

In Javascript, you can test if the objects are available in the global namespace (Window, etc).

Upvotes: 1

Views: 391

Answers (1)

Greg Lowe
Greg Lowe

Reputation: 16261

To check if you can access the file system use the FileSystem.supported field. Similarly for workers see Worker.supported.

Since Dart targets IE9+, I think the other API's you've listed are already supported cross browser.

Upvotes: 1

Related Questions