From 07928ba263d90326e01a94e554c378d65f095453 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Fri, 12 Jun 2015 23:50:04 -0700 Subject: [PATCH] Support modified third-party cookie behavior. Closes issue #60. --- common/modules/buffer.jsm | 2 +- common/modules/commands.jsm | 10 +++++++--- common/modules/sanitizer.jsm | 3 ++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/common/modules/buffer.jsm b/common/modules/buffer.jsm index 42a404fd..d4818a24 100644 --- a/common/modules/buffer.jsm +++ b/common/modules/buffer.jsm @@ -1572,7 +1572,7 @@ var Buffer = Module("Buffer", { _("buffer.save.altText")]); if (!isinstance(node, Ci.nsIDOMDocument) && node.textContent) - names.push([node.textContent, + names.push([node.textContent.trim(), _("buffer.save.linkText")]); names.push([decodeURIComponent(url.replace(/.*?([^\/]*)\/*$/, "$1")), diff --git a/common/modules/commands.jsm b/common/modules/commands.jsm index ead17c3a..67c82ac1 100644 --- a/common/modules/commands.jsm +++ b/common/modules/commands.jsm @@ -856,14 +856,18 @@ var Commands = Module("commands", { /** @property {string} The last executed Ex command line. */ repeat: null, - add: function add() { + add: function add(names, description, action, extra={}, replace=false) { + let { caller } = Components.stack; + let group = this.builtin; - if (!util.isDactyl(Components.stack.caller)) { + if (!util.isDactyl(caller)) { deprecated.warn(add, "commands.add", "group.commands.add"); group = this.user; } - return apply(group, "_add", arguments); + const { contexts } = this.modules; + extra.definedAt = contexts.getCaller(caller); + return apply(group, "add", arguments); }, addUserCommand: deprecated("group.commands.add", { get: function addUserCommand() this.user.bound._add }), getUserCommands: deprecated("iter(group.commands)", function getUserCommands() iter(this.user).toArray()), diff --git a/common/modules/sanitizer.jsm b/common/modules/sanitizer.jsm index f6f496f1..582dcce9 100644 --- a/common/modules/sanitizer.jsm +++ b/common/modules/sanitizer.jsm @@ -709,7 +709,8 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef values: [ ["all", "Accept all cookies"], ["samesite", "Accept all non-third-party cookies"], - ["none", "Accept no cookies"] + ["none", "Accept no cookies"], + ["visited", "Accept cookies from visited sites"] ], getter: function () (this.values[prefs.get(this.PREF)] || ["all"])[0], setter: function (val) {