Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix additionally form_key element #219

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions xpi/chrome/content/library/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,10 @@ var Tumblr = update({}, AbstractSessionService, {
getInfo() {
return this.getDashboard().addCallback(doc => {
let info = {};
let element = doc.querySelector('input[name="form_key"]');
let element = doc.querySelector('meta[name="tumblr-form-key"]') || doc.querySelector('meta[id="tumblr-form-key"]');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

説明が下手ですみません。

本来なら、input[name="form_key"] はそのままで、
meta[id="tumblr_form_key"] か meta[name="tumblr-form-key"] のどちらかを追加するだけで大丈夫なはずです。

#218 (comment)
で微妙と書いたのは、id の方は _ アンダースコアで、name は - ハイフンになっているところです。

ただ、input[name="form_key"] を残しても、下のコードが element.content だけなので、meta のみを前提にしているので、あまり意味が無いかもしれませんが。


if (element && element.value) {
info.formKey = element.value;
if (element && element.content) {
info.formKey = element.content;

element = doc.querySelector('input[name="t"]');

Expand Down