Skip to content

Commit

Permalink
Merge branch 'hotfix-1.13.9'
Browse files Browse the repository at this point in the history
* hotfix-1.13.9:
  Update version info.
  core: compatible with Firefox 53
  save: fix for drag tab support in Firefox >= 52
  Update for the German message.properties
  Update German language file
  save: code optimization
  save: fix frame number does not start from 1
  • Loading branch information
danny0838 committed Feb 5, 2017
2 parents 0cf54af + cec3bf9 commit b68d34b
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 177 deletions.
4 changes: 3 additions & 1 deletion chrome/content/scrapbook/saver.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function sbContentSaverClass() {
this.elemMapKey = "data-sb-id-" + Date.now();
this.elemMapOrig = [];
this.elemMapClone = [];
this.frameCount = 0;
}

sbContentSaverClass.prototype = {
Expand Down Expand Up @@ -156,6 +157,7 @@ sbContentSaverClass.prototype = {
this.linkURLs = [];
this.elemMapOrig = [];
this.elemMapClone = [];
this.frameCount = 0;
},

// aRootWindow: window to be captured
Expand Down Expand Up @@ -913,7 +915,7 @@ sbContentSaverClass.prototype = {
var tmpRefURL = this.refURLObj;
// retrieve contentDocument from the corresponding real frame
var idx = aNode.getAttribute(this.elemMapKey);
var newFileName = this.saveDocumentInternal(this.elemMapOrig[idx].contentDocument, this.documentName + "_" + (parseInt(idx)+1));
var newFileName = this.saveDocumentInternal(this.elemMapOrig[idx].contentDocument, this.documentName + "_" + (++this.frameCount));
aNode.setAttribute("src", this.escapeURL(newFileName, null, true));
this.refURLObj = tmpRefURL;
} else {
Expand Down
4 changes: 3 additions & 1 deletion chrome/content/scrapbook/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ var sbTreeHandler = {
dataTransfer.dropEffect = "none";
}
} else if (dataTransfer.types.contains("application/x-moz-tabbrowser-tab") ||
dataTransfer.types.contains("text/x-moz-text-internal") ||
dataTransfer.types.contains("text/x-moz-url") ||
dataTransfer.types.contains("text/_moz_htmlcontext")) {
event.preventDefault();
Expand Down Expand Up @@ -182,7 +183,8 @@ var sbTreeHandler = {
var showDetail = dataTransfer.dropEffect == "copy";
// drags a tab from Firefox
// => if it's the current tab, capture/bookmark it
if (dataTransfer.types.contains("application/x-moz-tabbrowser-tab")) {
// since Firefox >= 52, dragging a tab gets only "text/x-moz-text-internal" (originally plus "application/x-moz-tabbrowser-tab")
if (dataTransfer.types.contains("application/x-moz-tabbrowser-tab") || dataTransfer.types.contains("text/x-moz-text-internal")) {
var tab = dataTransfer.mozGetDataAt("application/x-moz-tabbrowser-tab", 0);
if (tab instanceof XULElement && tab.localName == "tab" &&
tab.ownerDocument.defaultView instanceof ChromeWindow &&
Expand Down
Loading

0 comments on commit b68d34b

Please sign in to comment.