913faac2e4
That is, webRequest is no longer experimental and so it's easier to start (without --enable-experimental-extension-apis).
19 lines
388 B
HTML
19 lines
388 B
HTML
<!doctype html>
|
|
<script>
|
|
chrome.webRequest.onBeforeRequest.addListener(
|
|
function(details) {
|
|
var viewerPage = 'content/web/viewer.html';
|
|
var url = chrome.extension.getURL(viewerPage) + '?file=' + details.url;
|
|
return { redirectUrl: url };
|
|
},
|
|
{
|
|
urls: [
|
|
"http://*/*.pdf",
|
|
"file://*/*.pdf",
|
|
],
|
|
types: [ "main_frame" ]
|
|
},
|
|
["blocking"]);
|
|
</script>
|
|
|