mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
[CRX] Add Referer request header if needed
This patch adds the Referer request header to PDF requests if the original PDF request included the Referer header.
This commit is contained in:
parent
d95b4e475e
commit
adb2f8ae21
6 changed files with 223 additions and 3 deletions
|
@ -135,6 +135,10 @@ var PDFHistory = (function () {
|
|||
});
|
||||
},
|
||||
|
||||
clearHistoryState: function pdfHistory_clearHistoryState() {
|
||||
this._pushOrReplaceState(null, true);
|
||||
},
|
||||
|
||||
_isStateObjectDefined: function pdfHistory_isStateObjectDefined(state) {
|
||||
return (state && state.uid >= 0 &&
|
||||
state.fingerprint && this.fingerprint === state.fingerprint &&
|
||||
|
@ -143,6 +147,13 @@ var PDFHistory = (function () {
|
|||
|
||||
_pushOrReplaceState: function pdfHistory_pushOrReplaceState(stateObj,
|
||||
replace) {
|
||||
//#if CHROME
|
||||
// history.state.chromecomState is managed by chromecom.js.
|
||||
if (window.history.state && 'chromecomState' in window.history.state) {
|
||||
stateObj = stateObj || {};
|
||||
stateObj.chromecomState = window.history.state.chromecomState;
|
||||
}
|
||||
//#endif
|
||||
if (replace) {
|
||||
//#if (GENERIC || CHROME)
|
||||
window.history.replaceState(stateObj, '', document.URL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue