Git Product home page Git Product logo

devtools-snippets's Issues

Automate run of snippet

Is it possible to make run of snippet automated, so i don't have to run it manually every time when page reloads?

Code is under Copyright - license information missing

First of all i would like to thank you for your snippets, especially the performance.js. Using it as a chrome snippet already helped me to better understand how to use the api.

According to https://choosealicense.com/no-license/ (a site operated by GitHub, Inc.) any repository that does not include a license defaults to exclusive copyright:

When you make a creative work (which includes code), the work is under exclusive copyright by default. Unless you include a license that specifies otherwise, nobody else can use, copy, distribute, or modify your work without being at risk of take-downs, shake-downs, or litigation.

And further down

If you find software that doesn’t have a license, that generally means you have no permission from the creators of the software to use, modify, or share the software.

Although you wrote that everyone can

Feel free to use, modify, or share any of these snippets.

I am uncertain if this is enough or if a missing license is still enough to prohibit everyone from using your code.
I am sorry that this is a kind of a hassle.

Export/import window not popping up upon running the snippet

I am using the chrome verison 54 when i run the snippet from separate dev tools window mode, it doesn't bring up any export/import dialog as mentioned in the documentation (last two steps).
Instead it just pops a dialog asking to be in the seperate window mode.

Keyboard Shortcuts?

Dunno if this could be a thing... but it'd be great to be able to invoke snippets via keyboard shortcuts.

Burden for supporting that is agreeably not on this repo. If wiring keyboard shortcuts to snippets is possible, however, I'd love to see how to do it on the README.

I use the heck out of hashlink.js, but having to open up the dev tools panel is a bit cumbersome.

Enhanced formcontrols.js

Hi, I've modified the formcontrols.js snippet to create an HTML report via a data URI. Helpful in my case where I needed to share form controls with a team. I also excluded hidden elements.

(function() {

var forms = document.querySelectorAll("form");
var sMU = "

Web form audit

";
sMU += "

";
for (var i = 0, len = forms.length; i < len; i++) {
var tab = [ ];

sMU += "

Form: " + forms[i].id + " " + forms[i].name + "

";
sMU += "";
sMU += "";
sMU += "";
sMU += "";
sMU += "";
sMU += "";
sMU += "";
sMU += "";

console.group("HTMLForm \"" + forms[i].name + "\": " + forms[i].action);
console.log("Element:", forms[i], "\nName:    "+forms[i].name+"\nMethod:  "+forms[i].method.toUpperCase()+"\nAction:  "+forms[i].action || "null");

["input", "textarea", "select"].forEach(function (control) {
  [].forEach.call(forms[i].querySelectorAll(control), function (node) {

if (node.type != "hidden") {
sMU += "

";
sMU += "";
sMU += "";
sMU += "";
sMU += "";
sMU += "";
sMU += "";
}
tab.push({
"Element": node,
"Type": node.type,
"Name": node.name,
"Value": node.value,
"Pretty Value": (isNaN(node.value) || node.value === "" ? node.value : parseFloat(node.value))
});

  });
});

console.table(tab);
console.groupEnd();

sMU += "

IdHTML5 TypeNameValueFormatted
" + node.id + "" + node.type + "" + node.name + "" + node.value + "" + (isNaN(node.value) || node.value === "" ? node.value : parseFloat(node.value)) + "



";
}

window.location.href = "data:text/html;charset=UTF-8,"+sMU;

})();

Some suggestions

Fantastic work on this once again!

Some ideas:

  • Include screenshots for your snippets in the readme file. This makes it super easy to see what a particular snippet does and also makes it easy for others to share it if they think it'd help others :)
  • For more details on console.table, checkout https://plus.google.com/+AddyOsmani/posts/PmTC5wwJVEc We're going to have more official docs on this soon :)
  • Snippets are also super-useful for storing bookmarklets. If there are particular developer bookmarklets that you think would be worth throwing in here, feel free to. They just need to work from the Snippets panel.

Export to XML

Hi

Thanks for a great project
Is there a plan for a tool that can export the snippets in the project to XML?

Code Snippets Sync

Hi there,
Would be cool to be able to sync snippets with google account settings.
Thanks.

After console.save, the HTML element disappears from the console

I don't know Javscript syntax so please excuse any mistakes I might be typing.

There is one HTML element from a website I want to write to a text file so that I can read it in Python. I ran this code below intending to do that:

var el = document.getElementsByClassName("exc-param-dr-date hasDatepicker")[0];
el.appendChild(document.createTextNode("Test"));

var tmp = document.createElement("div");
tmp.appendChild(el);

var sh = console.log(tmp.innerHTML);

(function(console){

console.save = function(data, filename){

if(!data) {
    console.error('Console.save: No data')
    return;
}

if(!filename) filename = 'console.json'

if(typeof data === "object"){
    data = JSON.stringify(data, undefined, 4)
}

var blob = new Blob([data], {type: 'text/json'}),
    e    = document.createEvent('MouseEvents'),
    a    = document.createElement('a')

a.download = filename
a.href = window.URL.createObjectURL(blob)
a.dataset.downloadurl =  ['text/json', a.download, a.href].join(':')
e.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null)
a.dispatchEvent(e)

}
})(console)

console.save(tmp.innerHTML,['to-date.json'])

I was able to successfully write that element to a text file. However, that same element then disappeared from the html code afterwards. How can I avoid this?

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.