how i can check if there are a video in the page - javascript

I'm building my first chrome extension using JavaScript. It is required in it to identify the videos in the page a automatically. And then send the info. to web service. I'm not sure if saving the URL and the video tag will be a good idea to remember the video.What do you think? is it a good idea? and if it is OK, how i can identify the video tags which inside the page?

Console in google chrome will tell you if your loading things other than just the site.
Right click inspect page, then click console.

Related

How to do screenshot for frontend page with iframe?

I have made a screenshot function with Javascript for our page, when user click to send issues to us, it will automatically do screenshot of the page through "html2canvas", so we could see something in the snapshot about the issue.
Since we use Iframe to load third-party sites, "html2canvas" don't work to do screenshot inside the Iframe. I searched and found that this library does not support Iframe.
Then I found the "MediaDevices.getDisplayMedia()" screen capture API, I could use it to capture the page. Howerver, as the api could capture screen out of browser page, it needs user permission every time Javascript do screenshot.
I wonder if anyone know a tool or sdk that could screenshot the web page with iframe, without user operation. Thank you!

How to found which script is run when i click anywhere in website?

Actually, I am working on a WordPress website and I use a theme for it. The problem is that daily I open first time my website and click anywhere in the body it open google ads in new browser window like facebook, jabong and all. So how to remove that. And also after every cleaning browser cookies and history process same issue, I get. Please let me know how to fix it and how to determine what function run when I click?
Thanks in Advance.

How does youtube use ajax

If you go visit a YouTube video and then click another video ( e.g a related video ) you see that the page is not entirely refreshing, Only the main video and related videos change, The rest of the page remains as it is.
I was wondering how they do that, If it's AJAX then why is the URL updating?
I've seen this technique on some other famous websites too , I was wondering how this works?!
You can change the URL without reloading the page, if the browser supports it.
Combined this with Ajax and you will see the behavior you are seeing.

How to Disable a specific link using html or javascript

I am using a Gchat voice and video chat script. link to my website
The problem is that someone login in my chatroom and he use this flash link to crash users browser.
when he login all of us get disconnected and we have a blank black page at that time.
He must be using src="http://best-hosting.cu.cc/c/banner3-www-facebook-skype-net-com.swf" or iframe of that link somewhere when he is logging in.
Please help me. How can I disable that flash thing not to load in all users browsers
I get his links detect using ads block plus extension in firefox when he login with that flash link thing. when i block his link in ads block plus then i do not get disconnect but the other users who dont have ads block plus still get disconnect from website and have a blank black page.
Please suggest me something that will solve my problem.
You could try the accepted answer here: Find text and remove it jquery
Use it to find a string within the text and remove the entire thing.
I'd personally do: $('.className').contains('.swf').remove();​
Where className would be the class for links, or you could just do it for the <a> tag in general
EDIT: That being said, I have no idea what Gchat is, and whether or not this would be possible with it. If it is something hosted on your site it should work, but if it is embedded and hosted elsewhere, I'm not quite sure, worth a try though.

How to open a webpage and run your JavaScript on it?

I am trying to load a webpage then insert my own Javascript into it.
I have the current code here:
window.location.assign('http://http://79.170.44.75/hostdoctordemo.co.uk/downloads/vpn/index.php');
document.getElementById('address_box').value = prompt("Site Address: ");
document.getElementById('go').click();
and what I am trying to do is:
Load the webpage
Set the address box to a value
Simulate a mouse click on the search button
So it loads the webpage, then searches a value it sets itself.
The problem with my current JavaScript is that as soon as the webpage has loaded the JavaScript stops working (as I expected). I have tried using the iframe tag to load the webpage 'within the webpage' but that did not work when obtaining the id and people said iframe would also not work because of the resolution difference.
**The Question: ** How do I load a webpage and run my own JavaScript code on it? Thank you!
Matthew
You're propably looking for something like Greasemonkey.
I really can't see an easy way to do what you want.
When the browser receives a web page from a server the javascript is interpreted, and only after that, the page is presented on the screen.
So you would have to have a web page with a button or other mechanism to make a request to a web server, receive the request, save its contents locally, add your javascript code and only then "give it to the browser".

Categories

Resources