0

免責事項として、jsの絶対的な初心者。

次のような変数が宣言されているページが存在します。

c="hello"
cd="12345"

そして、ロードするswfによって画像のみを「アクセス可能」にするphp表示スクリプト(それ以外の場合はフラッシュレイヤーの下に隠されています):

 ((("view.php?cid=" + c) + "&cd=") + cd)

したがって、URLは次のようになります

 view.php?cid=hello&cd=12345

これをJavaScriptのブックマークレットに変えることは可能でしょうか?

ありがとう

-A

Sno0pyを明確にするために編集:

どちらのページも私のサイトではありません。ブックマークレットを作成しようとしているサイトです。このページには、さまざまな用途に使用できる flashembed.js がありますが、この場合は、右クリックして画像を保存できないようにするために使用されます (ムービーになり、 php ビュー スクリプトに画像を挿入します)。

ページには、次の html/javascript があります。

<div id="viewer">
    <!-- image is here -->
</div>
<script type="text/javascript">
    flashembed("viewer",
    {src: "overlay.swf"},
    {c: "hello", cd: "123456"}
    );
</script>

#viewer は別の js スクリプトで指定され、c & cd はランダムに生成された画像の識別子です。

overlay.swfこれを行います:

stage.showmenu = false;
loadmovie ((("http://example.com/view.php?cid=" + c) + "&cd=") + cd, _root);
_root.stop();

に移動するhttp://example.com/view.php?cid=hello&cd=123456と、画像の生データが得られます。でも見ることができます<img src="view.php?cid=hello&cd=123456">

cSO: 明確にするために、 と を取得しcdて URL を形成し、上記の だけのページに移動するJavaScript ブックマークレットを使用してください<img src"yadayada">。それが無理なら、連れて行ってurlくれればいいのに。

4

1 に答える 1

1

If c and cd where variables within the scope of the page, you could simply use this bookmarklet:

javascript:document.location = "http://example.com/view.php?cid=" + c + "&cd=" + cd;

However, they are not. They are attributes of anonymous objects passed as parameters to the function flashembed.

If that function then assigned them to variables in a scope that the bookmarklet could access, then you could use those variables instead, but I seriously doubt that it does.

You are basically left then with the only other option, which is to parse the raw HTML of the page (document.documentElement.outerHTML), most likely with a regular expression.

于 2012-04-26T03:05:42.320 に答える