Merge pull request #3602 from operasoftware/master

Make Chrome extension vendor-neutral
This commit is contained in:
Yury Delendik 2013-08-21 13:10:29 -07:00
commit 711cb21f2b
13 changed files with 16 additions and 16 deletions

View File

@ -42,11 +42,11 @@ The Chromium extension is still somewhat experimental but it can be installed tw
ways:
+ [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
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

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

Before

Width:  |  Height:  |  Size: 726 B

After

Width:  |  Height:  |  Size: 726 B

View File

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "PDF Viewer",
"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": {
"128": "icon128.png",
"48": "icon48.png",

24
make.js
View File

@ -32,7 +32,7 @@ var ROOT_DIR = __dirname + '/', // absolute path to project's root
BUILD_WORKER_TARGET = BUILD_DIR + 'pdf.worker.js',
BUILD_TARGETS = [BUILD_TARGET, BUILD_WORKER_TARGET],
FIREFOX_BUILD_DIR = BUILD_DIR + '/firefox/',
CHROME_BUILD_DIR = BUILD_DIR + '/chrome/',
CHROME_BUILD_DIR = BUILD_DIR + '/chromium/',
EXTENSION_SRC_DIR = 'extensions/',
LOCALE_SRC_DIR = 'l10n/',
GH_PAGES_DIR = BUILD_DIR + 'gh-pages/',
@ -144,7 +144,7 @@ target.web = function() {
cp(FIREFOX_BUILD_DIR + '/*.xpi', FIREFOX_BUILD_DIR + '/*.rdf',
GH_PAGES_DIR + EXTENSION_SRC_DIR + 'firefox/');
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('-R', 'test/features', GH_PAGES_DIR);
@ -353,7 +353,7 @@ target.extension = function() {
target.locale();
target.firefox();
target.chrome();
target.chromium();
};
target.buildnumber = function() {
@ -635,13 +635,13 @@ target.b2g = function() {
//
// make chrome
//
target.chrome = function() {
target.chromium = function() {
cd(ROOT_DIR);
echo();
echo('### Building Chrome extension');
echo('### Building Chromium extension');
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/';
target.bundle({ defines: defines });
@ -657,11 +657,11 @@ target.chrome = function() {
defines: defines,
copy: [
[COMMON_WEB_FILES, CHROME_BUILD_CONTENT_DIR + '/web'],
[['extensions/chrome/*.json',
'extensions/chrome/*.html',
'extensions/chrome/*.js',
'extensions/chrome/*.css',
'extensions/chrome/icon*.png',],
[['extensions/chromium/*.json',
'extensions/chromium/*.html',
'extensions/chromium/*.js',
'extensions/chromium/*.css',
'extensions/chromium/icon*.png',],
CHROME_BUILD_DIR],
['external/webL10n/l10n.js', CHROME_BUILD_CONTENT_DIR + '/web'],
['web/viewer.css', CHROME_BUILD_CONTENT_DIR + '/web'],
@ -1073,7 +1073,7 @@ target.lint = function() {
'test/reporter.js',
'test/unit/',
'extensions/firefox/',
'extensions/chrome/'
'extensions/chromium/'
];
var jshintPath = path.normalize('./node_modules/.bin/jshint');