Is it possible to run the command copy() from a Bookmarklet? - google-chrome

I constantly have to test websites and they always ask the same ID number or zipcode or something. Since I don´t want to give my real number, I always copy and past it from a .txt I have on my computer that has some fake numbers that will past the verification.
I was wondering if I could make my life easier by automating part of this work. My idea was to use Bookmarklet (https://en.wikipedia.org/wiki/Bookmarklet) and the command copy() from google Chrome (https://developers.google.com/web/tools/chrome-devtools/console/command-line-reference#copyobject).
It unfortunately did not work. Any ideas who to do that?
I´ve tried:
javascript:(function(){
copy(1235465);
})();
and
javascript:{copy(1235465);};void(0);
but neither of them have worked.
Is this even possible?

I´ve found a answer for that here: Copy text to clipboard from bookmarklet
Sorry for the duplicated question.
Here is the link to the gitHub as well:
https://gist.github.com/stefanmaric/2abf96c740191cda3bc7a8b0fc905a7d

Related

Is there any workaround for uploading picture into Google Form responses without having to be signed in to a Google account?

I was wondering if there are any workaround for responding to a form with a picture but without the respondent having to sign in into their google account? Maybe like a a script or something to trick the form to think that every time a respond is sent, it came from the owner.
I'm thinking of having the form to be filled in from an app built on AI2 instead of directly from the actual form as well.
If anyone have any ideas whether this is achievable or not, do respond.
I'm still working on this too, but in my opinion it's a two-parter.
First, you upload the file to a separate folder; then, you link the file URL back to the form as a short answer. Separating the two allows you to ignore the pesky "you must have a Google Account to do this" because if you set up your WebApp properly it does look like it's coming from the owner.
This will help you upload the file: https://sites.google.com/view/metricrat-ai2/guides/upload-any-file-to-google-drive-with-ai2
I would suggest downloading the example and adding it to your projects and copying over via your backpack, though. For some reason recreating the code from the pictures he's got up doesn't work for me.
The second half is where it gets tricky. I'm wondering if it's possible to manipulate the final steps in the GAS to return the content URL, but haven't totally wrapped my brain around it yet.

What's wrong with this HTML page that I created?

I'm taking a programming class on Lynda.com and I just finished creating this HTML web page, but it's not opening on a web browser. Can someone help me figure out what I did wrong? Thanks! :)
Here's what I did:
Picture
I took a look at your code and it not only looks correct, it displays for me on Chrome, Firefox, Opera, and MS Edge.
I'm thinking that it may be the manner in which you are trying to access the file to display.
Follow these two solutions and see if one of them works for you:
Solution 1) Find where on your hard drive you are saving your "body.html" file. When you find the file, click on it and it should automatically open the file in whatever your default browser is for you.
Solution 2) If you are trying to manually type in the directory address for your "body.html" file inside the web address box of your browser, make sure you are writing the address correctly. Remember, the address is coming from your hard drive and not the internet itself. A format would look something like this:
C:/Website-Projects/body.html
or try:
C://Website-Projects/body.html (***the only difference is the 2 back slashes instead of one).
in the example above, "C" stands for the designation of my hard drive, "Website-Projects" is the name of the folder on my "C drive" that my target file is in, and "body.html" is the target file I'm trying to open within the "Website-Projects" folder.
Give those two solutions a spin and see if that helps.

Web worker not working html5

i have recently started to program in html5,
My friend asked me to build him a youtube video to gif, i have zero idea how to do this, he wants it to sit in his computer (with a web server).
I am looked around in google for few hours before coming in this time because i know this is not google.
So, i found this code - http://techslides.com/demos/video/generate-animatedgif.html, on hes website its working like a charem right? so. he said, copy this template to your web server and it will work.
Well, i did just that - look what happnd -
w.js:3 Uncaught ReferenceError: Worker is not defined
IF NEEDED, i can upload and share my link here if needed. But i will be really happy if someone can tell me what am i doing worng or give me another web that can create gifs ( that you can download the html and host in your own server).
Ty very much, please. i know this is not the reguler qustion in stackoverflow, but please dont close this theard, i ask for help.
Make sure you have this line of code
var worker = new Worker('w.js');
in your html file
So, it seems that web workers can only work if you create a file for them,
So, my answer is simple. I created a w.js file with the code inside, and it works.
Good day all.

Save file with different name from original (html)

I want to put a link on html which downloads a file with different filename from original. So for example there is this PNG file:
https://www.google.com/images/srpr/logo11w.png
I would like to put it into html so that when you click to download it, it saves not as "logo11w.png" (which is the original name) but as another name, for example: "Google Logo.png"
I actually had saved the code to do this on my computer and now i have lost access to it and can't seem to find it on google, i tried several search queries. However, I remember it was a pretty short html code (1 line) however I just want to make this possible no matter if you guys give me another code, all that matters is that it works. Thanks!
Faced the same problem today and stumbled upon your question. Here's what I found:
Download logo
You can also achieve the same through javascript, here's the link:
http://www.w3schools.com/jsref/prop_anchor_download.asp

Is it possible to save changes in Firebug locally?

What I'm trying to do is to save the changes I make to CSS and HTML on different sites with Firebug.
Just to be clear, I don't expect Firebug to upload the changes to the server via FTP or anything. I just want to save the changes locally, so only I will be able to see them.
For example I've seen a few Firefox/Chrome extensions that add a download button under every video on Youtube, so I know it's possible to do that somehow.
If you have a different way to achieve what I'm trying to do, I'll be glad to hear about it.
(It doesn't have to be with Firebug.)
Thanks in advance!
If you don't mind using Web Developer Toolbar it's easy to save changes made to the DOM (and CSS).
When you install the toolbar, you'll get a "View Source" menu, click on that and choose "View generated source". Then just copy and paste that into a .html file.
You did not say if you alter your HTML or CSS, if CSS, FireFile is a very good addon for this.
Edit, with some Googling, i found FireDiff, which states that it can export changes made in Firebug, i have not tested it bit it's worth checking out.
You could try using Greasemonkey.
It has support for adding custom scripts that are run whenever you load a page (linked to which pages it should load on) and that can make changes to the page dynamically.
https://addons.mozilla.org/en-US/firefox/addon/greasemonkey/
The http://chrispederick.com/work/web-developer/ web developer toolbar will let you add a user style sheet to a site which should achieve your goals.
This may or may not be exactly what you're asking for, but you can download the extension FireDiff in order to save changes made with FireBug. I made a little tutorial on how to do it here: https://www.youtube.com/watch?v=m4OmZLX2zd4
I have a somewhat simlar use-case that I solved differently. I'm not sure if it is what you are looking for or not. I'll describe the behavior and if that is helpful I'll explain exactly how I implemented it.
I changed the code that execute when you click "Run" (or Ctrl+Enter) to check to see if the first line of the code is a hard-coded string //LoadFromFile:<file path>. If it is, and the file exists then I pull the file off of the local file system and run it instead of executing the code in the console window. This way I can use an external text editor to write code.