Granting JavaScript access to the clipboard

Bài viết này đã không còn được duy trì, vì vậy nội dung của nó có thể đã bị lỗi thời.

Some websites can benefit from having access to the copy/paste functionality of your system's clipboard. Examples include:

  • Those that use rich text editors (such as a web mail or weblog posting site).
  • Those that copy useful information (like text samples, or maybe images) to the clipboard upon your request.

This article describes how to allow certain websites to access your system's clipboard and describes security and privacy issues this could cause.


Problems caused by unintended clipboard access

There are several types of problems which can happen if a website is able to use your system's clipboard through javascript:

  • A website may erase the clipboard data, which may cause you to lose important data that you had copied previously into the clipboard.
  • A website may change the clipboard data, which may cause different data to be pasted later on instead of the data you intended to paste originally.
  • A website may read the clipboard data, and use them in malicious ways or send them to a third party without your knowledge.

Therefore, you should only permit the websites that you absolutely trust to be able to access the clipboard.


Enabling clipboard access for a website

There is no such functionality built in to Firefox. In addition, there may be third-party Firefox extensions that can help you. For more information on searching for and installing extensions, see Find and install add-ons to add features to Firefox.





Based on information from Granting JavaScript access to the clipboard (mozillaZine KB)

Những người này đã giúp viết bài này:

Illustration of hands

Tình nguyện viên

Phát triển và chia sẻ chuyên môn của bạn với người khác. Trả lời câu hỏi và nâng cao kiến thức cơ bản của chúng tôi.

Tìm hiểu thêm