#793 Broken findbar on View Page Source

Closed
opened 2 years ago by FranklinDM · 8 comments
FranklinDM commented 2 years ago (Migrated from github.com)

Description:
The findbar on the view page source window performs its search on the currently selected tab.

Affected version(s):
Pale Moon 28.1.0 stable

Steps to reproduce:

  1. View the source of any page.
  2. Search something (it performs the search correctly here).
  3. Focus on the main browser window and select any tab.
  4. Go back to the view source window and press F3 or next/previous or Highlight All

Additional info:
These errors are being thrown in the Browser Console.
I’ve tested this also in a clean profile.

TypeError: prefsvc is undefined[Alamin pa]  
findbar.xml:356:15
TypeError: this._fastFind is null[Alamin pa]  
Finder.jsm:422:5
TypeError: this._fastFind is null[Alamin pa] 
Finder.jsm:153:1
TypeError: this._fastFind is null[Alamin pa]  
Finder.jsm:293:5
TypeError: this._fastFind is null[Alamin pa] 
Finder.jsm:153:1
TypeError: this._fastFind is null[Alamin pa]  
Finder.jsm:293:5
A promise chain failed to handle a rejection. Did you forget to '.catch', or did you forget to 'return'?
See https://developer.mozilla.org/Mozilla/JavaScript_code_modules/Promise.jsm/Promise

Date: Thu Sep 27 2018 21:31:37 GMT+0800 (Malay Peninsula Standard Time)
Full Message: TypeError: window is not a non-null object
Full Stack: getForWindow@resource://gre/modules/FinderHighlighter.jsm:170:7
FinderHighlighter.prototype.highlight<@resource://gre/modules/FinderHighlighter.jsm:205:16
TaskImpl_run@resource://gre/modules/Task.jsm:319:42
TaskImpl@resource://gre/modules/Task.jsm:277:3
asyncFunction@resource://gre/modules/Task.jsm:252:14
Finder.prototype.highlight<@resource://gre/modules/Finder.jsm:242:11
TaskImpl_run@resource://gre/modules/Task.jsm:319:42
TaskImpl@resource://gre/modules/Task.jsm:277:3
asyncFunction@resource://gre/modules/Task.jsm:252:14
toggleHighlight@chrome://global/content/bindings/findbar.xml:545:11
observe@chrome://global/content/bindings/findbar.xml:356:15
_setHighlightAll@chrome://global/content/bindings/findbar.xml:569:13
toggleHighlight@chrome://global/content/bindings/findbar.xml:534:11
oncommand@chrome://global/content/viewSource.xul:1:1

Expected result:
The search is performed only in the view source window.

Actual result:
The search is performed on the currently selected tab on the main browser window instead of on the view source window.

Screenshot:
screenshot 55 I’m not doing the same search on that tab.

**Description:** The findbar on the view page source window performs its search on the currently selected tab. **Affected version(s):** Pale Moon 28.1.0 stable **Steps to reproduce:** 1. View the source of any page. 2. Search something (it performs the search correctly here). 3. Focus on the main browser window and select any tab. 4. Go back to the view source window and press F3 or next/previous or Highlight All **Additional info:** These errors are being thrown in the Browser Console. I've tested this also in a clean profile. ``` TypeError: prefsvc is undefined[Alamin pa] findbar.xml:356:15 TypeError: this._fastFind is null[Alamin pa] Finder.jsm:422:5 TypeError: this._fastFind is null[Alamin pa] Finder.jsm:153:1 TypeError: this._fastFind is null[Alamin pa] Finder.jsm:293:5 TypeError: this._fastFind is null[Alamin pa] Finder.jsm:153:1 TypeError: this._fastFind is null[Alamin pa] Finder.jsm:293:5 A promise chain failed to handle a rejection. Did you forget to '.catch', or did you forget to 'return'? See https://developer.mozilla.org/Mozilla/JavaScript_code_modules/Promise.jsm/Promise Date: Thu Sep 27 2018 21:31:37 GMT+0800 (Malay Peninsula Standard Time) Full Message: TypeError: window is not a non-null object Full Stack: getForWindow@resource://gre/modules/FinderHighlighter.jsm:170:7 FinderHighlighter.prototype.highlight<@resource://gre/modules/FinderHighlighter.jsm:205:16 TaskImpl_run@resource://gre/modules/Task.jsm:319:42 TaskImpl@resource://gre/modules/Task.jsm:277:3 asyncFunction@resource://gre/modules/Task.jsm:252:14 Finder.prototype.highlight<@resource://gre/modules/Finder.jsm:242:11 TaskImpl_run@resource://gre/modules/Task.jsm:319:42 TaskImpl@resource://gre/modules/Task.jsm:277:3 asyncFunction@resource://gre/modules/Task.jsm:252:14 toggleHighlight@chrome://global/content/bindings/findbar.xml:545:11 observe@chrome://global/content/bindings/findbar.xml:356:15 _setHighlightAll@chrome://global/content/bindings/findbar.xml:569:13 toggleHighlight@chrome://global/content/bindings/findbar.xml:534:11 oncommand@chrome://global/content/viewSource.xul:1:1 ``` **Expected result:** The search is performed only in the view source window. **Actual result:** The search is performed on the currently selected tab on the main browser window instead of on the view source window. **Screenshot:** ![screenshot 55](https://user-images.githubusercontent.com/11641537/46149215-6893bf00-c29c-11e8-8ce4-e062293e8a31.png) I'm not doing the same search on that tab.
wolfbeast commented 2 years ago (Migrated from github.com)
Owner

It will need the findbar browser property set to the active window when the source window is selected. Should be a straightforward fix similar to a744d76655

It will need the findbar browser property set to the active window when the source window is selected. Should be a straightforward fix similar to a744d76655f08a2812270da0c459126428c5786d
wolfbeast commented 2 years ago (Migrated from github.com)
Owner

I’ve been trying to reproduce this and I can’t.

STR don’t result in the wrong browser for me. it will search in the source window.
I’ve tried opening the find bar in the browser window and swapping between tabs etc -- nothing makes it
search there instead of the focused source window. No errors are thrown in the console.

I've been trying to reproduce this and I can't. STR don't result in the wrong browser for me. it will search in the source window. I've tried opening the find bar in the browser window and swapping between tabs etc -- nothing makes it search there instead of the focused source window. No errors are thrown in the console.
wolfbeast commented 2 years ago (Migrated from github.com)
Owner

It makes very little sense that _fastFind errors are thrown because that code was restored when moving the findbar back to the global window. The _fastFind field should therefore exist.

It makes very little sense that `_fastFind` errors are thrown because that code was restored when moving the findbar back to the global window. The `_fastFind` field should therefore exist.
wolfbeast commented 2 years ago (Migrated from github.com)
Owner

I’ve been able to reproduce it but with an extra step:
3a. navigate to a different page

This makes the actual page the source view is for no longer present. At that point, trying to search in the source window will not work, and searching will be done in the (new) page content.

EDIT: I do not see the thrown errors in the browser console, though.

I've been able to reproduce it but with an extra step: 3a. navigate to a different page This makes the actual page the source view is for no longer present. At that point, trying to search in the source window will not work, and searching will be done in the (new) page content. EDIT: I do not see the thrown errors in the browser console, though.
wolfbeast commented 2 years ago (Migrated from github.com)
Owner

@janekptacijarabaci in #513 it seems you’ve rolled several different things into one. Perhaps because it was all backed out, since they weren’t separate commits, we’ve lost some code that would be important to keep (like the focus() part?). Could you have a look at this problem, please, and see if you can find out what is going on here?

@janekptacijarabaci in #513 it seems you've rolled several different things into one. Perhaps because it was all backed out, since they weren't separate commits, we've lost some code that would be important to keep (like the focus() part?). Could you have a look at this problem, please, and see if you can find out what is going on here?
FranklinDM commented 2 years ago (Migrated from github.com)
Owner

The _fastFind errors seem to get thrown when you try to open the find bar again in the tab where the view source window was opened; the global find bar can’t be opened in that tab.

Here’s the content the error shows when I click the drop-down menu:

TypeError: this._fastFind is null[Alamin pa]  
Finder.jsm:293:5
	enableSelection resource://gre/modules/Finder.jsm:293:5
	onxblblur chrome://global/content/bindings/findbar.xml:115:9
TypeError: this._fastFind is null[Alamin pa] 
Finder.jsm:153:1
	set caseSensitive resource://gre/modules/Finder.jsm:153:1
	_updateCaseSensitivity chrome://global/content/bindings/findbar.xml:617:11
	_find chrome://global/content/bindings/findbar.xml:1025:13
	onxblinput chrome://global/content/bindings/findbar.xml:82:9
The ```_fastFind``` errors seem to get thrown when you try to open the find bar again in the tab where the view source window was opened; the global find bar can't be opened in that tab. Here's the content the error shows when I click the drop-down menu: ``` TypeError: this._fastFind is null[Alamin pa] Finder.jsm:293:5 enableSelection resource://gre/modules/Finder.jsm:293:5 onxblblur chrome://global/content/bindings/findbar.xml:115:9 TypeError: this._fastFind is null[Alamin pa] Finder.jsm:153:1 set caseSensitive resource://gre/modules/Finder.jsm:153:1 _updateCaseSensitivity chrome://global/content/bindings/findbar.xml:617:11 _find chrome://global/content/bindings/findbar.xml:1025:13 onxblinput chrome://global/content/bindings/findbar.xml:82:9 ```
FranklinDM commented 2 years ago (Migrated from github.com)
Owner

@wolfbeast
Applying 38f30cdf75 from PR #514 seems to fix the issue on my end.

  • This code seems to set the incorrect browser for the View Source window’s find bar.
  • I found a much easier STR: press Escape button at least twice on the view source window and search will be broken.
@wolfbeast Applying 38f30cdf759e4f6da96da777c3216b5047d672c1 from PR #514 seems to fix the issue on my end. * This code seems to set the incorrect browser for the View Source window's find bar. * I found a much easier STR: press Escape button at least twice on the view source window and search will be broken.
wolfbeast commented 2 years ago (Migrated from github.com)
Owner

Thanks for digging into this! Re-applied the patch, verification would be nice.

Thanks for digging into this! Re-applied the patch, verification would be nice.
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.