• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Brightspace / react-valence-ui-fileviewer / 7995792934

21 Feb 2024 09:25PM CUT coverage: 56.315% (-0.04%) from 56.35%
7995792934

Pull #117

github

web-flow
Merge c19bfe4c3 into 82efc8be8
Pull Request #117: GAUD-5048 - Use new release token

603 of 1444 branches covered (41.76%)

1623 of 2882 relevant lines covered (56.32%)

5.69 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.42
/src/plugins/pdf/native/supportsNativePdf.js
1
'use strict';
2

3
/*global ActiveXObject*/
4

5
function supportsNativePdf(platform, userAgent) {
1!
6

7
        platform = platform || navigator.platform;
8
        userAgent = userAgent || navigator.userAgent;
9

7✔
10
        // iOS devices are unable to scroll embedded PDFs
7✔
11
        // http://stackoverflow.com/questions/15480804/problems-displaying-pdf-in-iframe-on-mobile-safari
12
        var iOS = /iPad|iPhone|iPod/i.test(platform);
13
        if (iOS) {
14
                return false;
7✔
15
        }
7✔
16

3✔
17
        // Microsoft Edge has not yet implemented the mimeTypes thing, but ships with native PDF support
18
        // http://stackoverflow.com/questions/31793186/detecting-support-for-application-pdf-in-microsoft-edge
19
        var isEdge = /Edge/i.test(userAgent);
20
        if (isEdge) {
21
                return true;
4✔
22
        }
4✔
23

1✔
24
        var mimeType = navigator.mimeTypes['application/pdf'];
25
        if (mimeType) {
26
                return true;
3✔
27
        }
3✔
28

2✔
29
        // for non-Edge IE-based browsers
30
        try {
31
                new ActiveXObject('AcroPDF.PDF');
32
                return true;
1✔
33
        } catch (e) {
1✔
34
                // do nothing
×
35
        }
36

37
        return false;
38

39
}
1✔
40

41
module.exports = supportsNativePdf;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc