Skip to content

Commit

Permalink
Merge branch 'hotfix-1.14.1'
Browse files Browse the repository at this point in the history
* hotfix-1.14.1:
  Update version info.
  save: fix <script>s not further processed
  save: handle video[poster]
  save: handle crossorigin
  • Loading branch information
danny0838 committed Oct 4, 2017
2 parents 109ba78 + 3d746a4 commit 0dbb1c4
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
14 changes: 12 additions & 2 deletions chrome/content/scrapbook/saver.js
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,16 @@ sbContentSaverClass.prototype = {
aNode.setAttribute("src", this.getSkippedURL(url));
}
}
if ( aNode.hasAttribute("poster") ) {
if ( this.option["internalize"] && this.isInternalized(aNode.getAttribute("poster")) ) break;
var url = aNode.poster;
if ( this.option["media"] ) {
var fileName = this.download(url);
if (fileName) aNode.setAttribute("poster", fileName);
} else {
aNode.setAttribute("poster", this.getSkippedURL(url));
}
}
break;
case "source": // in <picture>, <audio> and <video>
if ( aNode.hasAttribute("src") ) {
Expand Down Expand Up @@ -779,7 +789,6 @@ sbContentSaverClass.prototype = {
aNode.setAttribute("src", this.getSkippedURL(url));
}
if (aNode.textContent) aNode.textContent = "/* Code removed by ScrapBook */";
return;
}
break;
case "a":
Expand Down Expand Up @@ -943,11 +952,12 @@ sbContentSaverClass.prototype = {
// other specific
this.removeAttr(aNode, "contextmenu");
}
// handle integrity
// handle integrity and crossorigin
// We have to remove integrity check because we could modify the content
// and they might not work correctly in the offline environment.
if ( this.option["removeIntegrity"] ) {
this.removeAttr(aNode, "integrity");
this.removeAttr(aNode, "crossorigin");
}
},

Expand Down
13 changes: 13 additions & 0 deletions doc/releases/1.14.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Scrapbook X 1.14.1
==================

Changes since v1.14.0
---------------------

* Added support to "poster" attribute of <video> elements.

* Remove "crossorigin" attribute to avoid loading failure of
the downloaded resource on some browsers (e.g. Chrome).

* Fixed an issue that <script> elements are escaped from some
processes.
2 changes: 1 addition & 1 deletion install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>[email protected]</em:id>
<em:type>2</em:type>
<em:version>1.14.0</em:version>
<em:version>1.14.1</em:version>
<em:unpack>false</em:unpack>
<em:bootstrap>false</em:bootstrap>
<em:multiprocessCompatible>false</em:multiprocessCompatible>
Expand Down

0 comments on commit 0dbb1c4

Please sign in to comment.