Clicking on links in PDF in JxBrowser results in errors - jxbrowser

I am using JxBrowser 6.14.2 in a Java Swing application and I'm encountering an issue when loading a PDF and attempting to load content for any links in the PDF document.
It seems to be related to the tab handling code in the Chrome PDF extension and it happens when using the JxBrowser default PopupHandler as well as a custom one.
Get the following error when the PDF is loaded:
[0104/095806:INFO:CONSOLE(0)] "Unchecked runtime.lastError while running tabs.get: No tab with id: 5.
at promises.push.Promise.then.streamInfo.tabUrl (chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/browser_api.js:159:21)
at chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/browser_api.js:158:21", source: chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.html (0)
Then, when clicking any URL or mailto link, the following error occurs:
[0104/095952:INFO:CONSOLE(0)] "Unchecked runtime.lastError while running tabs.update: No current window
at NavigatorDelegate.navigateInCurrentTab (chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/navigator.js:42:19)
at Navigator.onViewportReceived_ (chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/navigator.js:169:31)
at OpenPDFParamsParser.getViewportFromUrlParams (chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/open_pdf_params_parser.js:131:7)
at Navigator.navigate (chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/navigator.js:125:28)
at PDFViewer.handlePluginMessage_ (chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/pdf.js:614:27)", source: chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai/index.html (0)
The same errors even occur if a popup handler that "disables" popups is installed:
browser.setPopupHandler(p -> {
browser.loadURL(p.getURL());
return null;
});
Any ideas on how I might resolve this issue so that links in PDF documents behave as expected?

My name is Dmitry and I’m on the JxBrowser Support team.
Thank you for reporting that issue.
Currently, links from PDF do not work in JxBrowser. I have created an appropriate task in our issue tracking system and we will fix it in one of the future versions of JxBrowser.

Related

Provide WebView with Url to Asset

In my Uno UWP project, I can view an html Asset file (w/ Content BuildAction), stored in my shared project, using the following:
var myAssetUri = new Uri("ms-appx-web:///Assets/Html/index.html");
myWebView.Navigate(myAssetUri);
However, this does not work with Android or WASM (not yet tried on other platforms). On WASM, I get a blank page. On Android, I get a page with the message:
The webpage at ms-appx-web:///Assets/Html/index.html could not be loaded because:
net::ERR_UNKNOWN_URL_SCHEME
When I look at the package folders for both platforms, I do find my html file:
WASM: bin/Debug/netstardard2.0/dist/package_.../Assets/Html/index.html
Android: (unziping my app's apk) assets/Html/index.html
so, I am guessing I'm not doing something right ... but I don't know what that might be.
The cause is simple: WebView not implemented yet on Wasm nor Skia.
This is the solution after hours investing!!
For you proyect write this line:
var myAssetUri = new Uri("file:///android_asset/Assets/Assets/Html/index.html");
This work 100%

How do you console.log in Atom?

I spent hours on this and can't find a way to do the most basic thing like put console.log("la"); in my code and print it inside Atom when i view the html with html preview package.
I used to have one called console-js and right click on the html preview to launch it, but now, right click does nothing, and this package has some bug that i can't fix Uncaught TypeError: Cannot read property 'getSelectedText' of undefined
I was offered a few packages that has nothing to do with my need :
Script
Console-log
Platformio IDE terminal
Console.
I just can't find a simple way to print a simple thing while running my code inside Atom ( means viewing an html page with Javascript).
Is there a package that do such a simple thing ?
Maybe you can use this:
View -> Developer -> Toggle Developer Tools

pdfjs not opening links in separate window using LinkTarget.BLANK?

Can't get PDFjs to open links in a separate window, tried inserting
PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK;
/sites/all/libraries/pdf.js/build/pdf.js
but after having cleared the cache they still open in the same window.
even tried commenting out
PDFJS.openExternalLinksInNewWindow = (
PDFJS.openExternalLinksInNewWindow === undefined ?
false : PDFJS.openExternalLinksInNewWindow);
FYI: Using this in Opigno LMS where a Slide renders the PDF with pdfjs.
After I upgraded from pdf 7.x-1.9 to the current 7.x-1.x-dev version with drush and cleared the cache it is working now, even when I reverted back the code so perhaps it's part of the new dev version :)

Error shows "Failed to get text for stylesheet (#): No style sheet with given id found", what does this mean?

I'm getting this error in Chrome when it loads this application I am working on:
Failed to get text for stylesheet 50: No style sheet with given id found
Subsequent page loads repeat the error, but with a different number:
Failed to get text for stylesheet 152: No style sheet with given id found
This only happens in Chrome, and only with this application. There is no stack trace, reference, or any other information about what id is given, what the stylesheet in question is, or what is causing this generally. How can I find what is causing this error and fix it?
I had the same problem. It looks like a bug in Chrome's live-edit CSS/JS. Notice how the number changes on each request.
I fixed it by closing all the files that I had edited in the dev tools 'source' tab and then refreshed the page.
The error went away after I closed all the files in the 'source' tab.
I tried to reproduce it after closing the files, but I can't seem to recreate it, yet.
Here is a picture showing where to find the 'source' tab:
Still present in Chrome 46.0.2490.80 m (64-bit).
Closing sources tabs 'fixed' it.
Fixt it by holding [Ctrl] + [Shift] and refresh the page
Just experienced this today if you have a .css file open in the dev tools. If you close the .css file and reload, the issue does not happen.
Chrome 48.0.2564.109 (64-bit)

some time i get unspecified error in js

Sometimes we get "Unspecified error" in IE (javascript error), when using MaskedEdit.application build in framework 2.0
if i enable the debuggin javascript setting then i found this error otherwise a particular part of the page doesnot display.
If we debug we can see that it happens on below line
//only for ie , for firefox see keydown
if (document.activeElement)
{
if (e.id == document.activeElement.id)
{
hasInitialFocus = true;
}
}
when i tried to search where this code is written then i found this code in ajaxcontroltool.dll file.
and this dll is of third party and i can't change in this dll so what should i do to solve the problem.
i tried this in IE8,but i didn't get the error in IE8 it means the code run smoothly/errorless in IE8.
i get this error in IE9 as occurence ratio of once in 6 times open a page.
it became my headache if any one know please help me out of this.
It looks like a browser issue or dll issue.
Has anyone else noticed this?
Thanks and regards
shoaib
and this dll is of third party and i can't change in this dll so what should i do to solve the problem
Actually you can, as the AjaxControlToolkit is an open source project. You can download project source code from the CodePlex: http://ajaxcontroltoolkit.codeplex.com/ and customize it for your needs

Resources