-3

I am new to coding therefore have no idea how to do this and need some help please.

What I am trying to do is a chrome extension that adds a button which has a certain function

the function is- A button in a place that when pressed, copies Address link (i think its Copy address link. I would like this to be done with 1 press of a button. Is this even possible? but i think it is

I think it has to be an extension as the page is often refreshed and pasting something into chrome console would have to be done every time the page is refreshed?

I made a small image to show what it looks like. enter image description here

I found some w3schools code

I tried to find some code it might be useful but its not quiet what I am after.

function Copy()
{
    //var Url = document.createElement("textarea");
    urlCopied.innerHTML = window.location.href;
    //Copied = Url.createTextRange();
    //Copied.execCommand("Copy");
}

Every help is appreciated. Thank you

Barmar
  • 741,623
  • 53
  • 500
  • 612
Arek123
  • 3
  • 1

1 Answers1

0

Are you familiar with TamperMonkey? The TamperMonkey Chrome extension allows you to inject javascript code onto any desired webpage. It can certainly do something like you are requesting.

See these other SO references regarding TamperMonkey and how to use it.

How to add a script code in my html in real time on browser open it

Using TamperMonkey vs Writing a Chrome Extension

A simple example of what TM can do for you

cssyphus
  • 37,875
  • 18
  • 96
  • 111