The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.
Send messages to iframe using iframeEl.contentWindow.postMessage
Recieve messages using window.addEventListener('message')
<!-- Goes into viewer.html just before ending </body> --> | |
<script> | |
let pinchZoomEnabled = false; | |
function enablePinchZoom(pdfViewer) { | |
let startX = 0, startY = 0; | |
let initialPinchDistance = 0; | |
let pinchScale = 1; | |
const viewer = document.getElementById("viewer"); | |
const container = document.getElementById("viewerContainer"); | |
const reset = () => { startX = startY = initialPinchDistance = 0; pinchScale = 1; }; |
const functions = require('firebase-functions'); | |
const gcs = require('@google-cloud/storage')(); | |
const sharp = require('sharp') | |
const _ = require('lodash'); | |
const path = require('path'); | |
const os = require('os'); | |
exports.generateThumbnail = functions.storage.object('uploads/{imageId}').onChange(event => { | |
const object = event.data; // The Storage object. |
<svg class="spinner" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" > | |
<style> | |
.spinner { | |
animation: rotator 5s linear infinite; | |
transform-origin: center; | |
} | |
@keyframes rotator { | |
0% { transform: rotate(0deg); } | |
100% { transform: rotate(360deg); } |
public static Set<String> getNativeAppPackage(Context context, Uri uri) { | |
PackageManager pm = context.getPackageManager(); | |
//Get all Apps that resolve a generic url | |
Intent browserActivityIntent | |
= new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.example.com")); | |
Set<String> genericResolvedList | |
= extractPackagenames(pm.queryIntentActivities(browserActivityIntent, 0)); | |
//Get all apps that resolve the specific Url |
i386 : iPhone Simulator | |
x86_64 : iPhone Simulator | |
arm64 : iPhone Simulator | |
iPhone1,1 : iPhone | |
iPhone1,2 : iPhone 3G | |
iPhone2,1 : iPhone 3GS | |
iPhone3,1 : iPhone 4 | |
iPhone3,2 : iPhone 4 GSM Rev A | |
iPhone3,3 : iPhone 4 CDMA | |
iPhone4,1 : iPhone 4S |
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |