Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: safari/ext/content.js

Issue 5678590574198784: Prevent Safari from freezing when loading large data: URLs (Closed)
Patch Set: Created March 10, 2014, 6:18 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: safari/ext/content.js
===================================================================
--- a/safari/ext/content.js
+++ b/safari/ext/content.js
@@ -57,6 +57,13 @@
document.addEventListener("beforeload", function(event)
{
+ // we don't block non-HTTP requests anyway, so we can bail out
+ // without asking the background page. This is even necessary
+ // because passing large data (like a photo encoded as data: URL)
+ // to the background page, freezes Safari.
+ if (!/^https?:/.test(event.url))
+ return;
+
var type;
switch(event.target.localName)
{
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld