Git Product home page Git Product logo

devnotes's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

devnotes's Issues

24/3/2019 - Exporting Android Chrome Tabs

https://github.com/lmmx/devnotes/wiki/Export-all-Chrome-tabs-on-Android
Can't get the code to work anymore as it seems Google changed the structure. This works:

tabs = document.querySelector('#-blink-dev-tools > div.widget.vbox.root-view > div > div > div > div:nth-child(1) > div > div').shadowRoot.querySelectorAll('div > div.hbox.devices-container > div.flex-auto.vbox > div > div.device-browser-list.vbox > div > div.device-page-list.vbox.device-view-more-toggled > .vbox')
str = '';
for (i=0;i<tabs.length;i++){
if (tabs[i].querySelector('.device-page-url .devtools-link') != null){
str += '- ['+tabs[i].querySelector('.device-page-title').textContent + '](' + tabs[i].querySelector('.device-page-url .devtools-link').getAttribute('href') +')\n'
} else {
console.log(tabs[i])
}
}
copy(str)

Just the top part. Your code is brilliant, thanks lots for it!

Importing a list of URLs as bookmarks

This builds upon your method of importing tabs and allows the tabs to be imported as bookmarks.
Not the cleanest code but works.

This can only be done manually and imported through chrome's import bookmarks in HTML API due to rate limiting.

https://stackoverflow.com/questions/19374378/how-to-import-bookmarks-programmatically

tabs = document.querySelector("#-blink-dev-tools > div.widget.vbox.root-view > div > div > div > div:nth-child(1) > div > div").shadowRoot.querySelector("div > div.hbox.devices-container > div.flex-auto.vbox > div > div.device-browser-list.vbox > div > div.device-page-list.vbox.device-view-more-toggled").querySelectorAll("div.vbox")



str = `<!DOCTYPE NETSCAPE-Bookmark-file-1>
<!-- This is an automatically generated file.
     It will be read and overwritten.
     DO NOT EDIT! -->
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<TITLE>Bookmarks</TITLE>
<H1>Bookmarks</H1>
<DL><p>
    <DT><H3 ADD_DATE="1536609418" LAST_MODIFIED="1536609442" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks bar</H3>
    <DL><p>`;
for (i=0;i<tabs.length;i++){
  if (tabs[i] != null){
    str += ' <DT><A HREF="' + tabs[i].querySelector('div.device-page-url > x-link').attributes.href.value +' "ADD_DATE="1536609434">'+ tabs[i].querySelector('.device-page-title').textContent + '</A>' +'\n'
  } else {
    console.log(tabs[i])
  }
}

str+=    `</DL><p>
</DL><p>`;
copy(str)

Some URLS may have the chrome-distiller prefix. These have to be resolved manually as they are web pages that were in Reader's mode when imported as tabs. Please feel free to clean up the code, add this to the wiki or spin into a browser extension etc.

Truncated URLs

Latest Chrome browser version truncates the URLs taken from here:

document.querySelectorAll('.subrow-box .url')

I think we should wait to a Chrome upgrade, because I couldn't find any other source to get those URLs.

What do you think?

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.