Add Extra Information To Copied Content – Copy Text Script

Category: Javascript , Text | April 22, 2022
Author:shayanfalaki
Views Total:112 views
Official Page:Go to website
Last Update:April 22, 2022
License:MIT

Preview:

Add Extra Information To Copied Content – Copy Text Script

Description:

Have you ever wanted to add extra information to the copyright notice of text you were copying from a website? Maybe you wanted to add your name as the author of the article, or maybe even a link to your own website?

Well, now you can. With this tiny Vanilla JavaScript script, you’ll be able to paste copied text with the extra information added without much effort.

How to use it:

1. Load the main JavaScript in the document.

<script src="script.js"></script>

2. Initialize the library and pass the following parameter to the copyText function.

  • showPageLink: Show the URL of the current page
  • copyrightText: Copyright Note 1
  • otherText: Copyright Note 2
  • otherTextPos: “Start” or “end”
  • howToShow: Format the output
/*
copyText(
  showPageLink = true,
  copyrightText = document.title,
  otherText = "",
  otherTextPos = "end",
  howToShow = ["->", "(", ")"]
)
*/
const copy = new copyText(true,"CSS Script Website", " 2022", "end",["->", "(", ")"])

3. Run the script.

copy.run();

You Might Be Interested In:


Leave a Reply