Qwen Chat Auto-Paste

Paste received string message into the chat.qwen.ai textarea

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Qwen Chat Auto-Paste
// @description  Paste received string message into the chat.qwen.ai textarea
// @match        https://chat.qwen.ai/*
// @version 0.0.1.20250516104227
// @namespace https://greasyfork.org/users/1435046
// ==/UserScript==

(function () {
  window.addEventListener('message', event => {

    if (event.data && event.data.type === 'searchButtonClicked') {

      document.querySelector('i.icon-line-globe-01')?.closest('button')?.click();

      return;
    }

    if (event.data && event.data.type === 'reasonButtonClicked') {

      document.querySelector('i.icon-line-deepthink-01')?.closest('button')?.click();

      return;
    }

    if (event.data?.type === 'newChatButtonClicked') {
      document.querySelector('i.icon-line-message-alert-plus')?.closest('button')?.click();
      return;
    }

    if (event.data.type === 'prompt') {
      const textarea = document.getElementById('chat-input');
      if (textarea) {

const nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLTextAreaElement.prototype, 'value')?.set;
nativeInputValueSetter?.call(textarea, event.data.content);

        textarea.dispatchEvent(new Event('input', { bubbles: true }));
        document.getElementById('send-message-button').click();
      }
    }
  });
})();