0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

URLをまとめて一気に開くTips

Last updated at Posted at 2025-08-28

開発中に検証用のURLをまとめて開きたいときなど、
下記の urls 部分にURLを1行ずつ記載し Chrome Devtool の Console で実行するとまとめて開くことができます。

// URLを改行して記載
const urls = `
https://example.com/1/
https://example.com/2/
https://example.com/3/
https://example.com/4/
https://example.com/5/
`;

const urlArray = urls.trim().split('\n'); // 文字列を改行で分割して配列にする

urlArray.forEach((url) => {
  const trimmedUrl = url.trim(); // 各URLの前後の空白を削除
  if (trimmedUrl) {  // 空文字列でない場合のみ開く
    window.open(trimmedUrl, '_blank');
  }
});

💡 便利な使い方

  1. F12キー等で Chrome DevTools を開く
  2. Sources > Snippets > New snippet で新規スニペットを作成
  3. 上記コードを貼り付けて保存
  4. 下部の Enter で必要なときにスニペットを実行

これで前回の実行内容を保存しておくことができます

スクリーンショット 2025-08-29 1.32.50.png

⚠️ 注意点

実行時に ポップアップブロック が出る場合があります。
その際は、アドレスバー横に出るアイコンをクリックし許可をしてください。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?