Merge pull request #3602 from operasoftware/master
Make Chrome extension vendor-neutral
This commit is contained in:
commit
711cb21f2b
@ -42,11 +42,11 @@ The Chromium extension is still somewhat experimental but it can be installed tw
|
|||||||
ways:
|
ways:
|
||||||
|
|
||||||
+ [Unofficial Version](https://chrome.google.com/webstore/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm) - *This extension is maintained by a PDF.js contributor.*
|
+ [Unofficial Version](https://chrome.google.com/webstore/detail/pdf-viewer/oemmndcbldboiebfnladdacbdfmadadm) - *This extension is maintained by a PDF.js contributor.*
|
||||||
+ Build Your Own - Get the code as explained below and issue `node make extension`. Then open
|
+ Build Your Own - Get the code as explained below and issue `node make chromium`. Then open
|
||||||
Chrome, go to `Tools > Extension` and load the (unpackaged) extension from the
|
Chrome, go to `Tools > Extension` and load the (unpackaged) extension from the
|
||||||
directory `build/chrome`.
|
directory `build/chromium`.
|
||||||
|
|
||||||
The version of the extension for the Opera browser can be found at the [Opera add-ons](https://addons.opera.com/en/extensions/details/pdf-viewer/).
|
The version of the extension for the Opera browser can be found at the [Opera add-ons catalog](https://addons.opera.com/en/extensions/details/pdf-viewer/).
|
||||||
|
|
||||||
## Getting the Code
|
## Getting the Code
|
||||||
|
|
||||||
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
Before Width: | Height: | Size: 726 B After Width: | Height: | Size: 726 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "PDF Viewer",
|
"name": "PDF Viewer",
|
||||||
"version": "PDFJSSCRIPT_VERSION",
|
"version": "PDFJSSCRIPT_VERSION",
|
||||||
"description": "Uses HTML5 to display PDF files directly in Chrome.",
|
"description": "Uses HTML5 to display PDF files directly in the browser.",
|
||||||
"icons": {
|
"icons": {
|
||||||
"128": "icon128.png",
|
"128": "icon128.png",
|
||||||
"48": "icon48.png",
|
"48": "icon48.png",
|
24
make.js
24
make.js
@ -32,7 +32,7 @@ var ROOT_DIR = __dirname + '/', // absolute path to project's root
|
|||||||
BUILD_WORKER_TARGET = BUILD_DIR + 'pdf.worker.js',
|
BUILD_WORKER_TARGET = BUILD_DIR + 'pdf.worker.js',
|
||||||
BUILD_TARGETS = [BUILD_TARGET, BUILD_WORKER_TARGET],
|
BUILD_TARGETS = [BUILD_TARGET, BUILD_WORKER_TARGET],
|
||||||
FIREFOX_BUILD_DIR = BUILD_DIR + '/firefox/',
|
FIREFOX_BUILD_DIR = BUILD_DIR + '/firefox/',
|
||||||
CHROME_BUILD_DIR = BUILD_DIR + '/chrome/',
|
CHROME_BUILD_DIR = BUILD_DIR + '/chromium/',
|
||||||
EXTENSION_SRC_DIR = 'extensions/',
|
EXTENSION_SRC_DIR = 'extensions/',
|
||||||
LOCALE_SRC_DIR = 'l10n/',
|
LOCALE_SRC_DIR = 'l10n/',
|
||||||
GH_PAGES_DIR = BUILD_DIR + 'gh-pages/',
|
GH_PAGES_DIR = BUILD_DIR + 'gh-pages/',
|
||||||
@ -144,7 +144,7 @@ target.web = function() {
|
|||||||
cp(FIREFOX_BUILD_DIR + '/*.xpi', FIREFOX_BUILD_DIR + '/*.rdf',
|
cp(FIREFOX_BUILD_DIR + '/*.xpi', FIREFOX_BUILD_DIR + '/*.rdf',
|
||||||
GH_PAGES_DIR + EXTENSION_SRC_DIR + 'firefox/');
|
GH_PAGES_DIR + EXTENSION_SRC_DIR + 'firefox/');
|
||||||
cp(CHROME_BUILD_DIR + '/*.crx', FIREFOX_BUILD_DIR + '/*.rdf',
|
cp(CHROME_BUILD_DIR + '/*.crx', FIREFOX_BUILD_DIR + '/*.rdf',
|
||||||
GH_PAGES_DIR + EXTENSION_SRC_DIR + 'chrome/');
|
GH_PAGES_DIR + EXTENSION_SRC_DIR + 'chromium/');
|
||||||
cp('web/index.html.template', GH_PAGES_DIR + '/index.html');
|
cp('web/index.html.template', GH_PAGES_DIR + '/index.html');
|
||||||
cp('-R', 'test/features', GH_PAGES_DIR);
|
cp('-R', 'test/features', GH_PAGES_DIR);
|
||||||
|
|
||||||
@ -353,7 +353,7 @@ target.extension = function() {
|
|||||||
|
|
||||||
target.locale();
|
target.locale();
|
||||||
target.firefox();
|
target.firefox();
|
||||||
target.chrome();
|
target.chromium();
|
||||||
};
|
};
|
||||||
|
|
||||||
target.buildnumber = function() {
|
target.buildnumber = function() {
|
||||||
@ -635,13 +635,13 @@ target.b2g = function() {
|
|||||||
//
|
//
|
||||||
// make chrome
|
// make chrome
|
||||||
//
|
//
|
||||||
target.chrome = function() {
|
target.chromium = function() {
|
||||||
cd(ROOT_DIR);
|
cd(ROOT_DIR);
|
||||||
echo();
|
echo();
|
||||||
echo('### Building Chrome extension');
|
echo('### Building Chromium extension');
|
||||||
var defines = builder.merge(DEFINES, {CHROME: true});
|
var defines = builder.merge(DEFINES, {CHROME: true});
|
||||||
|
|
||||||
var CHROME_BUILD_DIR = BUILD_DIR + '/chrome/',
|
var CHROME_BUILD_DIR = BUILD_DIR + '/chromium/',
|
||||||
CHROME_BUILD_CONTENT_DIR = CHROME_BUILD_DIR + '/content/';
|
CHROME_BUILD_CONTENT_DIR = CHROME_BUILD_DIR + '/content/';
|
||||||
|
|
||||||
target.bundle({ defines: defines });
|
target.bundle({ defines: defines });
|
||||||
@ -657,11 +657,11 @@ target.chrome = function() {
|
|||||||
defines: defines,
|
defines: defines,
|
||||||
copy: [
|
copy: [
|
||||||
[COMMON_WEB_FILES, CHROME_BUILD_CONTENT_DIR + '/web'],
|
[COMMON_WEB_FILES, CHROME_BUILD_CONTENT_DIR + '/web'],
|
||||||
[['extensions/chrome/*.json',
|
[['extensions/chromium/*.json',
|
||||||
'extensions/chrome/*.html',
|
'extensions/chromium/*.html',
|
||||||
'extensions/chrome/*.js',
|
'extensions/chromium/*.js',
|
||||||
'extensions/chrome/*.css',
|
'extensions/chromium/*.css',
|
||||||
'extensions/chrome/icon*.png',],
|
'extensions/chromium/icon*.png',],
|
||||||
CHROME_BUILD_DIR],
|
CHROME_BUILD_DIR],
|
||||||
['external/webL10n/l10n.js', CHROME_BUILD_CONTENT_DIR + '/web'],
|
['external/webL10n/l10n.js', CHROME_BUILD_CONTENT_DIR + '/web'],
|
||||||
['web/viewer.css', CHROME_BUILD_CONTENT_DIR + '/web'],
|
['web/viewer.css', CHROME_BUILD_CONTENT_DIR + '/web'],
|
||||||
@ -1073,7 +1073,7 @@ target.lint = function() {
|
|||||||
'test/reporter.js',
|
'test/reporter.js',
|
||||||
'test/unit/',
|
'test/unit/',
|
||||||
'extensions/firefox/',
|
'extensions/firefox/',
|
||||||
'extensions/chrome/'
|
'extensions/chromium/'
|
||||||
];
|
];
|
||||||
|
|
||||||
var jshintPath = path.normalize('./node_modules/.bin/jshint');
|
var jshintPath = path.normalize('./node_modules/.bin/jshint');
|
||||||
|
Loading…
Reference in New Issue
Block a user