Coder Social home page Coder Social logo

romannurik / androidsdksearchextension Goto Github PK

View Code? Open in Web Editor NEW
458.0 458.0 56.0 1.72 MB

A Chrome extension that adds an 'ad' omnibox command and view source links for the Android SDK.

License: Apache License 2.0

JavaScript 97.26% Shell 0.28% HTML 1.43% CSS 1.03%

androidsdksearchextension's Introduction

Hi, I’m Roman. I’m a design lead on Project IDX and Firebase at Google in New York, but I also tinker with web dev and Sketch/Figma plugins. I've also done Android stuff like Muzei. See more of my work on my personal site.

androidsdksearchextension's People

Contributors

chiuki avatar dvdandroid avatar jakewharton avatar johnjohndoe avatar kisty avatar nickbutcher avatar pocmo avatar romannurik avatar simonmarquis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

androidsdksearchextension's Issues

Missing init .js script, plugin broken!

One of SDK reference JS files is no longer available, and endlessly retry:

'https://developer.android.com/reference/jd_lists.js',

Is this script required to run the plugin?

Also, it would be great to have exponential backoff on the error callback:

function _error(script) {
console.error('Failed to load ' + script + '. Retrying in 5 seconds.');
window.setTimeout(init, 5000);
}

For instance:

var backoff = 5000;

function _error(script) {
  backoff *= 2;
  console.error('Failed to load ' + script + '. Retrying in ' + (backoff / 1000) + ' seconds.');
  window.setTimeout(init, backoff);
}

Support androidx

  1. Have the extension include androidx results in the omnibox search suggestions drop-down.
  2. Show "view source" link on androidx documentation pages.

Item 1 is far more critical from my perspective than item 2. I pull up documentation all the time, but view the source only occasionally. So if item 1 is easy to add without adding the other, go ahead.

`android.support.test` classes missing from Omnibox

Thanks to the resolution of Issue #9, source links for test classes are much improved. However, currently nothing in the android.support.test package (Espresso, UI Automator, etc.) shows up in the ad <search term> omnibox search index.

I'm not sure if it's best for this to be added to https://developer.android.com/reference/lists.js, or to include another JS reference file in this project.

point to the same tag as the requested api level in the url for "view source"

basically change /ref/heads/master to the right tag level found here . Its something I find myself doing a quite a bit. Also, I think professional android developers use it to compare implementations of a class at an older version of android os. This would only apply to class and resource paths if the user decides he wants to look at google source code instead of git. Adding git would be trivial.

Additions would be to...
[ ] make /refs/heads/master a placeholder and fill it in with the current api level.
[ ] register a onChange listener for that api selector dropdown
[ ] map that number to the latest tag and update the url if it changes.

Things to consider:

  • new tags are added to AOSP as new rcs are made. The Android Team doesn't have a consistent rule or algorithm to determine when the the api level shifts to a new version of android. This means someone will have to go in and update the map to point to the right tag in the url. Obviously keeping current behaviour in states of uncertainty is advised.
    @romannurik , I'm curious if to see if you have ideas on this.

  • What if that class is not in that level?
    Previously, this was never a problem. nothing ever gets deleted, and head tracks all things. Now it will certainly break if you attempt to view JobService in api 12 or . At the same time, there is a big warning when you attempt to toggle into a lower api level, so I say the user was warned. Otherwise, I could write a function to determine if this class is unsupported and default to master in that case.

I've completed the first two bullet points, and the second half of the last bullet point.

Show View Source if and only if source exists

It will be better to show the View Source if and only if the source file exists, it can send a HEAD request to verify if the file exists. There are lots of file URLs that return the 404 error.

Support v7 Class Links Broken

Since the release of the latest AppCompat package in the support library, the source code structure has changed and all View Source links that point to classes in support/v7 do not account for the fact these files are now split by project.

Example: ActionBarActivity.java
https://developer.android.com/reference/android/support/v7/app/ActionBarActivity.html
...links to...
https://android.googlesource.com/platform/frameworks/support/+/refs/heads/master/v7/java/android/support/v7/app/ActionBarActivity.java
..but is now at...
https://android.googlesource.com/platform/frameworks/support/+/refs/heads/master/v7/appcompat/src/android/support/v7/app/ActionBarActivity.java

Thanks for all your hard work!

GCM reference URL breaks the extension

It seems like the https://developer.android.com/reference/gcm_lists.js doesn’t exist anymore.

$ http --verbose GET https://developer.android.com/reference/gcm_lists.js
GET /reference/gcm_lists.js HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Host: developer.android.com
User-Agent: HTTPie/0.9.2

HTTP/1.1 404 Not Found
Alternate-Protocol: 443:quic,p=1
Cache-Control: no-cache
Content-Length: 112
Content-Type: text/html; charset=utf-8
Date: Fri, 29 May 2015 08:17:29 GMT
Expires: Fri, 01 Jan 1990 00:00:00 GMT
Server: Google Frontend

<html><head><title>404: Not Found</title></head><body><b><h2>Error 404</h2><br/>File not found</b></body></html>

Probably it was moved somewhere to https://developers.google.com/android/reference/packages, but there are no reference JS files as far as I can see.

Unfortunately it breaks the extension itself and there is an infinite “Loading Android SDK search data…” sign at the omnibox.

VectorDrawableCompat link to source results in 404

RecyclerView "view source" goes to wrong URL

Attempting to use the view source link on the recyclerview page goes to the wrong URL and results in a 404. Found on DefaultItemAnimator too (perhaps all RecyclerView source?)

Steps to reproduce:

What should happen:

What does happen:

DOM has changed

Hi Roman,

Once again the DOM of developer.android.com has changed and broke the *View Source link.
I think now you should append the link to this element <h1 class="api-title"></h1>.

Add `view documentation` to api sources

I think it would be a neat feature, if there were the ability to view documentation for documented source files.

Just the other way round as the view source option.

Doesn't work with Vivaldi

Absolutely love this extension! Tried this with Vivaldi (1.8.770.56) browser which is based on Chromium but I think it hijacks tab behaviour (boo!) Any idea how to solve it?

Thanks so much @romannurik!

Different shortcut

Can be the shortcut (now "ad") adjustable ? In extension preferences f.e. ?

New release?

I see several broken links in the "View Source" button, and saw a number of improvements were committed in the last couple of months.

A new release to the Chrome Web Store would be much appreciated!

Policy compliance issue around loading external scripts

Email from chromewebstore-dev-support:

We routinely review items in the Chrome Web Store for compliance with our Program policies to ensure a safe and trusted experience for our users. We recently found that your item "Android SDK Search", with ID: hgcbffeicehlpmgmnhnkjbjoldkfhoin did not comply with our policies. Your item was found to be suspicious and has requested/fetched one or more external scripts.

To have your item reinstated, please make any necessary changes to avoid requesting or executing remotely hosted code (including by referencing remote javascript files or executing code obtained by XHR requests). Your item is still published, but is at risk of being removed from the Web Store.

Please make the above changes within 15 days in order to avoid removal. Once you have made these changes you may submit and publish a new draft in the developer dashboard. Your draft will be reviewed for policy compliance which typically takes a few business days. If the outcome of the review is successful, your store listing will remain published. If we find additional issues with your item, we will send you another email with details. If you have any questions about this email, please respond and the Chrome Web Store developer support team will follow up with you.

Important Note:

Your item will still be subject to review and may be removed from the store within the warning period. Repeated or egregious policy violations in the Chrome Web Store may result in your developer account being suspended or could lead to a ban from using the Chrome Web Store platform. This may also result in the suspension of related Google services associated with your Google account. Thank you for your cooperation,

Search result improvement. R.String is preferred over lang.String

Hello,

If I search for String then R.String is preferred over lang.String even though, I would hope, lang.String is more visited, useful, and desired.

Is there a specific reason for preferring R.String over lang.String and if we could improve the results that would be great.

screenshot_20190208_124802
screenshot_20190208_124815

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.