Commit Graph

130 Commits

Author SHA1 Message Date
Nicolò Ribaudo
4197f6a284
Add note about running npm install on MacOS 2024-01-10 15:21:15 +01:00
Jonas Jenwald
e96c89d7a1 Tweak the README slightly
- Update the "Getting the Code" section to specifically mention Mozilla Firefox, since while the development viewer *works* it may look slightly "broken" in Chromium-based browsers. (This is caused by a lack of support for unprefixed CSS properties, e.g. `mask-image`, however this does *not* affect the built PDF.js viewer.)

 - Remove the Twitter-link, since that account has not been updated since 2016 (i.e. over seven years ago).
2023-07-04 11:32:25 +02:00
Rob Wu
9aedf00ffe Revert "Temporarily stop listing the official Chrome extension in the main README"
This reverts commit afabbc28c5.
2023-06-26 18:54:11 +02:00
Jonas Jenwald
c0a023eaf9 Update various README files to be less specific about the supported JavaScript features
By being less specific about which *exact* JavaScript features are required for the default vs `legacy` build, we don't need to worry about keeping multiple README files up-to-date.
These README files will now refer back to the FAQ for current browser/environment support information.
2023-01-25 15:46:53 +01:00
Mitchell Gale
8d147b993f
Changed link for "Gulp's getting started guide"
Gulp's getting started guide changed location to https://github.com/gulpjs/gulp/tree/master/docs/getting-started. Link updated in readme to reflect that.
2022-10-30 15:30:42 -07:00
Jonas Jenwald
c1c78f9e8c Reference supported browsers Wiki-page in more README files
I've just updated https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support to hopefully provide better support data, and it cannot hurt to explicitly link that from a couple of places.
2022-09-23 11:06:47 +02:00
Jonas Jenwald
afabbc28c5 Temporarily stop listing the official Chrome extension in the main README
The [official Chrome extension](https://chrome.google.com/webstore/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm) has unfortunately not been updated for *three years*, which means that it's currently missing out on years worth of bug fixes, performance improvements, and new features.
In particular, the Chrome extension suffers from a known bug with non-embedded standard fonts; see issue 13669 for details.

For the time being, this patch proposes that we *temporary* make the following changes:
 - Remove the mention of the official Chrome extension from the main README, since it seems unfortunate to somewhat prominently recommend users an old and partially non-working extension.
 - Don't run the `gulp lint-chromium` task as part of the CI, since in addition to the official extension not having been updated its code is also not being actively maintained.[1]

Once the official Chrome extension has been updated, and it's being actively maintained again, this patch should be simple enough to revert.

---
[1] The last commits, which aren't e.g. linting or general code-maintenance related, happened a year ago now.
2022-09-17 16:29:19 +02:00
Jonas Jenwald
6e31799948 [api-minor] Add the Babel targets-option to avoid transpiling code for unsupported browsers
Currently we simply use the Babel `preset-env` in the `legacy`-builds of the PDF.js library. This has the side-effect of transpiling the code for *very old* browsers/environments, including ones that we (since many years) no longer support which unnecessarily bloats the size of the `legacy`-builds.

For the CSS files we're only targeting *the supported browsers*, and it's thus possible to extend that to also apply to Babel.
One of the most significant changes, with this patch, is that we'll no longer polyfill `async`/`await` in the `legacy`-builds. However, this shouldn't be an issue given the browsers that we currently support in PDF.js; please refer to:
 - https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#faq-support
 - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function#browser_compatibility
2022-08-19 22:19:43 +02:00
Maxim Mazurok
bd5e1a9540
Fix "Good Beginner Bugs" link
Seems like the label was changed and the link needs to be updated
2022-06-17 11:33:07 +10:00
IsaacLK
e003e82c98
Twitter should be capitalized. 2022-05-20 09:36:10 -04:00
Jonas Jenwald
b89595fd20 [api-minor] Remove the, in legacy builds, bundled ReadableStream polyfill
According to the MDN compatibility data, see https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream#browser_compatibility, all browsers that we support have native `ReadableStream` implementations (since quite some time too).

Hence only Node.js is now lagging behind w.r.t. `ReadableStream` support, and its experimental implementation doesn't really help us given the life-span of the LTS releases (see https://en.wikipedia.org/wiki/Node.js#Releases).
It seems quite unfortunate to bundle a `ReadableStream` polyfill in the `legacy` builds when it's unnecessary in browsers, given its overall size, but fortunately we can avoid that by simply listing `web-streams-polyfill` as a dependency for the `pdfjs-dist` library.
2022-02-13 10:15:58 +01:00
Jonas Jenwald
00f8fab8a5 Add support for modern ECMAScript class features
With ESLint 8 we should now finally be able to start using modern `class` features, see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Public_class_fields and https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/Private_class_fields

However, while both ESLint and Acorn now support this, it unfortunately turns out that Escodegen (which we use during building) still lack the necessary support. Looking at https://github.com/estools/escodegen there's not been any updates since last year, and there's also open PRs adding support for these new `class` features.

To avoid blocking usage of these `class` features in the PDF.js code-base, in particular *private* fields/methods, this patch thus proposes that we (hopefully temporarily) switch to an `escodegen` fork that has the necessary support; please see https://www.npmjs.com/package/@javascript-obfuscator/escodegen

While I have no reason to doubt the security of the `escodegen` fork, this patch nonetheless pins the version number. Furthermore, I've also diffed the output of the two `.js`-files in this forked package against the original files without finding anything that looks immediately "dangerous".
2021-10-22 22:01:17 +02:00
Jonas Jenwald
0068dba009 [api-minor] Rename -es5 to -legacy, to reduce confusion over what's actually supported (issue 12976)
*Please note that this will also require some edits of the Wiki.*
2021-02-10 16:01:59 +01:00
Jonas Jenwald
5520737798 Update the main, and pdfjs-dist, README to also include recent ECMAScript features
This adds "optional chaining" and "nullish coalescing" to the list of features needed when using the *modern*, i.e. non-translated/non-polyfilled, build of the PDF.js library.
2021-01-19 17:49:12 +01:00
Jonas Jenwald
abd2346e2a Put less emphasis on "ES5"/"ES6" in the README and other documentation
- Don't explicitly mention "ES5" in https://mozilla.github.io/pdf.js/getting_started/#download, since that's no longer accurate. As-is, this will more than likely give users the wrong impression regarding our *actual* browser support.

 - Reword the "Getting the Code"-section of the README, since an ES6-compatible browser is no longer sufficient for development purposes given our usage of modern ECMAScript features.

 - Update the "Building PDF.js"-section of the README, to explicitly mention both the `gulp generic` and `gulp generic-es5` commands.

Hopefully this will help reduce *some* user confusion, but we should perhaps also consider changing the "-es5"-suffix in our build-scripts and build-folders. (That would however require coming up with a "better" suffix, which might not be trivial.)
2021-01-19 13:02:02 +01:00
Tim van der Meij
0ae10bbacd
Switch the badge in the README from Travis CI to GitHub Actions 2020-12-29 16:32:52 +01:00
Jonas Jenwald
449c7763d5 [api-minor] Only support browsers/environments that have *basic* support for Promise natively
Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise#Browser_compatibility and https://caniuse.com/#feat=promises, all even remotely modern browsers already support *basic* `Promise` functionality natively.

The only reason for keeping the `Promise` polyfill (at all) is to be able to support recent additions to the specification, such as e.g. `finally` and `allSettled`.
Note that this patch will, on its own, remove support for IE 11/Edge (non-Chromium based) in both the general PDF.js library and the default viewer.
2020-09-06 13:45:56 +02:00
Sylvestre Ledru
529062a61b
Replace Mozilla Labs by just Mozilla
Mozilla labs isn't a thing
2020-06-29 17:48:35 +02:00
Jonas Jenwald
5234c22c29 Remove any mention of Gitpod from the README (issue 11732)
- Since the Gitpod contributing work-flow is, from the PDF.js project perspective, completely unsupported we don't want to mention it in such a highly visible way as the README file.

 - Since Gitpod is a commercial service, we probably want to avoid *potentially* being seen as advertising and/or endorsing it by mentioning it (somewhat prominently) in the PDF.js README file.

 - By leaving the actual Gitpod files in the repository, for now, this should thus avoid outright breaking things for any existing users.
2020-04-11 16:47:27 +02:00
Brendan Dahl
e6d8899827
Merge pull request #11590 from brendandahl/riot
Update links from IRC to Riot.
2020-02-28 09:09:29 -08:00
Brendan Dahl
594a8dfac4 Update links from IRC to Matrix.
Mozilla's IRC is going away and we're migrating to Matrix/Riot.
2020-02-27 16:26:17 -08:00
Jonas Jenwald
ac6bb2e103 Attempt to clarify, and improve the wording of, the Gitpod section of the README 2020-02-26 13:50:22 +01:00
Jonas Jenwald
e242cfdd9b Attempt to improve/clarify the "Online demo" section of the README
Hopefully this will help, now that there's *two* version of the viewer available.
2020-02-18 12:38:41 +01:00
Jonas Jenwald
c97c778f8f [api-minor] Produce non-translated/non-polyfilled builds by default 2020-02-14 18:12:07 +01:00
Nisar Hassan Naqvi
b21a341332 Simplifies code contributions by automating the dev setup with gitpod.io 2019-11-06 04:12:19 +00:00
Mehdi Vasigh
18b1d636a0 Add links to PDF.js homepage and API reference in README.md 2019-04-17 23:37:37 +02:00
Kevin Jiang
c4ac6ad431
Add Build Status Button
Add build Status button so that it's easy to see if pdf.js passed tests or not.
2018-10-13 18:26:48 -04:00
Tim van der Meij
6d85c7e41a
Use HTTPS for links in README.md 2018-09-09 17:57:12 +02:00
Per Lundberg
82f1d3c82a
README.md: suggest usage of https instead of git protocol
The `git` protocol is unencrypted which means other parties could potentially eavesdrop your traffic. `https` or `ssh` is often encouraged because of this. (For example, the Ruby package manager `bundler` prints a warning when `git` sources are being used.)
2018-07-27 23:26:59 +03:00
RonLek
8afc4ce258 Modified Examples to work without systemjs 2018-07-21 16:56:06 +05:30
Brendan Dahl
121e43685f Remove the Firefox extension building code.
Firefox no longer supports this legacy extension and it is a pain to
sync changes from here and mozilla central.
2018-03-30 16:27:50 -07:00
Jonas Jenwald
d1ffd61093 [Firefox addon] Change the minimum supported version to (the current) Firefox Nightly release
At this point in time, trying to keep the development addon compatible with prior Firefox versions is already quite difficult and will become even harder very soon.

Please keep in mind that since Firefox 57, only WebExtensions are allowed/possible to install. The only exceptions are Firefox Nightly, with the `xpinstall.signatures.required` preference[1] set to `false`, and the (as of this writing) current ESR release.[2]

With the current compatibility situation, we thus need to effectively support both Nightly *and* ESR in the addon, while trying to keep up with current/upcoming changes in `mozilla-central`. With old addons no longer being officially supported, the amount of old code being removed/refactored is now increasing quite quickly.

*Please note:* The changes proposed here was to a large extent prompted by bugs such as:
 - https://bugzilla.mozilla.org/show_bug.cgi?id=1431533 (already landed)
 - https://bugzilla.mozilla.org/show_bug.cgi?id=767640 (already landed)
 - https://bugzilla.mozilla.org/show_bug.cgi?id=1432992 (still open)

Upstreaming all of those changes for the `MOZCENTRAL` version of PDF.js, while also keeping the Firefox addon running in older versions of the browser, would quickly become non-trivial.
Since we're using the ruleset from `eslint-plugin-mozilla` for the addon files, which is enforced in `mozilla-central`, we must ensure that the neccessary changes are upstreamed to the PDF.js repo such that the `mozilla-central` version of PDF.js can still be updated without failures.

Trying to feature detect, for the `FIREFOX` build target, some of the changes in the referenced bugs would probably become both quite messy and (not to mention) difficult. E.g. with the upcoming and automatically defined `Cc, Ci, Cu, Cr` variables, any sort of feature detection might be tricky since those need to be defined in the global scope of the files in question.

Finally, given the amount of effort that we'd now need to spend to even attempt to keep the Firefox addon compatible, I just don't think it's worth the effort any more. Especially since the number of people that have, thus far, been doing this work is *very* low and those resources would be better spend elsewhere.
Unfortunately, this probably means that the development addon will no longer be compatible with release versions of Seamonkey. However the README has already mentioned, for quite some time, that support isn't guaranteed.

*In closing:* For all of the reasons mentioned above, I thus propose that we reduce the maintenance burden of the Firefox addon by only supporting the current Firefox Nightly.

---

[1] While the preference exists, and can be toggled, its value is ignored in non-Nightly versions of Firefox.

[2] There's unbranded builds of e.g. the release/beta versions of Firefox, where old and non-WebExtensions addons can be installed. However those builds can probably be assumed to be officially unsupported, and thus not recommended for users.
2018-02-04 14:07:17 +01:00
SehyunRyanPark
095c8a988e
Update README.md
Clarifying what IRC stands for in order to make people understand clearly who want to use relay chat in irc.mozilla.org
2017-11-18 21:29:20 +09:00
Lukas Drgon
c2f1ff48d5 Add CDN link
Add CDN link

Add Popular CDNs

Add popular CDNs (site)

Moving section
2017-10-02 22:14:06 +02:00
Tiago Morais Morgado
60fc8c932a Update README.md 2017-07-23 17:57:19 +01:00
Jonas Jenwald
84d0df2b31 Mention in the "Getting the Code" section of README.md that an ES6 compatible browser is required when using the default viewer with gulp server
The https://github.com/mozilla/pdf.js/wiki/Contributing article has been updated to explicitly mention that an ES6 browser is now a minimum requirement for development.
Since we recently have seen a couple of issues filed which seemed to indicate that people tried to use PDF.js in browsers without full ES6 support, it's probably a good idea to mention this more prominently in the README as well.
2017-06-24 12:36:20 +02:00
Yury Delendik
a18caa730d Adds gulp dist-install command; using pdfjs-dist package in examples. 2017-06-12 10:22:16 -05:00
Jonas Jenwald
cb0391f457 Remove the reference to compatibility.js from the README, since it's included by default in GENERIC builds
Please note that the FAQ (in the Wiki) was already updated to mention that the standalone `compatibility.js` file isn't necessary anymore.
2017-05-22 12:56:27 +02:00
Brendan Dahl
63c472cec8 Remove mailing list information.
The mailing list has become a burden to maintain with all the spam it gets. We have IRC and github for discussion.
2017-02-16 13:36:12 -08:00
Tim van der Meij
fd21ee59a6 Improve the README by removing outdated information 2017-02-11 16:27:34 +01:00
Yury Delendik
fd4428136b Moving interactive examples to jsfiddle.net 2017-02-07 13:11:18 -06:00
Suriyaa Kudo
1446e0e64f Add HTTPS support 2016-11-04 15:55:56 +01:00
Jonas Jenwald
3b9042034b Update README.md to only guarantee Firefox addon compatibility with the current ESR version
To reduced the amount of compatibility code that we need to maintain in the addon, I think that we should be more explicit about which Firefox versions we intend to support. In the future, this should allow us to more quickly remove old compatibility code.
Furthermore, this patch also tries to be more explicit about the addon support for Seamonkey, by defining it in terms of the underlying Firefox version.
2016-06-25 08:59:59 +02:00
Morton Fox
f697d83f59 Update link to CONTRIBUTING.md 2016-05-07 00:10:36 -04:00
Tim van der Meij
9c4bb83f7a Mention web application usage in README.md 2016-04-26 22:13:01 +02:00
Yury Delendik
9798e1007e Introducing gulp. 2016-03-04 09:36:46 -06:00
Tim van der Meij
eeeebe8061 Remove Opera from the README file as they removed the extension 2016-02-14 14:05:20 +01:00
polarbearing
a90991b188 Update README.md to add Seamonkey compatibility 2015-11-19 23:08:28 +01:00
Rob Wu
91a5825b23 Update README (Chrome & Opera section)
The Chrome extension is stable and has been around for a few years, so
the ancient note about the extension being experimental can be removed.
Also be a bit more specific about who maintains the Chrome extension,
to make it easier for external contributors to find who is responsible
for the development and maintenance of the PDF.js Chrome extension.
2015-06-06 16:05:00 +02:00
Tim van der Meij
523fde764b Update README.md with shorter clone command and improved instruction order 2015-05-08 21:31:12 +02:00