JavaDoc links to developers.google.com
Some types in the Truth-JavaDoc are still linked to developers.google.com URLs, which are not accessible for the public.
Example: In the JavaDoc for class LiteProtoTruth and method "assertThat" (https://truth.dev/api/1.0/com/google/common/truth/extensions/proto/LiteProtoTruth.html#assertThat-com.google.protobuf.MessageLite-) the link for parameter type "MessageLight" points to https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/MessageLite.html?is-external=true
https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/MessageLite.html?is-external=true is a publicly-accessible link (as far as I can tell, I've tried it incognito from my cell phone, etc.).
Can you share any more information about why you think this URL isn't publicly-accessible?
The error occurs when the JavaDoc is opened in a desktop browser using the frame-layout. Without frames or on mobile it is displayed without any problems.
The steps are:
- Open JavaDoc URL https://truth.dev/api/1.0/ in desktop browser
- Select "INDEX" and click on "assertThat(Message)"
- In the method documentation click on the "Message" type
- The error is: Refused to display 'https://developers.google.com/protocol-buffers/docs/reference/java/com/google/protobuf/Message?is-external=true' in a frame because it set 'X-Frame-Options' to 'sameorigin'.
Sorry for the somewhat weak description in my bug report!
I can repro the detailed report @markuss5l just gave.
Chrome gives me "developers.google.com refused to connect."
As a work around, you can right click on "Message" and select "Open link in new tab" (because the single-origin frame policy no longer applies).
Not exactly sure how we can work around this though...short of maybe inserting a target= for external links. It seems like this problem probably occurs for a lot of external javadocs though?
Thanks for the reproduction steps @markuss5l! I suspect that developers.google.com has a strict framing policy out of an abundance of caution.
I'll see what I can do in terms of resolving this from the protobuf javadoc side.
A change to developers.google.com does sound ideal if it's acceptable to them. Thanks for looking into it. (Thanks also for the report.)
As a fallback plan, we could link to javadoc.io instead of developers.google.com: https://javadoc.io/doc/com.google.protobuf/protobuf-java/3.9.0-rc-1
javadoc.io doesn't seem to mind being in a frame: From https://guava.dev/releases/snapshot-jre/api/docs/, click com.google.common.base in the main pane (not the top-left), and then follow the link near the top to @ParametersAreNonnullByDefault.
(Or, presumably, we could look into hosting our own docs on developer.google.com -- thus inflicting this problem on anyone who links to us :) But if the developer.google.com people believe that banning frames is the safe thing to do even for Javadoc (as opposed to just being stuck with it because they apply that policy in general), then maybe we should.)