[–] 1 point 1 year ago (1 child)

Yeah I don't know much about it. I just know our company has an internal API and the project owner was telling me about all the shit they have to do beyond just sending emails. What a headache!
(don't get me started on developing all that in-house. It's "historic" code)

  • source
  • parent
  • context
  • [–] 2 points 1 year ago (1 child)
    • local machine hardware
    • Serial Number
    • Hardware ID
    • UUID
    • Windows Device ID
    • Windows Product ID
    • local machine ram

    Can not be accessed through Javascript anyway

    • local machine operating system + version

    Accessible through so called "User Agent", you could install User Agent changer addon to make your machine like its running different operating system/ web browser

    • local machine time

    when resist fingerprinting is enabled, local time is not shown, instead it always think your time is UTC

  • source
  • parent
  • context
  • [–] [S] 1 point 1 year ago (2 children)

    by sensitive information I'm referring to

    • local machine time
    • local machine ram
    • local machine operating system + version
    • local machine hardware
    • Serial Number
    • Hardware ID
    • UUID
    • Windows Device ID
    • Windows Product ID
    • ...

    Can I prevent javascript from running specific command that retrieve these information?

  • source
  • parent
  • context
  • [–] 1 point 1 year ago

    Yeh, I'd just do early return.
    It's not much more typing, and I find it easier to read and navigate specific conditional paths.

    Some built in pattern matching would be cool (like the when keyword), but I'm not going to force it into my code

  • source
  • parent
  • context
  • [–] 1 point 1 year ago (1 child)

    Interesting and valid point, but Kotlin's when is not actually pattern-matching. It really is just syntactic sugar for if-else, like you've demonstrated.
    Actual pattern-matching allows matching on the structure of a data type. So, you formulate a pattern to describe the structure and then you can choose different code paths based on whether the pattern matches or you can also access fields inside of this data type.

    Rust allows pattern-matching even in variable assignments, which is going to look funky, but I think it shows quite well that pattern-matching isn't just a fancy switch statement: https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=3a8d126fa0cb9736597793915b00dd5d

    So what happens is that:

    • there's a check whether the data type has the described structure, and
    • where the pattern contains wildcards (like variable 'slots'), the corresponding field values from the data type get put into those wildcards.

    When someone writes this in Rust:

    let x = 1;
    

    It's still pattern matching under the hood, but the pattern x is just a singular wildcard, so the right-hand side just gets 'assigned' to that variable name.

    And with these simple examples, you might think that being able to access field values this way is silly, since you can also access them via my_data_type.foo, but it becomes more useful with deeply nested data types, and in particular in statically typed languages, it allows you to work with different data types without type casting. So, it would be more useful of a feature for TypeScript than it might be for JavaScript.

  • source
  • view more: ‹ prev