无法使用 Google Drive 中的 Drivenotepad 应用打开 txt 文件

无法使用 Google Drive 中的 Drivenotepad 应用打开 txt 文件

我的 Google Drive 中保存了名为“version.txt”的纯文本文件。当我使用右键菜单中的“Drive Notepad”应用程序打开此文件时,它会显示消息需要授权,不知道为什么驱动器记事本出现授权错误,而我仍然登录!!

有人遇到这个问题吗?

因为以前使用驱动器记事本应用程序打开相同的文件没有问题。

编辑:打开文件时控制台日志输出以下文本

app.js:393 Loading default/localStorage settings...
app.js:475 [user settings] ext: txt
all.build.js:4 [user settings] wordWrap: true,,
all.build.js:4 [user settings] wordWrapAt: 80
all.build.js:4 [user settings] fontSize: 1
all.build.js:4 [user settings] widget_anchor: r,5.34407027818448,b,11.604940155406057
all.build.js:4 [user settings] showGutterHistory: 1
all.build.js:4 [user settings] lastDNVersionUsed: 
all.build.js:4 [user settings] newLineDefault: windows
all.build.js:4 [user settings] historyRemovedIsExpanded: true
all.build.js:4 [user settings] softTabN: 4
all.build.js:4 [user settings] tabIsHard: 0
all.build.js:4 [user settings] widgetSub: general
all.build.js:4 [user settings] theme: chrome
all.build.js:4 [user settings] pane: pane_help
all.build.js:4 [user settings] pane_open: true
all.build.js:4 [user settings] find_regex: false
all.build.js:4 [user settings] find_whole_words: false
all.build.js:4 [user settings] find_case_sensitive: false
all.build.js:4 [user settings] help_inner: main
all.build.js:4 [user settings] find_goto: false
all.build.js:4 [user settings] find_replace: false
all.build.js:2 Strangely structured error:
all.build.js:2 Object
client_id:"591525900269-94ok9krafau8qa24666btvccmsfnq5fp.apps.googleusercontent.com"
cookie_policy:"single_host_origin"
error:"immediate_failed"
error_subtype:"access_denied"
response_type:undefined
status:Object
google_logged_in:false
method:null
signed_in:false
all.build.js:3 Error. See developer console for details.
all.build.js:4 [user settings] 
widget_anchor:l,8.784773060029282,t,16.420077433628318

答案1

好的,当我使用 drivenotepad 应用程序打开 txt 文件时,我发现浏览器 url 中有一些奇怪的东西。

URL 看起来是这样的

https://drivenotepad.github.io/app/?state=%7B"ids":%5B"1RvRuTWDSUIl1ritooHDWLUtZg0BR3iL-"%5D,"action":"open","userId":"{userId}"%7D

它显示了"userId":"{userId}"所以我输入了我的电子邮件 ID并重新加载页面。"userId":"[email protected]"

现在,文本文件已在 drivenotepad 应用程序中成功打开,并包含文本内容。

还得到了成功日志控制台:

   [user settings] ext: txt
app.js:475 [user settings] wordWrap: true,,
app.js:475 [user settings] wordWrapAt: 80
app.js:475 [user settings] fontSize: 1
app.js:475 [user settings] widget_anchor: l,8.784773060029282,t,16.420077433628318
app.js:475 [user settings] showGutterHistory: 1
app.js:475 [user settings] lastDNVersionUsed: 
app.js:475 [user settings] newLineDefault: windows
app.js:475 [user settings] historyRemovedIsExpanded: true
app.js:475 [user settings] softTabN: 4
app.js:475 [user settings] tabIsHard: 0
app.js:475 [user settings] widgetSub: general
app.js:475 [user settings] theme: chrome
app.js:475 [user settings] pane: pane_help
app.js:475 [user settings] pane_open: true
app.js:475 [user settings] find_regex: false
app.js:475 [user settings] find_whole_words: false
app.js:475 [user settings] find_case_sensitive: false
app.js:475 [user settings] help_inner: main
app.js:475 [user settings] find_goto: false
app.js:475 [user settings] find_replace: false
succeeded getting user info.
app.js:429 Transfering to realtime model for settings.
app.js:475 [user settings] widget_anchor: r,5.34407027818448,b,11.604940155406057
app.js:475 [user settings] lastDNVersionUsed: 2016a
app.js:1042 succeeded loading settings
app.js:1011 succeeded loading file body and metadata.

答案2

Tampermonkey 解决方案

// ==UserScript==
// @name         DriveNotepad
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  WorkAround For DriveNotepad
// @author       SmartManoj
// @match        https://drivenotepad.github.io/app/*userId%22:*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    var mail_id="...";
    var url=window.location.href;
    var newUrl = url.replace(/userId[%:\d]*%7D/i,"userId%22:%22"+mail_id+"%22%7D");
    console.log(newUrl);
    if (url!=newUrl)window.location.href=newUrl;
    // Your code here...
})();

答案3

右键点击并选择“预览”即可阅读。顶部有一个下拉菜单,默认为“Drive Notebook”。下拉到“Google Docs”选项。文件将被转换并打开以供编辑。

相关内容