[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:
Rob Wu 2015-03-10 15:22:32 +01:00
parent d95b4e475e
commit adb2f8ae21
6 changed files with 223 additions and 3 deletions

View file

@ -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 };