If Firefox's "Accept third-party cookies" is disabled, clicking an R-18 manga will show the first page, but the <option>
containing the page list will be empty, and clicking the << or >> buttons will close the manga view.
It seems that XMLHttpRequest does not send the authentication cookie if third-party cookies are disabled.
diff --git a/source/chrome/content/ankpixiv.js b/source/chrome/content/ankpixiv.js
index fd75d62..8a79e37 100644
--- a/source/chrome/content/ankpixiv.js
+++ b/source/chrome/content/ankpixiv.js
@@ -1496,6 +1496,11 @@ try {
let xhr = new XMLHttpRequest();
xhr.open('GET', AnkPixiv.info.path.mangaIndexPage, true);
+ try {
+ xhr.channel.QueryInterface(Ci.nsIHttpChannelInternal).
+ forceAllowThirdPartyCookie = true;
+ }
+ catch(ex) { /* unsupported by this version of FF */ }
xhr.onreadystatechange = function (e) {
if (xhr.readyState == 4 && xhr.status == 200) {
let arr = get(xhr.responseText);
diff --git a/source/chrome/content/ankutils.js b/source/chrome/content/ankutils.js
index f039433..7f1c769 100644
--- a/source/chrome/content/ankutils.js
+++ b/source/chrome/content/ankutils.js
@@ -288,6 +288,12 @@ try {
remoteFileExists: function (url, callback) { // {{{
let xhr = new XMLHttpRequest();
xhr.open('HEAD', url, !!callback);
+ try {
+ xhr.channel.QueryInterface(Ci.nsIHttpChannelInternal).
+ forceAllowThirdPartyCookie = true;
+ }
+ catch(ex) { /* unsupported by this version of FF */ }
+
xhr.onreadystatechange = function (e) {
if (xhr.readyState == 4) {
callback(xhr.status == 200);
@@ -308,6 +314,12 @@ try {
function rfe (callback) {
let xhr = new XMLHttpRequest();
xhr.open('HEAD', url, true);
+ try {
+ xhr.channel.QueryInterface(Ci.nsIHttpChannelInternal).
+ forceAllowThirdPartyCookie = true;
+ }
+ catch(ex) { /* unsupported by this version of FF */ }
+
xhr.onreadystatechange = function (e) {
if (xhr.readyState == 4)
callback(xhr.status);