MozillaZine

build-in pdf-viewer only as exception, not always

User Help for Seamonkey and Mozilla Suite
EckardG
 
Posts: 11
Joined: February 6th, 2020, 12:22 am

Post Posted November 18th, 2020, 1:51 pm

Hello,
the build-in pdf-viewer (activated addon) should be used in seamonkey in combination with the button with document number. PDF is shown in a CSS-popup as overlay. Thats comfortable for users who fill in input fields:

Image

But the clicks to "fax" (green marked, "fax" means view fax document) should not open internal pdf viewer. Default is external pdf viewer.

Somebody here who knows a trick to use internal pdf viewer only in exceptions? Perhaps enable addon with javascript for a moment, then disable after pdf is displayed?
Its a internal intranet app, no problems with security, all is allowed.

tia
Eckard

@ enable/disable addon in firefox using javascript: https://stackoverflow.com/questions/842 ... javascript

EckardG
 
Posts: 11
Joined: February 6th, 2020, 12:22 am

Post Posted November 23rd, 2020, 12:34 pm

Can enable / disable ever work? - special rights/ permissions necessary?

This does not work:

<!DOCTYPE html>
<html lang="en">
<head>
<title>Test pdf</title>
<script>
function disablePDFViewer() {
Components.utils.import("resource://gre/modules/AddonManager.jsm");
AddonManager.getAddonByID("pdf.js", function(addon)
{
if (!(addon.userDisabled))
addon.userDisabled = true;
});
document.getElementById("pdfdiv").innerHTML = '<object data="file.pdf" type="application/pdf" width="100%" height="100%" class="pdfviewer"></object>';
}
</script>
</head>
<body onload="disablePDFViewer();">
<div id="pdfdiv"></div>

</body>
</html>

Can YOU help?

tia
Eckard

PS: somebody here knows how to contact developer of "Android pdf.js"- addon Manuel Reimer? https://addons.mozilla.org/en-US/androi ... id-pdf-js/

Return to SeaMonkey Support


Who is online

Users browsing this forum: No registered users and 2 guests