Skip to content

Update index.android.js to support communication with app#193

Merged
AbeJellinek merged 3 commits intozotero:masterfrom
Dima-Android:master
Mar 19, 2026
Merged

Update index.android.js to support communication with app#193
AbeJellinek merged 3 commits intozotero:masterfrom
Dima-Android:master

Conversation

@Dima-Android
Copy link
Copy Markdown
Contributor

No description provided.

@Dima-Android
Copy link
Copy Markdown
Contributor Author

When i was integrating reader into the app i used version from mid december and it worked well.
Now i am trying to use version from march 10th and reader for some reason doesn't work. The WebView remains blank.

I do the following from the Android's WebView:

  1. Load view.html
  2. As it loads in console i see:

WEBVIEW_LOG_TAG:Uncaught ReferenceError: Cannot access 'PageWidth' before initialization -- From line 41439 of file:///data/user/0/org.zotero.android.debug/files/runningHtmlEpubReader/view.js

  1. Wait for it to finish loading
  2. call createView (you can find implementation in the file in index.android.js
  3. In console I see:

WEBVIEW_LOG_TAG:Uncaught ReferenceError: createView is not defined -- From line 1 of file:///data/user/0/org.zotero.android.debug/files/runningHtmlEpubReader/view.html

Can you please help me debug and fix this, as I am not sure what is the cause.

@Dima-Android Dima-Android changed the title Required changes for index.android.js to enable communication betwen WebView and rest of the app. Required changes for index.android.js to enable communication between WebView and rest of the app. Mar 19, 2026
AbeJellinek added a commit that referenced this pull request Mar 19, 2026
@AbeJellinek
Copy link
Copy Markdown
Member

Give it a try now? Circular dependency issue, though it's odd that it only caused an error on Android.

@AbeJellinek
Copy link
Copy Markdown
Member

And pushed a lint commit here - this looks good as long as it's working on your end after that fix!

@Dima-Android
Copy link
Copy Markdown
Contributor Author

It works! Thank you. Please merge.

@AbeJellinek AbeJellinek changed the title Required changes for index.android.js to enable communication between WebView and rest of the app. Update index.android.js to support communication with app Mar 19, 2026
@AbeJellinek AbeJellinek merged commit cf9d449 into zotero:master Mar 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants