mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +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
|
@ -15,7 +15,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
/* globals chrome, Features */
|
||||
/* globals chrome, Features, saveReferer */
|
||||
|
||||
'use strict';
|
||||
|
||||
|
@ -113,6 +113,9 @@ chrome.webRequest.onHeadersReceived.addListener(
|
|||
|
||||
var viewerUrl = getViewerURL(details.url);
|
||||
|
||||
// Implemented in preserve-referer.js
|
||||
saveReferer(details);
|
||||
|
||||
// Replace frame with viewer
|
||||
if (Features.webRequestRedirectUrl) {
|
||||
return { redirectUrl: viewerUrl };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue