From 53c18a078956f45a45ae641029e4842d1f973cb1 Mon Sep 17 00:00:00 2001 From: Pawit Pornkitprasan Date: Sun, 10 Jun 2018 19:31:12 +0700 Subject: [PATCH] Update date picker code (#2) Fixes the script to work on the current versions of Google Photos. The two problems were: - When a new timezone is selected, the dropdown field was not updated - The script failed to verify the current timezone --- google-photos-tz-fix.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/google-photos-tz-fix.js b/google-photos-tz-fix.js index 2cefa11..437cb3e 100644 --- a/google-photos-tz-fix.js +++ b/google-photos-tz-fix.js @@ -216,12 +216,12 @@ }) .done(function() { setTimeout(function() { - $(dialog).find(FIELD_TZ).filter(':contains("' + EXPECTED_TZ + '")').click(); + $(dialog).find(FIELD_TZ).filter(':contains("' + EXPECTED_TZ + '")').last().click(); }, rand(800, 500)); }); }, verify: function() { - return ($(dialog).find(FIELD_TZ).attr('aria-label') || '').indexOf(EXPECTED_TZ) !== -1; + return ($(dialog).find(FIELD_TZ).filter('[aria-selected="true"]').attr('aria-label') || '').indexOf(EXPECTED_TZ) !== -1; }, value: EXPECTED_TZ },