Skip to content
This repository has been archived by the owner on Sep 7, 2024. It is now read-only.

Commit

Permalink
Support Lower Versions of FF/XRE
Browse files Browse the repository at this point in the history
  • Loading branch information
prikhi committed Nov 20, 2016
1 parent ad827dc commit 859f8d7
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 5 deletions.
4 changes: 4 additions & 0 deletions app/application.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ [email protected]
[Gecko]
MinVersion=@MIN_VERSION@
MaxVersion=@MAX_VERSION@

[Goanna]
MinVersion=1.9.1
MaxVersion=9.9.9
14 changes: 14 additions & 0 deletions app/content/pencil/common/compat.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var Compat = {};

var appInfo = Components.classes["@mozilla.org/xre/app-info;1"]
.getService(Components.interfaces.nsIXULAppInfo);

Compat.xre_version = appInfo.platformVersion.split('.')[0];

Compat.saveUri = function(persist, uri, headers, localFile) {
if (Compat.xre_version >= '36') {
persist.saveURI(uri, null, null, null, null, headers, localFile, null);
} else {
persist.saveURI(uri, null, null, null, headers, localFile, null);
}
}
2 changes: 1 addition & 1 deletion app/content/pencil/common/externalEditorSupports.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ ExternalEditorSupports.editImageData = function (imageData, ext, ownerObject) {
persist.progressListener = new PersistProgressListener(callback);

// save the canvas data to the file
persist.saveURI(source, null, null, null, null, file);
Compat.saveUri(persist, source, null, file);
}
}, {
update: function (file) {
Expand Down
2 changes: 1 addition & 1 deletion app/content/pencil/common/svgRasterizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ Rasterizer.prototype.saveURI = function (url, file) {
createInstance(Components.interfaces.nsIWebBrowserPersist);

persist.progressListener = persistListener;
persist.saveURI(uri, null, null, null, null, null, localFile, null);
Compat.saveUri(persist, uri, null, localFile);
};

function PersistProgressListener(callback) {
Expand Down
2 changes: 1 addition & 1 deletion app/content/pencil/common/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -1529,7 +1529,7 @@ Net.downloadAsync = function(url, destPath, listener) {
// do something
}
}*/
persist.saveURI(obj_URI, null, null, null, "", file);
Compat.saveUri(persist, obj_URI, "", file);
};
Util.goDoCommand = function (command, doc) {
var dom = doc ? doc : document;
Expand Down
2 changes: 1 addition & 1 deletion app/content/pencil/firefoxOverlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ PencilOverlay.saveURI = function (url, filePath, callback)
createInstance(Components.interfaces.nsIWebBrowserPersist);

persist.progressListener = persistListener;
persist.saveURI(uri, null, null, null, null, localFile);
Compat.saveUri(persist, uri, null, localFile);
};

function PersistProgressListener(callback)
Expand Down
1 change: 1 addition & 0 deletions app/content/pencil/mainWindow.xul
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<script src="chrome://pencil/content/common/base64.js"/>
<script src="chrome://pencil/content/common/dockingManager.js"/>

<script src="chrome://pencil/content/common/compat.js"/>
<script src="chrome://pencil/content/common/config.js"/>

<script src="chrome://pencil/content/canvasHelper/canvasCareTaker.js"/>
Expand Down
2 changes: 1 addition & 1 deletion build/properties.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export BUILD=`date +%Y%m%d`
export AUTHOR='Pavan Rikhi([email protected]) and Contributors'
export MAINTAINER='Pavan Rikhi <[email protected]>'
export XPI_NAME='Pencil-'$VERSION'-firefox.xpi'
export MIN_VERSION='36.0'
export MIN_VERSION='4.0'
export MAX_VERSION='53.*'
export UPDATE_URL="https://github.com/prikhi/pencil/releases"
export XULRUNNER_XUL="*"

0 comments on commit 859f8d7

Please sign in to comment.