Open website in new tab without loading page interface in chrome extension - javascript

I am writing a chrome extension. My code from content.js opens 10 tabs by link(for example window.open('google.com/search?q=***')). My problem is that sites take too long to load. Is it possible to open a certain site without loading styles, pictures, videos and maybe some scripts for faster page loading? I only need html and some text

Related

How to keep a HTML popup in front in a chrome extension while page is reloading?

So the chrome extension honey has a popup over the page injected by the contentscript that shows the current progress of applying coupons on a webshop.
Some websites reload as a whole if you submit a coupon (instead of just AJAX reqs), so if you would have injected some HTML it would go away because the contentscript would get reloaded and it would have to inject the HTML again.
See this as an example: https://youtu.be/iLk9Y5VUToE?t=87
How do they keep the popup in front at all times while a page is hard reloading while keeping track of the progress?
NOTE: This is not about the popup functionality (like popup.html)
Hope I explained this well enough :)

Display a web page in a container, scroll, switch to next

I have a list of urls I need to show on a screen for a presentation. After the page have loaded, I want to scroll to the end of the page, and when it's reached load the next one.
The problem is, most of those pages have 'X-Frame-Options' to 'sameorigin', so I can't use iframes. What other options do I have ?
I thought about, maybe, a chrome extension will complete rights over navigation that would handle the whole process...
Thanks ahead.
So, the solution was indeed to build a Chrome extension. Only the software containing the page gives you that much control over it when you don't have access to its code - namely, the browser.
I built a very simple extension using chrome.tabs in the background to open a new tab or update it, injecting a script in the page whenever it's loaded, and using messaging to inform the background when scrolling is finished and it's time to load a new page in the list.

Chrome Extension: adding button to header-title area of tabs

I want to develop extension that can reload a web page by clicking on the tub.
Is it possible to add a button to the title area of a web page?
If yes
What should I add to the manifest?
Which object should I use to do so?
Unfortunately, this is not possible. The Google Chrome Extension APIs do not provide any functionality to do this... yet. As of now, your extension can only display page actions on the address bar or browser actions near it along with other extensions.
Page actions:
Browser actions:

Chrome extension: default pop_up vs injecting a div in page

I am getting confused understanding the practices generally followed in the popular chrome extensions. I am trying to develop my own chrome extension and after going through the basic tutorial, I have a default popup page that opens whenever I click the extension icon near my address bar. So far so good! While checking the source codes of some good extensions installed in my chrome browser, I came to know, none of them uses the default_popup page but definitely invokes some javascripts through either the background page or content scripts. But the final behaviour as seen by the user is functionally like a popup at the upper right corner of the screen, though more presentable. Is there any reason for not using default_popup over using other mechanisms?
I think it really depends on what your app needs in terms of functionality and design. As there are no real reasons why you might want to choose one over the other. Most information can be passed from the page to the extension app and vice versa. Users expect a popup when they click on the button but injected popups are also supported and commonly used in Chrome, Firefox and Safari.
Pros/Cons:
If your extension depends on the page content then you can inject scripts that analyze the page and inject divs accordingly. You can send analyzed data back to the extension and open a popup but thats an additional step. If your extension has nothing to do with the specific page then you would be better off using a popup.
Popups close when you switch tabs or your browser loses focus. Injected popups need not.
Don't inject scripts and stylesheets into pages willy nilly. They interfere with a website's native js/css and also stuff injected by other externsions which is near impossible to fully account for.

what is the best way to load content to speed up chrome extension?

currenly I've this: fiddle
As you can see there are 5 buttons at the top, and when you hover them, beneath the buttons shows up a content window. The problem is that every 'content window' is loaded when you load the page. When there is a lot of content in it, loading can take a while. Because this is for a chrome extension, chrome waits until everything is loaded before opening the extension bubble.
How to prevent the long load time? I've tried to load the content using innerHTML after window is loaded (window.onload). But that still slows down the extension.

Categories