Copy text to clipboard from bookmarklet

Since the new Clipboard API, this is easy in browsers that support it: javascript: navigator.clipboard.writeText(‘some text from somewhere’);null; Caveat: Any alerts or prompts in your bookmarklet will cause the document to lose focus, and the clipboard API will become unavailable. In that case you need to move focus back into the document before any subsequent … Read more

JavaScript: Invert color on all elements of a page

First things first, grab the awesome RGBColor class here. Here goes: jsFiddle example //set up color properties to iterate through var colorProperties = [‘color’, ‘background-color’]; //iterate through every element in reverse order… $(“*”).get().reverse().each(function() { var color = null; for (var prop in colorProperties) { prop = colorProperties[prop]; //if we can’t find this property or it’s … Read more

Add a bookmark that is only javascript, not a URL

What you want is a bookmarklet they are easy to create and should work in most major browsers. Edit: Stack overflow seems not to allow creating bookmarklets in the context of the site, basically you can create a new bookmark and type the following in the location field javascript:window.location=’http://www.google.com/search?q=’+Date() to get a bookmarklet that searches … Read more

Load external JS from bookmarklet?

2015 Update Content security policy will prevent this from working in many sites now. For example, the code below won’t work on Facebook. 2008 answer Use a bookmarklet that creates a script tag which includes your external JS. As a sample: javascript:(function(){document.body.appendChild(document.createElement(‘script’)).src=”https://stackoverflow.com/questions/106425/** your external file URL here **”;})();

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)