From df81ea38155610d084ea7f472f818b5a22a535d7 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Thu, 28 Feb 2013 00:45:14 +0100 Subject: [PATCH] Don't actually use Blob URL'd stylesheets, they don't get cleared automatically when navigating. --- 4chan_x.user.js | 11 +++-------- lib/$.coffee | 11 +++-------- src/features.coffee | 2 +- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 42348d7b8..02c17dac0 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -742,15 +742,10 @@ return setTimeout($.asap, 25, test, cb); } }, - addStyle: function(css, type) { + addStyle: function(css) { var style; - style = type === 'style' || !window.URL ? $.el('style', { + style = $.el('style', { textContent: css - }) : $.el('link', { - rel: 'stylesheet', - href: URL.createObjectURL(new Blob([css], { - type: 'text/css' - })) }); $.asap((function() { return d.head; @@ -4453,7 +4448,7 @@ if (checked) { $.on(window, 'resize', ImageExpand.resize); if (!ImageExpand.style) { - ImageExpand.style = $.addStyle(null, 'style'); + ImageExpand.style = $.addStyle(null); } return ImageExpand.resize(); } else { diff --git a/lib/$.coffee b/lib/$.coffee index 6f84e0feb..d3127ac57 100644 --- a/lib/$.coffee +++ b/lib/$.coffee @@ -88,14 +88,9 @@ $.extend $, cb() else setTimeout $.asap, 25, test, cb - addStyle: (css, type) -> - style = if type is 'style' or !window.URL - $.el 'style', - textContent: css - else - $.el 'link', - rel: 'stylesheet' - href: URL.createObjectURL new Blob([css], type: 'text/css') + addStyle: (css) -> + style = $.el 'style', + textContent: css $.asap (-> d.head), -> $.add d.head, style style diff --git a/src/features.coffee b/src/features.coffee index baeaa2574..a6cfb93d3 100644 --- a/src/features.coffee +++ b/src/features.coffee @@ -2948,7 +2948,7 @@ ImageExpand = if checked $.on window, 'resize', ImageExpand.resize unless ImageExpand.style - ImageExpand.style = $.addStyle null, 'style' + ImageExpand.style = $.addStyle null ImageExpand.resize() else $.off window, 'resize', ImageExpand.resize