qsniyg / maxurl

Finds larger/original versions of images and videos
https://qsniyg.github.io/maxurl/
Apache License 2.0
1.11k stars 69 forks source link

Popup opening bug #367

Closed cosuwi closed 4 years ago

cosuwi commented 4 years ago

When the popup opening trigger is the key and the popup closing trigger is “any trigger” or “all triggers” (unlike “Esc/Close”), the popup for a certain image is not shown at the first key press (first time on a page for that image) but is shown at next key presses. Browser: latest Firefox. Extension settings: {"imu_enabled":true,"language":"en","check_updates":true,"check_update_interval":24,"check_update_notify":false,"dark_mode":false,"settings_tabs":false,"settings_visible_description":true,"settings_show_disabled":true,"settings_show_requirements":true,"advanced_options":true,"allow_browser_request":true,"use_blob_over_arraybuffer":false,"allow_live_settings_reload":true,"allow_remote":true,"disable_keybind_when_editing":false,"enable_gm_download":true,"redirect":false,"redirect_history":false,"redirect_extension":true,"canhead_get":true,"redirect_force_page":true,"redirect_infobox_url":false,"redirect_infobox_timeout":7,"print_imu_obj":false,"redirect_disable_for_responseheader":false,"mouseover":true,"mouseover_open_behavior":"popup","mouseover_trigger_behavior":"keyboard","mouseover_trigger_key":[["alt"]],"mouseover_trigger_delay":1,"mouseover_trigger_mouseover":false,"mouseover_trigger_prevent_key":["shift"],"mouseover_close_behavior":["any"],"mouseover_close_need_mouseout":false,"mouseover_jitter_threshold":30,"mouseover_cancel_popup_when_elout":true,"mouseover_cancel_popup_with_esc":false,"mouseover_auto_close_popup":false,"mouseover_auto_close_popup_time":5,"mouseover_use_hold_key":true,"mouseover_hold_key":["i"],"mouseover_hold_position_center":false,"mouseover_hold_close_unhold":false,"mouseover_hold_unclickthrough":true,"mouseover_close_el_policy":"both","mouseover_close_click_outside":true,"mouseover_allow_partial":"media","mouseover_partial_avoid_head":true,"mouseover_use_blob_over_data":false,"mouseover_enable_notallowed":false,"mouseover_enable_notallowed_cant_load":false,"mouseover_notallowed_duration":300,"mouseover_minimum_size":0,"mouseover_exclude_backgroundimages":false,"mouseover_exclude_page_bg":false,"mouseover_exclude_imagemaps":false,"mouseover_only_links":false,"mouseover_exclude_sameimage":false,"mouseover_exclude_imagetab":true,"mouseover_video_controls":true,"mouseover_video_controls_key":["c"],"mouseover_video_loop":true,"mouseover_video_playpause_key":["space"],"mouseover_video_muted":false,"mouseover_video_mute_key":["m"],"mouseover_video_volume":0,"mouseover_video_resume_from_source":true,"mouseover_video_seek_amount":10,"mouseover_video_seek_left_key":[["left"]],"mouseover_video_seek_right_key":[["right"]],"mouseover_video_seek_vertical_scroll":false,"mouseover_video_seek_horizontal_scroll":false,"mouseover_video_frame_prev_key":[","],"mouseover_video_frame_next_key":["."],"mouseover_video_framerate":25,"mouseover_video_speed_down_key":["["],"mouseover_video_speed_up_key":["]"],"mouseover_video_speed_amount":0.25,"mouseover_video_reset_speed_key":["backspace"],"mouseover_ui":true,"mouseover_ui_opacity":100,"mouseover_ui_use_safe_glyphs":false,"mouseover_ui_imagesize":true,"mouseover_ui_zoomlevel":false,"mouseover_ui_filesize":true,"mouseover_ui_gallerycounter":false,"mouseover_ui_gallerymax":50,"mouseover_ui_gallerybtns":false,"mouseover_ui_closebtn":false,"mouseover_ui_optionsbtn":false,"mouseover_ui_downloadbtn":false,"mouseover_ui_rotationbtns":false,"mouseover_ui_caption":true,"mouseover_ui_wrap_caption":false,"mouseover_ui_caption_link_page":true,"mouseover_ui_link_underline":true,"mouseover_use_remote":false,"mouseover_zoom_behavior":"fit","mouseover_zoom_custom_percent":100,"mouseover_pan_behavior":"movement","mouseover_movement_inverted":true,"mouseover_drag_min":5,"mouseover_scrolly_behavior":["nothing"],"mouseover_scrollx_behavior":["nothing"],"scroll_override_page":false,"scroll_zoom_origin":"cursor","scroll_zoom_behavior":"fitfull","scroll_incremental_mult":1.25,"mouseover_move_with_cursor":false,"mouseover_move_within_page":true,"zoom_out_to_close":false,"mouseover_position":["cursor"],"mouseover_prevent_cursor_overlap":true,"mouseover_add_link":true,"mouseover_add_video_link":false,"mouseover_download":false,"mouseover_hide_cursor":false,"mouseover_hide_cursor_after":0,"mouseover_clickthrough":false,"mouseover_links":true,"mouseover_only_valid_links":false,"mouseover_allow_iframe_el":true,"mouseover_allow_canvas_el":true,"mouseover_allow_svg_el":true,"mouseover_enable_gallery":true,"mouseover_gallery_cycle":true,"mouseover_gallery_prev_key":["left"],"mouseover_gallery_next_key":["right"],"mouseover_gallery_move_after_video":false,"mouseover_styles":"border: none; box-shadow: 0px 0px 10px hsl(0, 0%, 70%); margin: 5px 5px 5px -14px;","mouseover_enable_fade":false,"mouseover_enable_zoom_effect":false,"mouseover_zoom_effect_move":false,"mouseover_fade_time":100,"mouseover_enable_mask_styles":false,"mouseover_mask_styles2":"background-color: rgba(0, 0, 0, 0.5)","mouseover_mask_fade_time":100,"mouseover_ui_styles":"background-color: white; color: black; border: 1px solid gray; height: 15px; margin: -10px 5px 0px 0px;","mouseover_wait_use_el":false,"mouseover_add_to_history":false,"mouseover_download_key":[["s"]],"mouseover_open_new_tab_key":[["shift","o"]],"mouseover_open_bg_tab_key":[["o"]],"mouseover_open_options_key":["p"],"mouseover_open_orig_page_key":["n"],"mouseover_rotate_left_key":["e"],"mouseover_rotate_right_key":["r"],"mouseover_flip_horizontal_key":["h"],"mouseover_flip_vertical_key":["v"],"mouseover_zoom_in_key":[["="]],"mouseover_zoom_out_key":[["-"]],"mouseover_zoom_full_key":["1"],"mouseover_zoom_fit_key":["2"],"mouseover_fullscreen_key":["f"],"mouseover_apply_blacklist":true,"apply_blacklist_host":false,"mouseover_matching_media_types":false,"mouseover_support_pointerevents_none":true,"website_inject_imu":true,"website_image":true,"extension_contextmenu":false,"allow_video":true,"allow_dash_video":false,"allow_hls_video":false,"allow_watermark":false,"allow_smaller":true,"allow_possibly_different":false,"allow_possibly_broken":false,"allow_possibly_upscaled":true,"allow_thirdparty":true,"allow_apicalls":true,"allow_thirdparty_libs":true,"allow_thirdparty_code":true,"allow_bruteforce":true,"deviantart_prefer_size":false,"imgur_source":true,"instagram_use_app_api":true,"instagram_gallery_postlink":true,"snapchat_orig_media":false,"tiktok_no_watermarks":true,"tumblr_api_key":"xrMpLM8n1eCeL3oRYSZG7CLALw6EHhYDdU6Wq5eD1PbMkld7Y1","bigimage_blacklist":"","bigimage_blacklist_engine":"glob","replaceimgs_enable_keybinding":false,"replaceimgs_keybinding":["shift","alt","r"],"replaceimgs_auto":false,"replaceimgs_replaceimgs":true,"replaceimgs_addlinks":true,"replaceimgs_replacelinks":false,"replaceimgs_usedata":false,"replaceimgs_wait_fullyloaded":true,"replaceimgs_totallimit":8,"replaceimgs_domainlimit":2,"highlightimgs_enable_keybinding":false,"highlightimgs_keybinding":["shift","alt","h"],"highlightimgs_enable":false,"highlightimgs_auto":"never","highlightimgs_onlysupported":true,"highlightimgs_css":"outline: 4px solid yellow","last_update_check":1593301608832,"last_update_version":"0.13.12","last_update_url":null,"settings_version":5}

qsniyg commented 4 years ago

I'm not sure if I can reproduce the issue or not. With the "alt" key (as listed in your configuration), Firefox's menu gets toggled (I'm using a mostly stock firefox 76.0.1 build under linux), so I can't reproduce the issue, but when changing it to ctrl, this is the behavior I get:

Is this the behavior you're experiencing? If so, I'll add an option to avoid cancelling loading the popup when the keys are released before the popup has had a chance to load. I'm assuming that if this is the case, this option would solve your issue? If not, please let me know :)

If not however, could you elaborate a little more on how to replicate the issue? Maybe a screencast or something?

I tried with this page: https://www.flickr.com/photos/53889145@N02/7029097495/ . If I load the page (and make sure the input focus is on the page, i.e. the address bar doesn't currently have the focus), and I press ctrl over the image, I get the behavior I listed above.

cosuwi commented 4 years ago

This behavior is experienced with any key and when it is held enough (up to 2 seconds).

qsniyg commented 4 years ago

@cosuwi So just to be clear, could you follow these instructions just to make sure we're on the same page?

Does the cursor change to the "loading" cursor? Or does it ignore it entirely, unless you release Ctrl, then press and hold Ctrl again?

Sorry, I'm just trying to understand the issue, because I want to be able to figure out what is causing it in order to fix it :)

cosuwi commented 4 years ago

After the first pressing and holding Ctrl, the cursor changed to the “loading” cursor, but the popup was not shown.

qsniyg commented 4 years ago

I've just added a new option in https://github.com/qsniyg/maxurl/commit/dddbfe599f2c4380539f45c3d63a78d7a31c0315, let me know if disabling "Releasing triggers cancels loading" fixes the issue :)

cosuwi commented 4 years ago

The new option solves the issue. Thanks!