- Popups and window methods
- Popup blocking
- window.open
- Example: a minimalistic window
- Accessing popup from window
- Accessing window from popup
- Comments
- An URL to a Windows shared folder [duplicate]
- 4 Answers 4
- FIX: How to get help in Windows 10 pop-up
- How do I stop How to get help in Windows 10 from popping up?
- 1. Check whether the F1 key jammed or not
- Run a System Scan to discover potential errors
- 2. Remove programs from Windows 10 Startup
- 3. Check the Filter Key and Sticky Key settings
- 4. Turn off the F1 key
- 5. Edit the Registry
- 6. Create a command script file
Popups and window methods
A popup window is one of the oldest methods to show additional document to user.
Basically, you just run:
…And it will open a new window with given URL. Most modern browsers are configured to open url in new tabs instead of separate windows.
Popups exist from really ancient times. The initial idea was to show another content without closing the main window. As of now, there are other ways to do that: we can load content dynamically with fetch and show it in a dynamically generated
Also, popups are tricky on mobile devices, that don’t show multiple windows simultaneously.
Still, there are tasks where popups are still used, e.g. for OAuth authorization (login with Google/Facebook/…), because:
- A popup is a separate window which has its own independent JavaScript environment. So opening a popup from a third-party, non-trusted site is safe.
- It’s very easy to open a popup.
- A popup can navigate (change URL) and send messages to the opener window.
Popup blocking
In the past, evil sites abused popups a lot. A bad page could open tons of popup windows with ads. So now most browsers try to block popups and protect the user.
Most browsers block popups if they are called outside of user-triggered event handlers like onclick .
This way users are somewhat protected from unwanted popups, but the functionality is not disabled totally.
What if the popup opens from onclick , but after setTimeout ? That’s a bit tricky.
The popup opens in Chrome, but gets blocked in Firefox.
…If we decrease the delay, the popup works in Firefox too:
The difference is that Firefox treats a timeout of 2000ms or less are acceptable, but after it – removes the “trust”, assuming that now it’s “outside of the user action”. So the first one is blocked, and the second one is not.
window.open
The syntax to open a popup is: window.open(url, name, params) :
url An URL to load into the new window. name A name of the new window. Each window has a window.name , and here we can specify which window to use for the popup. If there’s already a window with such name – the given URL opens in it, otherwise a new window is opened. params The configuration string for the new window. It contains settings, delimited by a comma. There must be no spaces in params, for instance: width=200,height=100 .
Settings for params :
- Position:
- left/top (numeric) – coordinates of the window top-left corner on the screen. There is a limitation: a new window cannot be positioned offscreen.
- width/height (numeric) – width and height of a new window. There is a limit on minimal width/height, so it’s impossible to create an invisible window.
- Window features:
- menubar (yes/no) – shows or hides the browser menu on the new window.
- toolbar (yes/no) – shows or hides the browser navigation bar (back, forward, reload etc) on the new window.
- location (yes/no) – shows or hides the URL field in the new window. FF and IE don’t allow to hide it by default.
- status (yes/no) – shows or hides the status bar. Again, most browsers force it to show.
- resizable (yes/no) – allows to disable the resize for the new window. Not recommended.
- scrollbars (yes/no) – allows to disable the scrollbars for the new window. Not recommended.
There is also a number of less supported browser-specific features, which are usually not used. Check window.open in MDN for examples.
Example: a minimalistic window
Let’s open a window with minimal set of features, just to see which of them browser allows to disable:
Here most “window features” are disabled and window is positioned offscreen. Run it and see what really happens. Most browsers “fix” odd things like zero width/height and offscreen left/top . For instance, Chrome open such a window with full width/height, so that it occupies the full screen.
Let’s add normal positioning options and reasonable width , height , left , top coordinates:
Most browsers show the example above as required.
Rules for omitted settings:
- If there is no 3rd argument in the open call, or it is empty, then the default window parameters are used.
- If there is a string of params, but some yes/no features are omitted, then the omitted features assumed to have no value. So if you specify params, make sure you explicitly set all required features to yes.
- If there is no left/top in params, then the browser tries to open a new window near the last opened window.
- If there is no width/height , then the new window will be the same size as the last opened.
Accessing popup from window
The open call returns a reference to the new window. It can be used to manipulate it’s properties, change location and even more.
In this example, we generate popup content from JavaScript:
And here we modify the contents after loading:
Please note: immediately after window.open , the new window isn’t loaded yet. That’s demonstrated by alert in line (*) . So we wait for onload to modify it. We could also use DOMContentLoaded handler for newWin.document .
Windows may freely access content of each other only if they come from the same origin (the same protocol://domain:port).
Otherwise, e.g. if the main window is from site.com , and the popup from gmail.com , that’s impossible for user safety reasons. For the details, see chapter Cross-window communication.
Accessing window from popup
A popup may access the “opener” window as well using window.opener reference. It is null for all windows except popups.
If you run the code below, it replaces the opener (current) window content with “Test”:
let newWin = window.open(«about:blank», «hello», «width=200,height=200»); newWin.document.write( «
Comments
- If you have suggestions what to improve — please submit a GitHub issue or a pull request instead of commenting.
- If you can’t understand something in the article – please elaborate.
- To insert few words of code, use the tag, for several lines – wrap them in
tag, for more than 10 lines – use a sandbox (plnkr, jsbin, codepen…)
An URL to a Windows shared folder [duplicate]
Is there a way to incorporate a working link to a Windows shared folder into an HTML page? E.g. a link to \\server\folder\path ?
For simplicity, let’s say the page will be opened on a Windows machine (and on the same intranet where the server is located, of course.)
I’ve tried a few tricks with file:// scheme, but none of them seemed to work.
4 Answers 4
I think there are two issues:
- You need to escape the slashes.
- Browser security.
I checked one of mine, I have the pattern:
Please note that we ended up with 5 slashes after the protocol ( file: )
Firefox will try to prevent cross site scripting. My solution was to modify prefs.js in the profile directory. You will add two lines:
File protocol URIs are like this
that’s why you often see file URLs like this (3 slashes) file:///c:\path.
So if the host is server01, you want
This is according to the wikipedia page on file:// protocols and checks out with .NET’s Uri.IsWellFormedUriString method.
If you are allowed to go further then javascript/html facilities — I would use the apache web server to represent your directory listing via http.
If this solution is appropriate. these are the steps:
download apache hhtp server from one of the mirrors http://httpd.apache.org/download.cgi
unzip/install (if msi) it to the directory e.g C:\opt\Apache (the instruction is for windows)
map the network forlder as a local drive on windows (\server\folder to let’s say drive H:)
open conf/httpd.conf file
make sure the next line is present and not commented
LoadModule autoindex_module modules/mod_autoindex.so
Add directory configuration
7. Start the web server and make sure the directory listingof the remote folder is available by http. hit localhost/path 8. use a frame inside your web page to access the listing
What is missed: 1. you mignt need more fancy configuration for the host name, refer to Apache Web Server docs. Register the host name in DNS server
- the mapping to the network drive might not work, i did not check. As a posible resolution — host your web server on the same machine as smb server.
FIX: How to get help in Windows 10 pop-up
- The How to get help in Windows 10 pop up is fairly common in Windows 10 users.
- In order to remove it, all you need to do is check whether your F1 key is jammed or pressed.
- Removing programs from Startup or modifying your registry has also been proven to help.
- Continue reading below if How to get help in Windows 10 keeps popping up.
- Download Restoro PC Repair Tool that comes with Patented Technologies (patent available here).
- Click Start Scan to find Windows issues that could be causing PC problems.
- Click Repair All to fix issues affecting your computer’s security and performance
- Restoro has been downloaded by 0 readers this month.
The How to get help in Windows 10 Bing search pop up opens within your default browser when you press the F1 key on the Win 10 desktop.
Yet, some users have stated on forums that the Windows 10 help pop up automatically pops up with regularity on their Windows desktops.
Why does Windows 10 Help keep opening? Sometimes, your Help key may get stuck and this could trigger the ‘Get help’ alerts. This issue may also occur due to incorrect system settings.
In this guide, we’ll cover both these situations as well as other particular cases.
These are a few resolutions that might fix a How to get help in Windows 10 search pop up that opens automatically.
How do I stop How to get help in Windows 10 from popping up?
- Check whether the F1 key is jammed or not
- Remove programs from the Windows 10 Startup
- Check the Filter Key and Sticky Key settings
- Turn off the F1 key
- Edit the Registry
- Create a command script file
1. Check whether the F1 key jammed or not
It might be the case that you need to fix your keyboard. The get help in Windows 10 pop up will open if the F1 key is stuck in any way.
Run a System Scan to discover potential errors
So, check the F1 key. The Windows 10 help pop up might not automatically pop up with an alternative desktop keyboard. You can unplug a desktop keyboard to see if the pop up still opens.
2. Remove programs from Windows 10 Startup
- Open the Win + X menu with the Windows key + X hotkey.
- Select to open Task Manager.
- Select the Start-up tab shown in the shot directly below.
- You can disable a startup program by selecting it and pressing the Disable button.
Keyboard macro programs can automatically press the F1 keys with their macros. As such, it’s worth checking if you have any startup software that might be opening the get help in Windows 10 pop up.
3. Check the Filter Key and Sticky Key settings
- Press the Type here to search Cortana button on the taskbar.
- Input the keyword Sticky Key in the search box.
- Select Turn on easy access keys to open the Control Panel as shown directly below
- Deselect the Turn on Sticky Keys option if it’s selected.
- Uncheck the Turn on Filter Keys setting.
- Click Apply and OK to confirm the new settings and close the window.
- The get help in Windows 10 pop up might open if you’ve set up F1 as a Filter Key or Sticky Key. To deselect those options in Win 10, follow the steps in the next solution.
4. Turn off the F1 key
- Press Download on the editor’s page to save the SharpKeys ZIP to your HDD.
- Open the SharpKeys ZIP in File Explorer, and press the Extract all button.
- Click Browse to select a folder to extract SharpKeys to, and click the Extract button.
- Open the SharpKeys window, and select F1 in the Map this key list.
- Select Turn Key Off in the To this key list and press the OK button.
- Then select the Write to Registry option and restart your desktop or laptop.
Turning the F1 key off will probably ensure that the How to get help in Windows 10 search pop up doesn’t open. You can deactivate the F1 key with keyboard-mapping software.
SharpKeys is freeware keyboard-mapping software you can turn off most keyboard keys with.
5. Edit the Registry
- Press Windows key + R keyboard shortcut.
- Input regedit in Run and press the OK button.
- Then open to this registry key in the Registry Editor: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\NlaSvc\Parameters\Internet
- Double-click EnableActiveProbing to open the window shown directly below.
- Then enter 0 in the Value data box to replace the current 1 value.
- Press the OK button and close the Registry Editor.
- Select Restart to restart Windows.
Some users have also fixed the get help in Windows 10 pop up automatically opening by editing the EnableActiveProbing DWORD value with the Registry Editor.
6. Create a command script file
- Open Notepad.
- Paste in the following script and save the file anywhere as script.cmd (make sure it is a CMD file not a txt file)
- @echo off
taskkill /f /im HelpPane.exe
takeown /f %WinDir%\HelpPane.exe
icacls %WinDir%\HelpPane.exe /deny Everyone:(X)
- @echo off
- Double click on the command script file to run it.
This solution was suggested by one of our readers and it works like a charm so make sure you give it a try. If it doesn’t work for you, just delete the cmd script.
One of those resolutions will probably fix the get help in Windows 10 Bing search pop up. If you have any further fixes for the Windows 10 help pop up, feel free to share them below.