Page 26 of 26 FirstFirst ... 16242526
Results 251 to 256 of 256

Thread: Programmer's Den

  1. #251
    Senior Member
    Type
    intp
    Join Date
    Dec 2013
    Posts
    1,554
    Quote Originally Posted by Hephaestus View Post
    [...] remembering the previous size and location is part of the feature set. There has to be a file somewhere with that information, and if I can find it I can probably alter it with a command-line script.
    C:\Users\[your_username]\AppData\Local\Google\Chrome\User Data\Default\Preferences

    There is an object like this:

    "window_placement": {
    "bottom": 1042,
    "left": 372,
    "maximized": true,
    "right": 936,
    "top": 170,
    "work_area_bottom": 1050,
    "work_area_left": 0,
    "work_area_right": 1920,
    "work_area_top": 0
    }

    browser.window_placement

    You could also launch chrome from the command line.

  2. #252
    Meae Musae Servus Hephaestus's Avatar
    Type
    INTP
    Join Date
    Dec 2013
    Location
    Ceti Alpha V
    Posts
    13,797
    Quote Originally Posted by scarydoor View Post

    You could also launch chrome from the command line.
    Problem is, my father is anti-Chrome. Firefox command line arguments don't include that--unless it's somewhere in profiles, in which case I can build a movie profile and make shortcut to force that profile.

    But thanks for the waysign, that will save me some searching. If I get it working alright with Chrome he'd probably accept that for the convenience until I figure something out with Firefox.

    It's a little sad how much easier Chrome is to develop for even in little shit like this--the differences in behaviors are... stranged.

    For example, in my window.open call, the margin from the top in Chrome would place the window too low. 145 is the sweet spot that puts the bottom bezel on the top of the taskbar. In Firefox the same setting has the window a good distance above the taskbar. That 170 value gets the bottom bezel as close to the top of the taskbar as Firefox will permit--via that setting. You could put in "top=10000000000" and it would end up in the same place--a smidge higher than desired.

    Then there's the issue of Firefox refusing window.close(), but Chrome takes it no problem. The code looks like it opens only one window for Chrome on my machine.
    People think they understand their own mortality, even when that understanding has just changed.

    --Meditations on Uncertainty Vol ξ(x)

  3. #253
    Senior Member
    Type
    intp
    Join Date
    Dec 2013
    Posts
    1,554
    I got one of those "oh no your computer's been hacked!" pages just then. Uhh. I rebooted the thing. Tried to investigate whatever this page was.

    Here's the original entry point:

    Spoiler: don't click this

    I'm fairly sure there's nothing actually in this. But I take no responsibility.

    At least turn off javascript, or you will be agitated.
    Spoiler: turn off javascript at least

    This loads a basic page with some javascript that then redirects for some reason.

    freepcsuppoprt -callnow -error25f05d . azurewebsites . net

    redirects to a /chx path for chrome, for some reason... where you can see the proper page that's going to piss you off if you haven't got js turned off.




    I think it's a completely nothing page. I can't find anything in there. It's just annoying. There's some really shitty coding too. But some funny things

    you bastards:
    for (let i = 0; i < 1 / 0; i++) document.location.href = "#", window.history.back(), window.history.forward();
    wtf is ~~ in javascript?
    var x = (9999 * Math.random())
    x -> 9147.696313164619
    ~x ->-9148
    ~~x -> 9147

    This little style, which conveniently makes the cursor a giant transparent image with the cursor in the wrong spot:
    cursor: url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD 04JH5AAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAPUExURQAAAAICAgAAAP///5WVlXiCGdAAAAADdFJOUwD8ZX+n/7gAAABvSURBVHja7dbBAUAwEABBQf81i6CGfZipYB3J2bY/GnnAHgec9QjOY9QBccEMaAvugLRgBZQFT0BY8AZ0BV9AVvB8hE t3D8SnYIz2FMxtlI7gfvVzBN1OXM9+1Dsx/ykAAAAAAAAAAAAAAAAAgNcFnc4A9qwo+wMAAAAASUVORK5CYII =&quot 128 128, crosshair;
    Looks like a php programmer. Or I've just been softened by front end frameworks too much to cringe at this:
    <div style="float:left; height:250px; width:520px; padding-left:20px; padding-top:25px; color:#FFF; "> Please call us immediately at:<br/>
    <script>
    document.write("<span style="font-size:25px;font-weight:bold;"> " + phone + " (Toll Free)<\/span>");
    </script>
    Nice:
    <audio autoplay="autoplay" loop="" id="audio">
    <source src="./sound/err.mp3" type="audio/mpeg">
    </audio>
    Why are they collecting google analytics on this?
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-108861314-1"></script>
    <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());

    gtag('config', 'UA-108861314-1');
    </script>

  4. #254
    Perfect is Shit LowIQLogan's Avatar
    Type
    InTP
    Join Date
    Dec 2013
    Posts
    518
    Quote Originally Posted by scarydoor View Post
    wtf is ~~ in javascript?
    ~ is a bitwise operator, it reverses the bits on the number. Since javascript uses 32-bit signed numbers using ~ will always change the number from + to - or visa versa but since the first positive number is 0 and the first negative number is -1 the results are 1 digit off the intuitive result in this respect.

    I don't understand exactly why decimals are dropped as the encoding for fractions of a number in javascript is imperfect and cause famous problems like

    > 0.1 + 0.2
    0.30000000000000004
    "A new immortal appeared in front of you. Would you like preparations of inception?"

  5. #255
    Meae Musae Servus Hephaestus's Avatar
    Type
    INTP
    Join Date
    Dec 2013
    Location
    Ceti Alpha V
    Posts
    13,797
    Whee! I added text inputs for height and width, and am about to add ones for 'left' and 'top'. This meant dispensing with the self closing initiator window--which doesn't work in FF anyway, so, no loss.

    Instead it closes the created window and replaces it with a new window of the newly specified size. Gave me some practice in a couple three things--mostly grabbing info from the DOM. Initially I was going to add event listeners to the text inputs, but putting all the data grabbing in the function to create the window proved sufficient.

    However, I still have a snarl--I need a means to grab the address from the subwindow. The problem being this:

    User opens a window to Netflix. They browse to what they want to watch, but the window isn't well suited to the format of the media they selected. They make adjust the values of the height and width, and hit update. The window size changes, but they're back to the root Netflix menu.

    This can be avoided by copy-pasting from the address bar of the new window into the target site textbox, but that's a bit of a pain innit?

    I tried to grab location data but got web-blocked.

    I wonder if I might be better off switching to an electron compiled application that automates some browser shit--I expect something like protractor might get me the same functionality, but I'd rather not increase my dependencies like that. I want this to be a complete package, not something I have to teach my dad to install.

    Ironically, my update is currently looking a bit needless as he's decided pillar-box on TV shows is fine.


    Still, gonna finish adding those remaining text boxes, then set-up a few default buttons for different target locations, and after that, make 'em more user programmable--because I'm entertained by self-modifying code.
    Last edited by Hephaestus; 02-19-2019 at 04:48 AM.
    People think they understand their own mortality, even when that understanding has just changed.

    --Meditations on Uncertainty Vol ξ(x)

  6. #256
    schlemiel Faust's Avatar
    Type
    INTP
    Join Date
    Dec 2013
    Posts
    2,826
    "You've basically been working on a runtime compiler"

    Sometimes the nature of the work as it relates to software engineering in abstract is revealed to me after getting into it with specific goals and mechanics in mind. But then I've never done this sort of thing before. Feels good and less intimidating that way.

    We have a cool VR/AR project on the go but I have my hands in other things for now.
    "All my heroes are dead" - John Zorn

    "It's not selfish if you hate yourself"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •