summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormattdangerw <mattdangerw@gmail.com>2014-04-23 14:54:30 -0700
committermattdangerw <mattdangerw@gmail.com>2014-04-23 14:54:30 -0700
commitbd214ae7985d5bc3a495ea32de4f2439561c56a0 (patch)
tree0b6910914378f07aefda09242b9efd7370a5bd19
parent104c504ca529caad5fd7c8bb5f3a4e99176330b2 (diff)
parent11e017bcf333d8c039c1d0fc23374b2293567f85 (diff)
Merge pull request #945 from endlessm/sdk/944
Remove unused code that is causing segfault
-rw-r--r--wikipedia/WikipediaWebView.js21
1 files changed, 0 insertions, 21 deletions
diff --git a/wikipedia/WikipediaWebView.js b/wikipedia/WikipediaWebView.js
index 771a38c..03173b9 100644
--- a/wikipedia/WikipediaWebView.js
+++ b/wikipedia/WikipediaWebView.js
@@ -1,5 +1,4 @@
const Gdk = imports.gi.Gdk;
-const Gio = imports.gi.Gio;
const GLib = imports.gi.GLib;
const Gtk = imports.gi.Gtk;
const GObject = imports.gi.GObject;
@@ -14,21 +13,6 @@ const getPageByTitleURI = "getArticleByTitle?";
const getPageByQueryURI = "getTopArticleByQuery?";
const getTitlesByQueryURI = "getArticleTitlesByQuery?";
-// Interpret image:// URIs as wikipedia images
-WebKit.WebContext.get_default().register_uri_scheme('image', function(request) {
- let filename = request.get_uri().slice('image://'.length);
- filename = decodeURI(filename);
- let pictures_dir = request.get_web_view()._getArticleImagesPath();
- let parent = Gio.File.new_for_path(pictures_dir);
- let file = parent.get_child(filename);
- try {
- let stream = file.read(null);
- request.finish(stream, -1, 'image/png');
- } catch (err) {
- let stream = new Gio.MemoryInputStream();
- request.finish(stream, 0, 'image/png');
- }
-});
const WikipediaWebView = new Lang.Class({
Name: 'EndlessWikipediaWebView',
@@ -124,11 +108,6 @@ const WikipediaWebView = new Lang.Class({
this.run_javascript(script, null, this.scriptFinished, null);
},
- _getArticleImagesPath: function() {
- let cur_exec = this.get_toplevel().get_application().application_base_path;
- return cur_exec + "/web_view/article_images/";
- },
-
_onNavigation: function(webview, decision, decision_type) {
if (decision_type == WebKit.PolicyDecisionType.NAVIGATION_ACTION) {
let uri = decision.request.uri;