Skip to content

Commit 7687fb0

Browse files
authored
Merge pull request #11 from BuildFire/fix-adobe-acrobat-provider
Fix: support adobe acrobat provider
2 parents cd1c2d4 + 5955e4b commit 7687fb0

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

widget/index.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,19 @@ <h2>Success!</h2>
1818
function dataLoadedHandler(result, fromUpdate) {
1919
if (result && result.data && (result.id || fromUpdate)) {
2020
var content = result.data.content;
21-
var isHosted = content.url.includes('drive.google.com') || content.url.includes('dropbox.com') || content.url.includes('documentcloud.adobe');
21+
// array of providers which they processing their own PDF viewer
22+
const hostedProviders = ['drive.google.com', 'dropbox.com', 'documentcloud.adobe', 'acrobat.adobe.com'];
23+
/*
24+
- isHosted is a flag that helps the app distinguish between hosted and non-hosted content URLs,
25+
allowing for different handling mechanisms based on the hosting platform.
26+
- for web and android :
27+
1- If isHosted is true, the app opens the content URL using buildfire.navigation.openWindow(content.url, "_blank"),
28+
the providers in hostedProviders array they host the PDF assets in their view.
29+
30+
2- If isHosted is false, the app opens the content URL using a Google Docs viewer
31+
*/
32+
const isHosted = hostedProviders.some(hostedString => content.url.includes(hostedString));
33+
2234
if (content && content.url) {
2335
buildfire.getContext(function (err, context) {
2436
if (context.device.platform == "web") {

0 commit comments

Comments
 (0)