我想在Google驱动器中隐藏顶部的选项栏.我该如何实现?我正在使用cordova inAppBrowser打开此链接.
I want to hide the top options bar in google drive. How can I achieve that? I am using cordova inAppBrowser to open this link.
drive.google/file/d/0B_nipvep1WpPd2JXeDdJcUlNYXM/view
我想使用embedded=true,但是我不知道它如何工作.请参见下图.
I want to use embedded=true but I don't know how it would work. Please see the image below.
推荐答案
可能会帮助您
您必须等到inAppBrowser页面加载完成.
You have to wait until your inAppBrowser page loading finishes.
//Set css in your inAppstyle.css .drive-viewer-toolstrip{ display: none !important; opacity: 0 !important; }您必须添加一个事件侦听器:
You must add an event listener:
var inApp = window.open('drive.google/file/d/0B_nipvep1WpPd2JXeDdJcUlNYXM/view', '_blank', 'location=no'); inApp.addEventListener('loadstop', function(){ inApp.insertCSS({ file: 'inAppStyle.css' },onSuccess); });将此路径用于您的android项目文件:///android_asset/{您的文件夹}
Use this path for your android projects file:///android_asset/{your folder}
信息: github/apache/cordova-plugin-file/blob/master/doc/index.md#android-file-system-layout
您的JS
text += '<a href="javascript:void(0)" class="embedURL" onClick="cordova.InAppBrowser.open(\'drive.google/file/d/0B_nipvep1WpPd2JXeDdJcUlNYXM/view\', \'_blank\', \'location=no\')">' + data.docs[i].doc_title + '</a>';更新了JS
text += '<a href="javascript:void(0)" class="embedURL" onClick="openthislink(\'drive.google/file/d/0B_nipvep1WpPd2JXeDdJcUlNYXM/view\')">' + data.docs[i].doc_title + '</a>'; //Create new function function openthislink(ln) { var inApp = window.open(ln, '_blank', 'location=no'); inApp.addEventListener('loadstop', function(){ inApp.insertCSS({ file: 'inAppStyle.css' },onSuccess); }); }更多推荐
如何在Google云端硬盘中隐藏标题和选项栏
发布评论