SWFlash0

Members
  • Posts

    90
  • Joined

  • Last visited

 Content Type 

Profiles

Forums

Release Notes

Bug Tracker

Help page

Help page-CN

Release Note5

Rules and recruitment

Release Note6

Posts posted by SWFlash0

  1. I narrowed the javascript down to show you where problem occurs:

    http://kek.2fh.co/test/svgcanvas.htmcanvasimage.src=canvaselement.toDataURL('image/png')

    rKL4wUv.gif SecurityError: An attempt was made to break through the security policy of the user agent.

    The code is supposed to first draw an SVG image onto the canvas and then render the canvas back into an image. Chrome and Firefox can do it fine, but Maxthon and IE throw a CORS error.

  2. Nice work, there are things that could be improved but it looks very good so far

    For example, try playing with mousewheel when your mouse is outside of the picture

    Resizing the window resets the zoom (you could make it so it still brings the picture to the middle but keep the zoom)

    Darker background like in Firefox

    Checkerboard pattern for transparent PNGs and GIFs

    And here's what I'd like to see: some sort of heads-up interface at the bottom that would have buttons like rotate and 100% size, along with zoom slider

  3. Console returns these errors:rKL4wUv.gif Unable to get image data from canvas because the canvas has been tainted by cross-origin data.

    rKL4wUv.gif Uncaught SecurityError: An attempt was made to break through the security policy of the user agent.

    It makes it look like it's complaining about cross-origin resource sharing, but the problem isn't exactly there. It's the SVG images that the script tries to draw on canvas, Maxthon doesn't seem to support that.

  4. Extension is 172 kilobytes, 165 of which is from an SVG file that consists of a rectangle and a 1280x863 PNG image of an eye

    The extension icon must have _16, _32, and _48 resolutions

    JSON is badly formatted:

    >'svg_icon' : 'eye.svg',

    >'title' : { '_t' : 'imgviewplus' },

    The script itself:

    >Line 53: Uncaught SyntaxError: Unexpected token ;if(nw>=getw()){seth(wh);setw(Math.floor(wh*(nw/nh));x=(ww-getw())/2;y=0;}Enhance:if

    (

    nw>=getw()

    )

    {

    seth(

    wh

    );

    setw(

    Math.floor

    (

    wh*

    (

    nw/nh

    )

    )

    // There should be a ")" symbol to close "setw" function

    ;

    x=

    (

    ww-getw()

    )

    /2;

    y=0;

    }This same error repeats for lines 54 and 55

    >Line 54: Uncaught ReferenceError: getnh is not defined

    Possibly a typo of geth()

    After fixing all of these errors it sort of works, image appears at the top-left corner for some reason and zoom is broken. And you can move the image out of the boundaries of the window (especially when the window is resized)

  5. I tried it, doesn't seem very good to me:

    1. Your userscript doesn't have Greasemonkey-native functions, so it should be very easy to convert to a Maxthon extension

    2. It shouldn't fit images smaller than the screen

    3. Zooming is broken by design, you can only zoom into the center and from the center, so if you move the image around you'll be back in the middle when you scroll

    4. If you click the image a few times it can start appearing anywhere on the screen

    5. It has the same problem as the default viewer: scrolling to the left or right (you can do that on some mice) does the same as scrolling up and down

    6. You shouldn't rely on the correct file extension to start the script and instead should check if "imgView" variable is defined

  6. Open Sans font is downloaded from fonts.googleapis.com (CSS) and fonts.gstatic.com (TTF). In console, if you click on one of the fonts in the Resources tab, do you see them correctly? I tried blocking the Google domains, but it would just fallback to the next font (Helvetica or Arial), so I guess if you block them, you should see the text

    wQ1vZad.png

  7. Sorry for a late reply, but have you tried reading the SDK?var rt = window.external.mxGetRuntime()

    var browser = rt.create("mx.browser")

    var returnedvalue = browser.executeScript("mytools(\""+tool+"\")")Because executeScript() function is basically an eval you'll have to dynamically insert the strings/objects for arguments that gets passed to the mytools() function in the page (I assumed tool variable was a string for this example). The returnedvalue variable will contain the function's return value

  8. A large number of websites, instead of storing CSS, images, Javascript, and other similar static content on the same server that processees user input (like navigating pages that change if you login), they often choose to store them on a separate server called content delivery network (which may be distinguished by having CDN somewhere in the hostname). Server computers may go offline due to maintenance or denial of service attacks, as such, you may see a website working fine but not see the CSS and images. The CDN server simply went offline

  9. Can this be "fixed"? Well, here's a quote from your superuser link:

    You may be able to turn this off in Google Chrome, but you do so at your own risk. There is actually a good security reason why Chrome blocks these ports: Basically you open your browser up to being an open proxy for attackers to use to attack other services on your network.

    For more information: Why does Chrome consider some ports unsafe?

    I don't know what kind of server you have that you can't change the port, but did you try to use IE mode?