Coder Social home page Coder Social logo

Comments (8)

earthlng avatar earthlng commented on August 15, 2024 1

pref("browser.newtabpage.directory.source", "data:text/plain,{}"); // ghacks: "data:text/plain,"
@Thorin-Oakenpants, @pyllyukko, we should both use "data:,{}" - the code expects a JSON and complains otherwise, and with that format it defaults to "text/plain" and it also sets a charset that way, which again otherwise it can cause a warning in the console.
see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs
ie. data:, is the short form for data:text/plain;charset=US-ASCII,

from user.js.

earthlng avatar earthlng commented on August 15, 2024 1

creates an empty directoryLinks.json file in the appdata/local Mozilla folder
it creates that file with {} in it, but in the profile folder in my case. ie it's not an empty file and the folder is wrong afaik. everything after the comma is the file content. data:text/plain, would write an empty file, but it doesn't because it's not JSON while data:text/plain,{} creates a valid "empty" 2-byte JSON file.
I think this behavior is preferable because it retro-actively overwrites the content of that file, while otherwise, the code fails, produces a warning in the console and doesn't write/overwrite that file at all, if I remember correctly.

We have 5 data:text/plain, and 0 data:text/plain,{} atm!

from user.js.

Atavic avatar Atavic commented on August 15, 2024 1
  • data:,
  • data:text/plain,
  • data:text/plain;charset=US-ASCII,

from user.js.

earthlng avatar earthlng commented on August 15, 2024

Oh, damn, so only when it's finished huh? Well I saw that too late so I adjusted my script, grabbed both versions latest master and compared them. The result is ... well, a lot of work still to be done....

combined prefs:  520
- 114 matching prefs
- 406 diffs
>   79 missing in ghacks
>  314 missing in pyllyukko
>   13 different values

The 314 are including the 23 parrot prefs.
I can provide a diff whenever one is needed, takes literally seconds to create them.

from user.js.

earthlng avatar earthlng commented on August 15, 2024

I didn't look at the file-content tbh, my script parsed all active prefs, idk if deprecated are in there for pyllyukko's. here is the output: http://pasted.co/b0235e9e

from user.js.

earthlng avatar earthlng commented on August 15, 2024

I see now, your script doesn't discard the status of the pref
No, of course not - you said do a diff of active values and investigate
I can adjust my script if you like, but I need to figure out how to best display that.

from user.js.

earthlng avatar earthlng commented on August 15, 2024

I don't understand why we should use the worst of the 3 possible ways. (see Atavic's comment)
Either use the shortest which sets a default (that I trust mozilla is not gonna change), or make it bullet-proof and use the long version.
Yeah, I read the TBB ticket where they started using it, but they also don't want any console warnings/errors, and tbh it seemed kind of lazy. We shouldn't do something stupid just because TBB also does it. Maybe someone from their team will eventually see our better and improved way and change it in TBB too.
Just my 2 cents

from user.js.

earthlng avatar earthlng commented on August 15, 2024

But they never get used

Then why change them at all? But we do change them (and I think we should) so why not use the best possible way instead of the worst?
I'm not gonna argue anymore. I use the short form in my own user.js. Do what you want.

from user.js.

Related Issues (20)

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.