I am making a bookmarklet that will open a menu in which you can change the websites favicon and title, and have presets. I am fine with the title changing, but I don't know how to add a favicon. I'm attempting to do so without having to find the websites favicon, but adding a favicon element. I have tried the following:
javascript:$('head').append('<link rel="shortcut icon" type="image/png" href='https://ssl.gstatic.com/docs/doclist/images/infinite_arrow_favicon_5.ico"/>');
This would be a bit of code that would supposedly change the favicon to the google drive symbol, but it doesn't work for me. how would I inject a favicon into a website without knowing the specific element class or id, but by inserting a whole new element.