1

I have Windows 11 Home and I have the problem that every time I open a new tab in Microsoft Edge, a newspaper like webpage appears.

Here is a picture of this webpage with its data structures that I want to remove (this is already after customizing this webpage to minimum content).

A picture of this webpage after I have "customized" for minimum data stcutures

I believe that these data structres in Red are hardcoded in Edge because I have tried to remove them with the JavaScript below but failed.

This JavaScript didn't work from console or from user script manager, in new tab webpages.

// ==UserScript== // @name delete edge contents // @run-at document-start // @match *://*/* // ==/UserScript== window.setInterval( ()=>{ if ( document.querySelector('#srchfrm')) { alert("Hi"); } }, 1); 

This JavaScript worked both from console and from user script manager but only not in new tab webpages.

// ==UserScript== // @name delete edge contents // @run-at document-start // @match *://*/* // ==/UserScript== window.setInterval( ()=>{ document.querySelectorAll('*').forEach( (element)=>{ element.remove(); }) }, 1); 

I recall going file after file on MS Edge's file tree trying to recgonize some markup file containing these hardcoded data structures to edit but found nothing.

About a month ago I have installed Empty New Tab Page but I don't really want to do it with an extension.

Updated question

How to remove all hardcoded content from Microsoft Edge's new tab webpage without installing any extnesion?

1
  • Comments have been moved to chat; please do not continue the discussion here. Before posting a comment below this one, please review the purposes of comments. Comments that do not request clarification or suggest improvements usually belong as an answer, on Meta Super User, or in Super User Chat. Comments continuing discussion may be removed. Commented Aug 3, 2023 at 15:49

2 Answers 2

2

The short answer is that you can - and should... - simply use a browser extension to have the New Tab page be blank.

For example: Empty New Tab Page (which is a very simple extension, developed by a very well known and Google software engineer on the Chrome team.)


The long answer (to your edited question with all the new information) is that User scripts are restricted from running on the New Tab page (or most other system pages - browser UI, extension pages, or the like.)

Besides the point, that running a script after loading the page isn't the best approach in general, since it will first load and not be very seamless.

So given that running a User script is out of the question, since IT WILL NOT run on the New Tab page, there isn't really another way to run a script on any browser page. It's also not possible to modify built-in browser behavior if there is no setting to do so. So the only way to do anything modifying/changing the New Tab page is using a browser extension which allows you such an option.

To your question:

if there is such extension what does it essentially do?

It's actually quite easy - for someone that has any idea about how to write/build an extension - to open the aforementioned extension and check the files it includes and what they contain. But the short version of it (the extension has a bit more to make it neater like an icon, description, auto dark mode in the HTML, and so) is a manifest.json file that has:

{ "manifest_version": 3, "name": "Empty New Tab Page", "version": "1.0", "chrome_url_overrides": { "newtab": "empty_ntp.html" } } 

And then it has a file named empty_ntp.html which includes whatever you want your New Tab page to look like (can be empty.)

10
  • I remember going through the file tree of this extension and I didn't find any relevant HTML/JS/CSS, hence I assumed that the data structures are hardcoded in MS Edge. Commented Jul 4, 2023 at 15:58
  • 1
    You keep on talking about data structures, but it's very unclear what you are talking about. What are you trying to accomplish that isn't accomplished by installing this browser extension? Commented Jul 4, 2023 at 16:00
  • The data structures are the data structures I have shown in the image in the question. I want to make them disappear without an extension Commented Jul 4, 2023 at 16:03
  • It's actually quite easy to open the aforementioned extension and check the files it includes and what they contain, and the short version of it I went through file after file of the MS Edge file tree in C:\Program Files (x86)\Microsoft\Edge weeks before asking this question here and didn't find what you talk about or didn't rely any significance to it / didn't know what it does. I suggest that you'd edit this part of the answer to be more humble and more fair to the reader. Commented Jul 5, 2023 at 15:45
  • C:\Program Files (x86)\Microsoft\Edge doesn't contain the aforementioned extension if you didn't install it. All I pointed out was that you really should use the extension since you don't have much knowledge on how to build one yourself (sure you technically can, it's not 'that' difficult) but if you really want to "know what the extension does" you can review the code of the extension Commented Jul 5, 2023 at 15:53
0

I don't have the option to download a plugin.

I created a favorite url file:///tmp to the bookmarks. I also changed the browser startup to restore tabs from the last session.

I cleaned out everything I could from the new tab. When I open a new tab, I click on the favorite url and I get a blank page.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.