Open blob objectURL in Chrome

后端 未结 6 1603
挽巷
挽巷 2020-12-24 06:22

I want to open a PDF in a new tab in chrome browser (Chrome 56.0.2924.87, Ubuntu 14.04) using window.open(fileObjectURL) in javascript. I am creating the blob f

6条回答
  •  攒了一身酷
    2020-12-24 07:20

    Work around way to by pass adblocker.

    coffeescript & jquery

    $object = $("")
    $object.css
      position: 'fixed'
      top: 0
      left: 0
      bottom: 0
      right: 0
      width: '100%'
      height: '100%'
    $object.attr 'type', 'application/pdf'
    $object.attr 'data', fileObjectURL
    new_window = window.open()
    new_window.onload = ->
      $(new_window.document.body).append $object
    
        

    提交回复
    热议问题