Skip to content

Commit

Permalink
prevent superfluous fetch of illegal URI 'about:blank' when the Sniff…
Browse files Browse the repository at this point in the history
…er dialog window is opened.
  • Loading branch information
GerHobbelt committed Oct 21, 2020
1 parent c01a6d3 commit b74f18f
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ private void RecalculateSearchPool()
// Now follow the **slow** checks: these are time-restrained in that we have set an "acceptable upper time limit"
// for them to take, after which we let *everyone* through: UX-wise performance has to win over accuracy of
// the filter result.
//
//
// When this timeout happens, we flag the flags RED to signal their *inaccuracy*.
if (1 == slower_checks_allowed)
{
Expand Down Expand Up @@ -696,7 +696,7 @@ private void ReflectPDFDocument(string search_terms)
// Make sure the first page is OCRed...
pdf_document.PDFRenderer.GetOCRText(1);

// Set up the new renderer control
// Set up the new renderer control
pdf_renderer_control = new PDFRendererControl(pdf_document, false, PDFRendererControl.ZoomType.Zoom1Up);
pdf_renderer_control.ReconsiderOperationMode(PDFRendererControl.OperationMode.TextSentenceSelect);
pdf_renderer_control.TextSelected += pdf_renderer_control_TextSelected;
Expand Down Expand Up @@ -771,8 +771,8 @@ private void ObjWebBrowser_PageLoaded()
// something like this:
//
// <html><head><meta content="width=device-width; height=device-height;" name="viewport"></head>
// <body marginheight="0" marginwidth="0"><embed type="application/pdf"
// src ="https://escholarship.org/content/qt0cs6v2w7/qt0cs6v2w7.pdf"
// <body marginheight="0" marginwidth="0"><embed type="application/pdf"
// src ="https://escholarship.org/content/qt0cs6v2w7/qt0cs6v2w7.pdf"
// name ="plugin" height="100%" width="100%"></body></html>
//
// !Yay! /sarcasm!/
Expand All @@ -786,7 +786,7 @@ private void ObjWebBrowser_PageLoaded()
// https://digitalcommons.unl.edu/cgi/viewcontent.cgi?article=1130&context=cseconfwork
//
// hence we don't care about the exact extension '.pdf' but merely if it MIGHT be a PDF....
if (true) // if (uri.Contains(".pdf"))
if (uri != "about:blank") // if (uri.Contains(".pdf"))
{
// fetch the PDF!
ImportingIntoLibrary.AddNewDocumentToLibraryFromInternet_ASYNCHRONOUS(CurrentLibrary, uri);
Expand Down Expand Up @@ -852,7 +852,7 @@ private void ReflectLatestBrowserContent()
}
}

// Otherwise let's try parse the page cos it might be a google scholar page
// Otherwise let's try parse the page cos it might be a google scholar page
// and if so we are going to want to try to get the first link to BibTeX
if (ConfigurationManager.Instance.ConfigurationRecord.Metadata_UseBibTeXSnifferWizard)
{
Expand Down

0 comments on commit b74f18f

Please sign in to comment.