You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When having the Subadub plugin together with the MAL-sync-plugin ( extension page, github ), the MAL interface does not appear, and the anime is not recognized by it.
Hi @rsimmons , I believe I know this problem. I met it in in my subadub fork.
The dirty trick of replacing JSON.stringify method fails this way when method stringify is called for recursive object. Such objects sometimes exist in Netflix interface. I fixed it by another dirty trick - callig originalStringify and after that originalParse, which safely convert Netflix recursive object into simple nonrecursive object and after that continues custom JSON.stringify method. There must be some better way to do this. But this works and I do no see significant performance decreace.
const originalStringify = JSON.stringify;
JSON.stringify = function(value) {
if (value === undefined) { // for compatibility JSON.stringify should not raise exception, which will happed if we call originalParse with "undefined" later
return originalStringify.apply(this, arguments);
}
// Many Netflix objects have .toJSON method that findSubtitlesProperty does not handle
// And for cyclic objects will findSubtitlesProperty ends in infinitive recursion, issue #27
// So here we convert object to string and back to JSON-object (that will correctly handle objects with .toJSON methods and cyclic references are removed in this process)
let jsonstring = originalStringify.apply(this, arguments);
value = originalParse.call(this, jsonstring);
// Don't hardcode property names here because Netflix
// changes them a lot; search instead
let prop = findSubtitlesProperty(value);
if (prop) {
prop.unshift(WEBVTT_FMT);
}
return originalStringify.call(this, value);
};
Describe the bug
When having the Subadub plugin together with the MAL-sync-plugin ( extension page, github ), the MAL interface does not appear, and the anime is not recognized by it.
When loading the console, an error appears:
This error only appears when both extensions are running, disabling either one of them makes it disappear.
I have also reported this on the MAL-sync-repo: link.
Steps to reproduce the behavior:
Load both extensions, open Netflix on an anime that MAL-sync normally recognises.
Additional information:
The text was updated successfully, but these errors were encountered: