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

Brightspace / react-valence-ui-fileviewer / 7111280825

06 Dec 2023 07:04AM CUT coverage: 56.35% (-32.8%) from 89.198%
7111280825

push

github

web-flow
Merge pull request #114 from Brightspace/venkata/node-sass-update-2

adding npm i in release.yml

604 of 1444 branches covered (0.0%)

1624 of 2882 relevant lines covered (56.35%)

11.45 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) {
2!
6

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

14✔
10
        // iOS devices are unable to scroll embedded PDFs
14✔
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;
14✔
15
        }
14✔
16

6✔
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;
8✔
22
        }
8✔
23

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

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

37
        return false;
38

39
}
2✔
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