downthemall / anticontainer

DownThemAll! AntiContainer (Extension to a Firefox, Seamonkey extension)
Mozilla Public License 2.0
93 stars 41 forks source link

imgdragon.com #123

Open derbenx opened 7 years ago

derbenx commented 7 years ago

This code seems like it should submit the right variables, I checked against the website source, but it doesn't seem to work. I don't quite understand how this works yet, not enough to see what needs fixing anyway.

It just says <error>, here in an url to test; http://imgdragon.com/s1z8tylem574/068bu_040.jpg.html

{ "type": "sandbox", "prefix": "imgdragon.com", "match": "^http://(www.)?imgdragon\\.com/[\\d\\w]+/.+\\.html", "process": "\"use strict\";\nvar http = new XMLHttpRequest();\nvar url = baseURL;\nvar p1 = new RegExp(\"\\.com/(.+)/\");\nvar m1 = p1.exec(baseURL);\nvar params = \"op=view&id=\"+m1[1]+\"&pre=1&adb=0&next=Continue+to+image...\";\nhttp.open(\"POST\", url, true);\nhttp.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\nhttp.setRequestHeader(\"Content-Length\", params.length);\nhttp.onload = function() {\n\tvar p = new RegExp(\"src=\\\"(.+?)\\\" class=\\\"pic\\\" alt=\\\"(.+?)\\\"\");\n\tvar m = p.exec(http.responseText);\n\tif (m && m.length >= 3) {\n\t\tsetURL(m[1],m[2]);\n\t}\n\telse {\n\t\tmarkGone();\n\t}\n\tfinish();\n};\nhttp.onerror = function() {\n\tmarkGone();\n\tfinish();\n};\nhttp.send(params);\n" }