[Plugin] GUI Search


Squid

Recommended Posts

  • 2 weeks later...

Might I suggest changing autocomplete="off" to autocomplete="new-password" ?

 

Keep running into it trying to autofill credentials into this field. See the bottom of this article:

https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion

 

image.png.ba16a1715b326df274f564f07923beea.png

 

Edit: interestingly enough, this doesn't occur on all pages. I've seen it several times, but out of all the main tab pages, only the "Main" tab is the one that it occurs on. Dashboard, Shares, Settings, Plugins, etc are all fine and it doesn't occur there. Double checked and the line is the same. Not sure what the deal is here with Chrome.

Edited by ionred
  • Like 1
Link to comment

Well, that didn't do it..... still happening.

 

But the one place I know I can always replicate it is the main page. I did some reading and Chrome does some type of guessing based on the page you're on for the forms (new Edge doesn't do this). That got me thinking that there's no username or password fields anywhere on the primary Dashboard, Shares, Settings, etc. pages (you have to click to another link to get a username field). However, the main page, when combined with the unassigned devices/unassigned devices plus plugins does have an in page username/password field. That was what was kicking the autofill off. As soon as I removed the plugins, this behavior stopped. At this point I'm stumped on what to do to make it not think that's a username field. 

 

Edit: some folks tried to wrap the field in it's own form and putting an autocomplete=off attribute on that and had luck. https://datatables.net/forums/discussion/comment/147347/#Comment_147347

 

Edit 2: Wrapping in a form did work

$("#nav-right").prepend("<form autocomplete='off'><span style='float:left'><input autocomplete='new-password' id='guiSearchBox' class='narrow' placeholder='Search WebGUI' type='text'></input></span></form>");

, however.... that messed up the icons on the right. 

image.png.c7f8304d5dca2a913fbd3cd29e2e4288.png

 

Edit 3: Solved? I set a min width of 475px on the nav right div and that has kept it from overflowing. 

 

<div id="nav-right" style="min-width: 475px;">

 

 

@Squid I submitted a PR for this fix: https://github.com/Squidly271/gui.search/pull/1

Edited by ionred
Link to comment

Doesn't work properly if you've got other things there.  Say Page Notes or System Buttons, or the Switch Language Icon on 6.9  You can make the min width larger, but then if the other items aren't there then the entire thing shifts over.

 

Try this instead.  Save the attached as /usr/local/emhttp/plugins/community.applications/javascript/libraries.js

 

The mod stops the autocomplete library from briefly resetting the input back to autocomplete=off

libraries.js

Link to comment
59 minutes ago, Squid said:

Doesn't work properly if you've got other things there.  Say Page Notes or System Buttons, or the Switch Language Icon on 6.9  You can make the min width larger, but then if the other items aren't there then the entire thing shifts over.

 

Try this instead.  Save the attached as /usr/local/emhttp/plugins/community.applications/javascript/libraries.js

 

The mod stops the autocomplete library from briefly resetting the input back to autocomplete=off

libraries.js 169.03 kB · 0 downloads

reverted the gui search page back to plugin default, installed new js library, still autofilling on main when using unassigned devices plugins

Edited by ionred
Link to comment

My problem is that since I cannot replicate it on any of the 3 servers (and I do have Chrome automatically filling in passwords), I can't exactly fix it, and have to go with what works for the majority of users under all the circumstances for what appears on in top right (which I can play with easily).

 

Feel free to modify the code as you need to suit your own circumstances.

Link to comment
  • 1 month later...

Since the input field gets focus on page load, the caret is constantly blinking and that's a real eyesore to me :P

I've currently remedied it with a user-script simply by setting:

#guiSearchBox:placeholder-shown { caret-color: transparent; }

This let's the input keep focus but hides the caret, then revealing it again when typing starts. I think it would be nice to have as a built-in option.

  • Like 1
Link to comment
  • 5 months later...

Hi Andrew,

 

I have a problem using your plugin on 6.10 RC2.

Re-installation does not fix the issue.

 

Warning: in_array() expects parameter 2 to be array, null given in /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php(506) : eval()'d code on line 14

Warning: in_array() expects parameter 2 to be array, null given in /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php(506) : eval()'d code on line 15

Warning: Use of undefined constant XXX - assumed 'XXX' (this will throw an Error in a future version of PHP) in /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php(506) : eval()'d code on line 18

Warning: A non-numeric value encountered in /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php(506) : eval()'d code on line 18

Warning: Use of undefined constant XXX - assumed 'XXX' (this will throw an Error in a future version of PHP) in /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php(506) : eval()'d code on line 20

Warning: A non-numeric value encountered in /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php(506) : eval()'d code on line 20

Fatal error: Uncaught Error: Call to undefined function readConf() in /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php(506) : eval()'d code:23 Stack trace: #0 /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php(506): eval() #1 /usr/local/emhttp/plugins/dynamix/template.php(82): require_once('/usr/local/emht...') #2 {main} thrown in /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php(506) : eval()'d code on line 23

 

gui_search_error.PNG

Link to comment
  • 2 months later...
On 11/15/2021 at 3:02 PM, Squid said:

ok.  I did it a different way that redirects WG* to be VPNmanager

I'm getting some weird links that usually work, and sometimes they include VPNmanager and give me a good header and blank body.

 

If I search for TurboWrite from the docker page, I get https://unraid/Docker/Turbo and it works.

A Network Settings search gives me https://unraid/Turbo/NetworkSettings and it works.

If I search intel and select "Enable Intel Turbo..." I get a broken link to

https://unraid/NetworkSettings/VPNmanager.

 

I can't nail down a pattern, but is it a coincidence VPNmanager pops up?

Link to comment

Doesn't show as doesn't show in autocomplete or refuses to load the page.

 

Because of how the webGUI is designed (and this isn't a critique of it), there's multiple ways to set a page to display.  Most pages in the UI are completely standalone.  But some like subpages (if you're in tabbed mode this is a tab when in some random page) May or may not work depending upon how the file is organized.  Since Preclear is (probably) a subpage off of Main this is most likely the case on there.

 

The "organization" of this sub page is something that this plugin can't really determine accurately, so it hopes for the best, and within plugins the individual settings may or may not be searchable because there's no right or wrong way to actually program them.  The plugin scans the files looking for individual settings that "look and feel" the same way and offers them up (at least if it worked which it's not for reason right now)

Link to comment
  • 7 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.